1 | r""" |
---|
2 | Polydispersity in the bilayer thickness can be applied from the GUI. |
---|
3 | |
---|
4 | Definition |
---|
5 | ---------- |
---|
6 | |
---|
7 | The scattering intensity $I(q)$ is |
---|
8 | |
---|
9 | .. math:: |
---|
10 | |
---|
11 | I(q) = \frac{2\pi P(q)}{\delta q^2} |
---|
12 | |
---|
13 | |
---|
14 | The form factor is |
---|
15 | |
---|
16 | .. math:: |
---|
17 | |
---|
18 | P(q) = \frac{2\Delta\rho^2}{q^2}(1-cos(q\delta)) |
---|
19 | |
---|
20 | |
---|
21 | where $\delta$ is the bilayer thickness. |
---|
22 | |
---|
23 | The 2D scattering intensity is calculated in the same way as 1D, where |
---|
24 | the $q$ vector is defined as |
---|
25 | |
---|
26 | .. math:: |
---|
27 | |
---|
28 | q = \sqrt{q_x^2 + q_y^2} |
---|
29 | |
---|
30 | |
---|
31 | References |
---|
32 | ---------- |
---|
33 | |
---|
34 | F Nallet, R Laversanne, and D Roux, J. Phys. II France, 3, (1993) 487-502 |
---|
35 | |
---|
36 | also in J. Phys. Chem. B, 105, (2001) 11081-11088 |
---|
37 | |
---|
38 | |
---|
39 | """ |
---|
40 | |
---|
41 | from numpy import inf |
---|
42 | |
---|
43 | name = "lamellar" |
---|
44 | title = "Lyotropic lamellar phase with uniform SLD and random distribution" |
---|
45 | description = """\ |
---|
46 | [Dilute Lamellar Form Factor](from a lyotropic lamellar phase) |
---|
47 | I(q)= 2*pi*P(q)/(delta *q^(2)), where |
---|
48 | P(q)=2*(contrast/q)^(2)*(1-cos(q*delta))^(2)) |
---|
49 | thickness = layer thickness |
---|
50 | sld = layer scattering length density |
---|
51 | sld_solvent = solvent scattering length density |
---|
52 | background = incoherent background |
---|
53 | scale = scale factor |
---|
54 | """ |
---|
55 | category = "shape:lamellae" |
---|
56 | |
---|
57 | # ["name", "units", default, [lower, upper], "type","description"], |
---|
58 | parameters = [["sld", "1e-6/Ang^2", 1, [-inf, inf], "", |
---|
59 | "Layer scattering length density" ], |
---|
60 | ["solvent_sld", "1e-6/Ang^2", 6, [-inf, inf], "", |
---|
61 | "Solvent scattering length density" ], |
---|
62 | ["thickness", "Ang", 50, [0, inf], "volume","Bilayer thickness" ], |
---|
63 | ] |
---|
64 | |
---|
65 | |
---|
66 | # No volume normalization despite having a volume parameter |
---|
67 | # This should perhaps be volume normalized? |
---|
68 | form_volume = """ |
---|
69 | return 1.0; |
---|
70 | """ |
---|
71 | |
---|
72 | Iq = """ |
---|
73 | const double sub = sld - solvent_sld; |
---|
74 | const double qsq = q*q; |
---|
75 | // Original expression |
---|
76 | //return 4.0e-4*M_PI*sub*sub/qsq * (1.0-cos(q*thickness)) / (thickness*qsq); |
---|
77 | // const double alpha = fmod(q*thickness+0.1, 2.0*M_PI)-0.1; |
---|
78 | // Use small angle fix 1-cos(theta) = 2 sin^2(theta/2) |
---|
79 | const double sinq2 = sin(0.5*q*thickness); |
---|
80 | return 4.0e-4*M_PI*sub*sub/qsq * 2.0*sinq2*sinq2 / (thickness*qsq); |
---|
81 | """ |
---|
82 | |
---|
83 | Iqxy = """ |
---|
84 | return Iq(sqrt(qx*qx+qy*qy), IQ_PARAMETERS); |
---|
85 | """ |
---|
86 | |
---|
87 | # ER defaults to 0.0 |
---|
88 | # VR defaults to 1.0 |
---|
89 | |
---|
90 | demo = dict(scale=1, background=0, |
---|
91 | sld=6, solvent_sld=1, |
---|
92 | thickness=40, |
---|
93 | thickness_pd=0.2, thickness_pd_n=40) |
---|
94 | oldname = 'LamellarModel' |
---|
95 | oldpars = dict(sld='sld_bi', solvent_sld='sld_sol', thickness='bi_thick') |
---|
96 | tests = [ |
---|
97 | [ {'scale': 1.0, 'background' : 0.0, 'thickness' : 50.0, 'sld' : 1.0,'solvent_sld' : 6.3, 'thickness_pd' : 0.0, |
---|
98 | }, [0.001], [882289.54309]] |
---|
99 | ] |
---|
100 | # ADDED by: converted by PAK? (or RKH?) ON: 16Mar2016 - RKH adding unit tests from sasview to early 2015 conversion |
---|
101 | # [(qx1, qy1), (qx2, qy2), ...], [I(qx1,qy1), I(qx2,qy2), ...]], |
---|