source: sasmodels/sasmodels/models/lamellar_hg.py @ 40a87fa

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

lint and latex cleanup

  • Property mode set to 100644
File size: 3.8 KB
RevLine 
[dc02af0]1# Note: model title and parameter table are inserted automatically
2r"""
[eb69cce]3This model provides the scattering intensity, $I(q)$, for a lyotropic lamellar
[3c56da87]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
[d138d43]7Definition
8----------
[dc02af0]9
[d138d43]10The scattering intensity $I(q)$ is
[dc02af0]11
12.. math::
13
[d138d43]14   I(q) = 2\pi\frac{\text{scale}}{2(\delta_H + \delta_T)}  P(q) \frac{1}{q^2}
[dc02af0]15
[d138d43]16The form factor $P(q)$ is
[dc02af0]17
[d138d43]18.. math::
19
20    P(q) = \frac{4}{q^2}
21        \left\lbrace
22            \Delta \rho_H
23            \left[\sin[q(\delta_H + \delta_T)\ - \sin(q\delta_T)\right]
24            + \Delta\rho_T\sin(q\delta_T)
25        \right\rbrace^2
[dc02af0]26
[eb69cce]27where $\delta_T$ is *tail_length*, $\delta_H$ is *head_length*,
[6ab4ed8]28$\Delta\rho_H$ is the head contrast (*sld_head* $-$ *sld_solvent*),
29and $\Delta\rho_T$ is tail contrast (*sld* $-$ *sld_solvent*).
[dc02af0]30
[40a87fa]31The total thickness of the lamellar sheet is $\delta_H + \delta_T + \delta_T + \delta_H$.
32Note that in a non aqueous solvent the chemical "head" group may be the
[52a3db3]33"Tail region" and vice-versa.
34
[3c56da87]35The 2D scattering intensity is calculated in the same way as 1D, where
[eb69cce]36the $q$ vector is defined as
[dc02af0]37
[40a87fa]38.. math:: q = \sqrt{q_x^2 + q_y^2}
[dc02af0]39
[d138d43]40References
41----------
[dc02af0]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
[6ab4ed8]52name = "lamellar_hg"
53title = "Random lamellar phase with Head and Tail Groups"
[dc02af0]54description = """\
[6ab4ed8]55    [Random lamellar phase with Head and Tail Groups]
[3e428ec]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
[6ab4ed8]60        sld_head = Head scattering length density
61        sld_solvent = solvent scattering length density
[3e428ec]62        background = incoherent background
63        scale = scale factor
[dc02af0]64"""
[a5d0d00]65category = "shape:lamellae"
[dc02af0]66
[3eb6b90]67# pylint: disable=bad-whitespace, line-too-long
[3e428ec]68#             ["name", "units", default, [lower, upper], "type","description"],
[6ab4ed8]69parameters = [["tail_length", "Ang",       15,   [0, inf],  "volume",  "Tail thickness ( total = H+T+T+H)"],
70              ["head_length", "Ang",       10,   [0, inf],  "volume",  "Head thickness"],
[42356c8]71              ["sld",         "1e-6/Ang^2", 0.4, [-inf,inf], "sld",    "Tail scattering length density"],
72              ["sld_head",    "1e-6/Ang^2", 3.0, [-inf,inf], "sld",    "Head scattering length density"],
73              ["sld_solvent", "1e-6/Ang^2", 6,   [-inf,inf], "sld",    "Solvent scattering length density"]]
[3eb6b90]74# pylint: enable=bad-whitespace, line-too-long
[dc02af0]75
76# No volume normalization despite having a volume parameter
77# This should perhaps be volume normalized?
78form_volume = """
79    return 1.0;
80    """
81
82Iq = """
83    const double qsq = q*q;
[6ab4ed8]84    const double drh = sld_head - sld_solvent;
85    const double drt = sld - sld_solvent;    //correction 13FEB06 by L.Porcar
[3c56da87]86    const double qT = q*tail_length;
87    double Pq, inten;
88    Pq = drh*(sin(q*(head_length+tail_length))-sin(qT)) + drt*sin(qT);
89    Pq *= Pq;
90    Pq *= 4.0/(qsq);
91
92    inten = 2.0e-4*M_PI*Pq/qsq;
93
94    // normalize by the bilayer thickness
95    inten /= 2.0*(head_length+tail_length);
96
97    return inten;
[dc02af0]98    """
[3c56da87]99
[dc02af0]100# ER defaults to 0.0
101# VR defaults to 1.0
102
[3e428ec]103demo = dict(scale=1, background=0,
[3eb6b90]104            tail_length=15, head_length=10,
[6ab4ed8]105            sld=0.4, sld_head=3.0, sld_solvent=6.0,
[3eb6b90]106            tail_length_pd=0.2, tail_length_pd_n=40,
107            head_length_pd=0.01, head_length_pd_n=40)
[3c56da87]108
[7f47777]109#
[40a87fa]110tests = [
111    [{'scale': 1.0, 'background': 0.0, 'tail_length': 15.0, 'head_length': 10.0,
112      'sld': 0.4, 'sld_head': 3.0, 'sld_solvent': 6.0},
113     [0.001], [653143.9209]],
114]
115# ADDED by: RKH  ON: 18Mar2016  converted from sasview previously, now renaming everything & sorting the docs
Note: See TracBrowser for help on using the repository browser.