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

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

doc fixups: add doc category to model def, convert equations to latex for barbell and bcc

  • 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"""
73category = "shape:lamellae"
74
75parameters = [
76#   [ "name", "units", default, [lower, upper], "type",
77#     "description" ],
78    [ "tail_length", "Ang",  15, [0, inf], "volume",
79      "Tail thickness" ],
80    [ "head_length", "Ang",  10, [0, inf], "volume",
81      "head thickness" ],
82    [ "sld", "1e-6/Ang^2", 0.4, [-inf,inf], "",
83      "Tail scattering length density" ],
84    [ "head_sld", "1e-6/Ang^2", 3.0, [-inf,inf], "",
85      "Head scattering length density" ],
86    [ "solvent_sld", "1e-6/Ang^2", 6, [-inf,inf], "",
87      "Solvent scattering length density" ],
88    ]
89
90# No volume normalization despite having a volume parameter
91# This should perhaps be volume normalized?
92form_volume = """
93    return 1.0;
94    """
95
96Iq = """
97    const double qsq = q*q;
98        const double drh = head_sld - solvent_sld;
99        const double drt = sld  - solvent_sld;          //correction 13FEB06 by L.Porcar
100        const double qT = q*tail_length;
101        double Pq, inten;
102        Pq = drh*(sin(q*(head_length+tail_length))-sin(qT)) + drt*sin(qT);
103        Pq *= Pq;
104        Pq *= 4.0/(qsq);
105       
106        inten = 2.0e-4*M_PI*Pq/qsq;     
107       
108        return inten /= 2.0*(head_length+tail_length);  //normalize by the bilayer thickness   
109               
110    """
111       
112Iqxy = """
113    // never called since no orientation or magnetic parameters.
114    return -1.0;
115    """
116
117# ER defaults to 0.0
118# VR defaults to 1.0
119
120demo = dict(
121        scale=1, background=0,
122                tail_length=15,head_length=10,
123        sld=0.4, head_sld=3.0, solvent_sld=6.0,
124                tail_length_pd= 0.2, tail_length_pd_n=40,
125                head_length_pd= 0.01, head_length_pd_n=40,
126          )
127oldname = 'LamellarFFHGModel'
128oldpars = dict(head_length='h_thickness', sld='sld_tail', head_sld='sld_head', solvent_sld='sld_solvent')
129
Note: See TracBrowser for help on using the repository browser.