1 | r""" |
---|
2 | Lorentz (Ornstein-Zernicke Model) |
---|
3 | |
---|
4 | Definition |
---|
5 | ---------- |
---|
6 | |
---|
7 | The Ornstein-Zernicke model is defined by |
---|
8 | |
---|
9 | .. math:: I(q)=\frac{\text{scale}}{1+(qL)^2}+\text{background} |
---|
10 | |
---|
11 | The parameter $L$ is the screening length *cor_length*. |
---|
12 | |
---|
13 | For 2D data the scattering intensity is calculated in the same way as 1D, |
---|
14 | where the $q$ vector is defined as |
---|
15 | |
---|
16 | .. math:: q=\sqrt{q_x^2 + q_y^2} |
---|
17 | |
---|
18 | |
---|
19 | References |
---|
20 | ---------- |
---|
21 | |
---|
22 | L.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 | |
---|
26 | from numpy import inf |
---|
27 | |
---|
28 | name = "lorentz" |
---|
29 | title = "Ornstein-Zernicke correlation length model" |
---|
30 | description = """ |
---|
31 | Model that evaluates a Lorentz (Ornstein-Zernicke) model. |
---|
32 | |
---|
33 | I(q) = scale/( 1 + (q*L)^2 ) + bkd |
---|
34 | |
---|
35 | The model has three parameters: |
---|
36 | length = screening Length |
---|
37 | scale = scale factor |
---|
38 | background = incoherent background |
---|
39 | """ |
---|
40 | category = "shape-independent" |
---|
41 | |
---|
42 | # ["name", "units", default, [lower, upper], "type","description"], |
---|
43 | parameters = [["cor_length", "Ang", 50.0, [0, inf], "", "Screening length"],] |
---|
44 | |
---|
45 | Iq = """ |
---|
46 | double denominator = 1 + (q*cor_length)*(q*cor_length); |
---|
47 | return 1/denominator; |
---|
48 | """ |
---|
49 | |
---|
50 | Iqxy = """ |
---|
51 | return Iq(sqrt(qx*qx + qy*qy), cor_length); |
---|
52 | """ |
---|
53 | |
---|
54 | # parameters for demo |
---|
55 | demo = dict(scale=1.0, background=0.0, cor_length=50.0) |
---|
56 | |
---|
57 | # parameters for unit tests |
---|
58 | tests = [[{'cor_length': 250}, 0.01, 0.138931]] |
---|