source: sasmodels/sasmodels/models/lorentz.py @ 2c74c11

core_shell_microgelscostrafo411magnetic_modelrelease_v0.94release_v0.95ticket-1257-vesicle-productticket_1156ticket_1265_superballticket_822_more_unit_tests
Last change on this file since 2c74c11 was 2c74c11, checked in by Paul Kienzle <pkienzle@…>, 8 years ago

implicit Iqxy; fix divide by 0 for q=0

  • Property mode set to 100644
File size: 1.3 KB
Line 
1r"""
2Lorentz (Ornstein-Zernicke Model)
3
4Definition
5----------
6
7The Ornstein-Zernicke model is defined by
8
9.. math:: I(q)=\frac{\text{scale}}{1+(qL)^2}+\text{background}
10
11The parameter $L$ is the screening length *cor_length*.
12
13For 2D data the scattering intensity is calculated in the same way as 1D,
14where the $q$ vector is defined as
15
16.. math:: q=\sqrt{q_x^2 + q_y^2}
17
18
19References
20----------
21
22L.S. Qrnstein and F. Zernike, *Proc. Acad. Sci. Amsterdam* 17, 793 (1914), and
23*Z. Phys.* 19, 134 (1918), and 27, 761 {1926); referred to as QZ.
24"""
25
26from numpy import inf
27
28name = "lorentz"
29title = "Ornstein-Zernicke correlation length model"
30description = """
31Model that evaluates a Lorentz (Ornstein-Zernicke) model.
32       
33I(q) = scale/( 1 + (q*L)^2 ) + bkd
34       
35The model has three parameters:
36    length     =  screening Length
37    scale  =  scale factor
38    background    =  incoherent background
39"""
40category = "shape-independent"
41
42#             ["name", "units", default, [lower, upper], "type","description"],
43parameters = [["cor_length", "Ang", 50.0, [0, inf], "", "Screening length"],]
44
45Iq = """
46    double denominator = 1 + (q*cor_length)*(q*cor_length);
47    return 1/denominator;
48"""
49
50# parameters for demo
51demo = dict(scale=1.0, background=0.0, cor_length=50.0)
52
53# parameters for unit tests
54tests = [[{'cor_length': 250}, 0.01, 0.138931]]
Note: See TracBrowser for help on using the repository browser.