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) = 2\pi{P(Q) \over \delta Q^2} |
---|
12 | |
---|
13 | |
---|
14 | The form factor is |
---|
15 | |
---|
16 | .. math:: |
---|
17 | |
---|
18 | P(Q) = {2\Delta\rho^2 \over Q^2}(1-cos(Q\delta)) |
---|
19 | |
---|
20 | |
---|
21 | where |delta| = bilayer thickness. |
---|
22 | |
---|
23 | The 2D scattering intensity is calculated in the same way as 1D, where the $Q$ vector is defined as |
---|
24 | |
---|
25 | .. math:: |
---|
26 | |
---|
27 | Q = \sqrt{Q_x^2 + Q_y^2} |
---|
28 | |
---|
29 | |
---|
30 | |
---|
31 | Our model uses the form factor calculations implemented in a c-library provided by the NIST Center for Neutron Research |
---|
32 | (Kline, 2006). |
---|
33 | |
---|
34 | .. figure:: img/lamellar_1d.jpg |
---|
35 | |
---|
36 | 1D plot using the default values (w/1000 data point). |
---|
37 | |
---|
38 | |
---|
39 | Reference |
---|
40 | --------- |
---|
41 | |
---|
42 | F Nallet, R Laversanne, and D Roux, J. Phys. II France, 3, (1993) 487-502 |
---|
43 | |
---|
44 | also in J. Phys. Chem. B, 105, (2001) 11081-11088 |
---|
45 | |
---|
46 | |
---|
47 | """ |
---|
48 | |
---|
49 | from numpy import inf |
---|
50 | |
---|
51 | name = "lamellar" |
---|
52 | title = "Lyotropic lamellar phase with uniform SLD and random distribution" |
---|
53 | description = """\ |
---|
54 | [Dilute Lamellar Form Factor](from a lyotropic lamellar phase) |
---|
55 | I(q)= 2*pi*P(q)/(delta *q^(2)), where |
---|
56 | P(q)=2*(contrast/q)^(2)*(1-cos(q*delta))^(2)) |
---|
57 | thickness = layer thickness |
---|
58 | sld = layer scattering length density |
---|
59 | sld_solvent = solvent scattering length density |
---|
60 | background = incoherent background |
---|
61 | scale = scale factor |
---|
62 | """ |
---|
63 | category = "shape:lamellae" |
---|
64 | |
---|
65 | # ["name", "units", default, [lower, upper], "type","description"], |
---|
66 | parameters = [["sld", "1e-6/Ang^2", 1, [-inf, inf], "", |
---|
67 | "Layer scattering length density" ], |
---|
68 | ["solvent_sld", "1e-6/Ang^2", 6, [-inf, inf], "", |
---|
69 | "Solvent scattering length density" ], |
---|
70 | ["thickness", "Ang", 50, [0, inf], "volume","Bilayer thickness" ], |
---|
71 | ] |
---|
72 | |
---|
73 | |
---|
74 | # No volume normalization despite having a volume parameter |
---|
75 | # This should perhaps be volume normalized? |
---|
76 | form_volume = """ |
---|
77 | return 1.0; |
---|
78 | """ |
---|
79 | |
---|
80 | Iq = """ |
---|
81 | const double sub = sld - solvent_sld; |
---|
82 | const double qsq = q*q; |
---|
83 | // Original expression |
---|
84 | //return 4.0e-4*M_PI*sub*sub/qsq * (1.0-cos(q*thickness)) / (thickness*qsq); |
---|
85 | // const double alpha = fmod(q*thickness+0.1, 2.0*M_PI)-0.1; |
---|
86 | // Use small angle fix 1-cos(theta) = 2 sin^2(theta/2) |
---|
87 | const double sinq2 = sin(0.5*q*thickness); |
---|
88 | return 4.0e-4*M_PI*sub*sub/qsq * 2.0*sinq2*sinq2 / (thickness*qsq); |
---|
89 | """ |
---|
90 | |
---|
91 | Iqxy = """ |
---|
92 | return Iq(sqrt(qx*qx+qy*qy), IQ_PARAMETERS); |
---|
93 | """ |
---|
94 | |
---|
95 | # ER defaults to 0.0 |
---|
96 | # VR defaults to 1.0 |
---|
97 | |
---|
98 | demo = dict(scale=1, background=0, |
---|
99 | sld=6, solvent_sld=1, |
---|
100 | thickness=40, |
---|
101 | thickness_pd=0.2, thickness_pd_n=40) |
---|
102 | oldname = 'LamellarModel' |
---|
103 | oldpars = dict(sld='sld_bi', solvent_sld='sld_sol', thickness='bi_thick') |
---|
104 | |
---|