source: sasmodels/sasmodels/models/lamellar.py @ ec45c4f

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

remove oldname/oldpars from new models

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