source: sasmodels/sasmodels/models/lamellarCailleHG.py @ 56fac50

core_shell_microgelscostrafo411magnetic_modelrelease_v0.94release_v0.95ticket-1257-vesicle-productticket_1156ticket_1265_superballticket_822_more_unit_tests
Last change on this file since 56fac50 was 652a78a, checked in by mathieu, 8 years ago

Fix pylint

  • Property mode set to 100644
File size: 4.7 KB
RevLine 
[dc02af0]1# Note: model title and parameter table are inserted automatically
2r"""
[12c810f]3This model provides the scattering intensity, $I(q) = P(q)S(q)$, for a lamellar
[eb69cce]4phase where a random distribution in solution are assumed. Here a Caille $S(q)$
[12c810f]5is used for the lamellar stacks.
[dc02af0]6
[12c810f]7The scattering intensity $I(q)$ is
[dc02af0]8
[12c810f]9.. math::
10
11    I(q) = 2 \pi \frac{P(q)S(q)}{\delta q^2}
12
13
14The form factor $P(q)$ is
15
16.. math::
[dc02af0]17
[12c810f]18        P(q) = \frac{4}{q^2}\big\{
19        \Delta\rho_H \left[\sin[q(\delta_H + \delta_T)] - \sin(q\delta_T)\right]
20            + \Delta\rho_T\sin(q\delta_T)\big\}^2
[dc02af0]21
[12c810f]22and the structure factor $S(q)$ is
[dc02af0]23
[12c810f]24.. math::
[dc02af0]25
[12c810f]26    S(q) = 1 + 2 \sum_1^{N-1}\left(1-\frac{n}{N}\right)
27        \cos(qdn)\exp\left(-\frac{2q^2d^2\alpha(n)}{2}\right)
[dc02af0]28
29where
30
[12c810f]31.. math::
[d18f8a8]32    :nowrap:
[12c810f]33
[d18f8a8]34    \begin{align*}
[eb69cce]35    \alpha(n) &= \frac{\eta_{cp}}{4\pi^2} \left(\ln(\pi n)+\gamma_E\right)
[d18f8a8]36              &&  \\
[eb69cce]37    \gamma_E  &= 0.5772156649
[d18f8a8]38              && \text{Euler's constant} \\
[eb69cce]39    \eta_{cp} &= \frac{q_o^2k_B T}{8\pi\sqrt{K\overline{B}}}
[d18f8a8]40              && \text{Caille constant}
41    \end{align*}
[12c810f]42
[dc02af0]43
[12c810f]44$\delta_T$ is the tail length (or *tail_length*), $\delta_H$ is the head
45thickness (or *head_length*), $\Delta\rho_H$ is SLD(headgroup) - SLD(solvent),
46and $\Delta\rho_T$ is SLD(tail) - SLD(headgroup). Here $d$ is (repeat) spacing,
47$K$ is smectic bending elasticity, $B$ is compression modulus, and $N$ is the
48number of lamellar plates (*Nlayers*).
[dc02af0]49
[12c810f]50NB: **When the Caille parameter is greater than approximately 0.8 to 1.0, the
51assumptions of the model are incorrect.**  And due to a complication of the
52model function, users are responsible for making sure that all the assumptions
53are handled accurately (see the original reference below for more details).
[dc02af0]54
[12c810f]55Non-integer numbers of stacks are calculated as a linear combination of
56results for the next lower and higher values.
[dc02af0]57
[12c810f]58The 2D scattering intensity is calculated in the same way as 1D, where
59the $q$ vector is defined as
[dc02af0]60
61.. math::
62
[12c810f]63    q = \sqrt{q_x^2 + q_y^2}
[dc02af0]64
[eb69cce]65.. figure:: img/lamellarCailleHG_1d.jpg
[dc02af0]66
[eb69cce]67    1D plot using the default values (w/6000 data point).
[dc02af0]68
[eb69cce]69References
70----------
[dc02af0]71
72F Nallet, R Laversanne, and D Roux, J. Phys. II France, 3, (1993) 487-502
73
74also in J. Phys. Chem. B, 105, (2001) 11081-11088
75"""
[3c56da87]76from numpy import inf
[dc02af0]77
78name = "lamellarCailleHG"
79title = "Random lamellar sheet with Caille structure factor"
80description = """\
[3e428ec]81    [Random lamellar phase with Caille  structure factor]
[dc02af0]82        randomly oriented stacks of infinite sheets
[3e428ec]83        with Caille S(Q), having polydisperse spacing.
84        layer thickness =(H+T+T+H) = 2(Head+Tail)
85        sld = Tail scattering length density
86        sld_head = Head scattering length density
87        sld_solvent = solvent scattering length density
88        background = incoherent background
89        scale = scale factor
[dc02af0]90"""
[a5d0d00]91category = "shape:lamellae"
[dc02af0]92
[13ed84c]93single = False
[dc02af0]94parameters = [
[d4666ca]95    #   [ "name", "units", default, [lower, upper], "type",
96    #     "description" ],
97    ["tail_length", "Ang", 10, [0, inf], "volume",
98     "Tail thickness"],
99    ["head_length", "Ang", 2, [0, inf], "volume",
100     "head thickness"],
101    ["Nlayers", "", 30, [0, inf], "",
102     "Number of layers"],
103    ["spacing", "Ang", 40., [0.0, inf], "volume",
104     "d-spacing of Caille S(Q)"],
105    ["Caille_parameter", "", 0.001, [0.0, 0.8], "",
106     "Caille parameter"],
107    ["sld", "1e-6/Ang^2", 0.4, [-inf, inf], "",
108     "Tail scattering length density"],
109    ["head_sld", "1e-6/Ang^2", 2.0, [-inf, inf], "",
110     "Head scattering length density"],
111    ["solvent_sld", "1e-6/Ang^2", 6, [-inf, inf], "",
112     "Solvent scattering length density"],
[dc02af0]113    ]
114
[d4666ca]115source = ["lamellarCailleHG_kernel.c"]
[dc02af0]116
117# No volume normalization despite having a volume parameter
118# This should perhaps be volume normalized?
119form_volume = """
120    return 1.0;
121    """
122
123Iqxy = """
[bfb195e]124    return Iq(sqrt(qx*qx+qy*qy), IQ_PARAMETERS);
[dc02af0]125    """
126
127# ER defaults to 0.0
128# VR defaults to 1.0
129
130demo = dict(
[d4666ca]131    scale=1, background=0,
132    Nlayers=20, spacing=200., Caille_parameter=0.05,
133    tail_length=15, head_length=10,
134    #sld=-1, head_sld=4.0, solvent_sld=6.0,
135    sld=-1, head_sld=4.1, solvent_sld=6.0,
136    tail_length_pd=0.1, tail_length_pd_n=20,
137    head_length_pd=0.05, head_length_pd_n=30,
138    spacing_pd=0.2, spacing_pd_n=40,
139    )
[dc02af0]140
141oldname = 'LamellarPSHGModel'
[7f47777]142
[d4666ca]143oldpars = dict(
144    tail_length='deltaT', head_length='deltaH', Nlayers='n_plates',
145    Caille_parameter='caille', sld='sld_tail', head_sld='sld_head',
146    solvent_sld='sld_solvent')
[7f47777]147#
[01460a5]148tests = [[{'scale': 1.0, 'background': 0.0, 'tail_length': 10.0, 'head_length': 2.0,
149           'Nlayers': 30.0, 'spacing': 40., 'Caille_parameter': 0.001, 'sld': 0.4,
150           'head_sld': 2.0, 'solvent_sld': 6.0, 'tail_length_pd': 0.0,
[652a78a]151           'head_length_pd': 0.0, 'spacing_pd': 0.0}, [0.001], [6838238.571488]]]
Note: See TracBrowser for help on using the repository browser.