source: sasmodels/sasmodels/models/lamellarFFHG.py @ dc02af0

core_shell_microgelscostrafo411magnetic_modelrelease_v0.94release_v0.95ticket-1257-vesicle-productticket_1156ticket_1265_superballticket_822_more_unit_tests
Last change on this file since dc02af0 was dc02af0, checked in by richardh, 9 years ago

adding Lamellar models, polydisp needs checking

  • Property mode set to 100644
File size: 3.8 KB
Line 
1# Note: model title and parameter table are inserted automatically
2r"""
3This model provides the scattering intensity, *I(q)*, for a lyotropic lamellar phase where a random distribution in
4solution are assumed. The SLD of the head region is taken to be different from the SLD of the tail region.
5
6*2.1.31.1. Definition*
7
8The scattering intensity *I(q)* is
9
10.. math::
11
12    I(Q) = 2\pi{P(Q) \over (2(|delta|\ H +|delta|\ T) Q^2)
13
14The form factor is
15
16.. image:: img/lamellarFFHG_.jpg
17
18where |delta|\ T = tail length (or *tail_length*), |delta|\ H = head thickness (or *h_thickness*),
19|drho|\ H = SLD(headgroup) - SLD(solvent), and |drho|\ T = SLD(tail) - SLD(solvent).
20
21The 2D scattering intensity is calculated in the same way as 1D, where the *q* vector is defined as
22
23.. math::
24
25    Q = \sqrt{Q_x^2 + Q_y^2}
26
27The returned value is in units of |cm^-1|, on absolute scale. In the parameters, *sld_tail* = SLD of the tail group,
28and *sld_head* = SLD of the head group.
29
30==============  ========  =============
31Parameter name  Units     Default value
32==============  ========  =============
33background      |cm^-1|   0.0
34head_sld        |Ang^-2|  3e-06
35scale            None      1
36solvent_sld     |Ang^-2|  6e-06
37head_length     |Ang|     10
38tail_length     |Ang|     15
39sld (tail)      |Ang^-2|  0
40==============  ========  =============
41
42.. image:: img/lamellarFFHG_138.jpg
43
44*Figure. 1D plot using the default values (w/1000 data point).*
45
46Our model uses the form factor calculations implemented in a c-library provided by the NIST Center for Neutron Research
47(Kline, 2006).
48
49REFERENCE
50
51F Nallet, R Laversanne, and D Roux, J. Phys. II France, 3, (1993) 487-502
52
53also in J. Phys. Chem. B, 105, (2001) 11081-11088
54
55*2014/04/17 - Description reviewed by S King and P Butler.*
56"""
57
58from numpy import pi, inf
59
60name = "lamellar_FFHG"
61title = "Random lamellar phase with Head Groups "
62description = """\
63        [Random lamellar phase with Head Groups]
64                I(q)= 2*pi*P(q)/(2(H+T)*q^(2)), where
65                P(q)= see manual
66                layer thickness =(H+T+T+H) = 2(Head+Tail)
67                sld = Tail scattering length density
68                sld_head = Head scattering length density
69                sld_solvent = solvent scattering length density
70                background = incoherent background
71                scale = scale factor
72"""
73
74parameters = [
75#   [ "name", "units", default, [lower, upper], "type",
76#     "description" ],
77    [ "tail_length", "Ang",  15, [0, inf], "volume",
78      "Tail thickness" ],
79    [ "head_length", "Ang",  10, [0, inf], "volume",
80      "head thickness" ],
81    [ "sld", "1e-6/Ang^2", 0.4, [-inf,inf], "",
82      "Tail scattering length density" ],
83    [ "head_sld", "1e-6/Ang^2", 3.0, [-inf,inf], "",
84      "Head scattering length density" ],
85    [ "solvent_sld", "1e-6/Ang^2", 6, [-inf,inf], "",
86      "Solvent scattering length density" ],
87    ]
88
89# No volume normalization despite having a volume parameter
90# This should perhaps be volume normalized?
91form_volume = """
92    return 1.0;
93    """
94
95Iq = """
96    const double qsq = q*q;
97        const double drh = head_sld - solvent_sld;
98        const double drt = sld  - solvent_sld;          //correction 13FEB06 by L.Porcar
99        const double qT = q*tail_length;
100        double Pq, inten;
101        Pq = drh*(sin(q*(head_length+tail_length))-sin(qT)) + drt*sin(qT);
102        Pq *= Pq;
103        Pq *= 4.0/(qsq);
104       
105        inten = 2.0e-4*M_PI*Pq/qsq;     
106       
107        return inten /= 2.0*(head_length+tail_length);  //normalize by the bilayer thickness   
108               
109    """
110       
111Iqxy = """
112    // never called since no orientation or magnetic parameters.
113    return -1.0;
114    """
115
116# ER defaults to 0.0
117# VR defaults to 1.0
118
119demo = dict(
120        scale=1, background=0,
121                tail_length=15,head_length=10,
122        sld=0.4, head_sld=3.0, solvent_sld=6.0,
123                tail_length_pd= 0.2, tail_length_pd_n=40,
124                head_length_pd= 0.01, head_length_pd_n=40,
125          )
126oldname = 'LamellarFFHGModel'
127oldpars = dict(head_length='h_thickness', sld='sld_tail', head_sld='sld_head', solvent_sld='sld_solvent')
128
Note: See TracBrowser for help on using the repository browser.