source: sasmodels/sasmodels/models/lamellarFFHG.py @ 22eac46

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

fix sasview variable mapping for tail length

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