source: sasmodels/sasmodels/models/lamellar_stack_paracrystal.py @ a34b811

ticket-1257-vesicle-productticket_1156ticket_822_more_unit_tests
Last change on this file since a34b811 was 0507e09, checked in by smk78, 5 years ago

Added link to source code to each model. Closes #883

  • Property mode set to 100644
File size: 5.3 KB
Line 
1# Note: model title and parameter table are inserted automatically
2r"""
3This model calculates the scattering from a stack of repeating lamellar
4structures. The stacks of lamellae (infinite in lateral dimension) are
5treated as a paracrystal to account for the repeating spacing. The repeat
6distance is further characterized by a Gaussian polydispersity. **This model
7can be used for large multilamellar vesicles.**
8
9Definition
10----------
11
12In the equations below,
13
14- *scale* is used instead of the mass per area of the bilayer $\Gamma_m$
15  (this corresponds to the volume fraction of the material in the bilayer,
16  *not* the total excluded volume of the paracrystal),
17
18- *sld* $-$ *sld_solvent* is the contrast $\Delta \rho$,
19
20- *thickness* is the layer thickness $t$,
21
22- *Nlayers* is the number of layers $N$,
23
24- *d_spacing* is the average distance between adjacent layers
25  $\langle D \rangle$, and
26
27- *sigma_d* is the relative standard deviation of the Gaussian
28  layer distance distribution $\sigma_D / \langle D \rangle$.
29
30
31The scattering intensity $I(q)$ is calculated as
32
33.. math::
34
35    I(q) = 2\pi\Delta\rho^2\Gamma_m\frac{P_\text{bil}(q)}{q^2} Z_N(q)
36
37The form factor of the bilayer is approximated as the cross section of an
38infinite, planar bilayer of thickness $t$ (compare the equations for the
39lamellar model).
40
41.. math::
42
43    P_\text{bil}(q) = \left(\frac{\sin(qt/2)}{qt/2}\right)^2
44
45$Z_N(q)$ describes the interference effects for aggregates
46consisting of more than one bilayer. The equations used are (3-5)
47from the Bergstrom reference:
48
49.. math::
50
51
52    Z_N(q) = \frac{1 - w^2}{1 + w^2 - 2w \cos(q \langle D \rangle)}
53        + x_N S_N + (1 - x_N) S_{N+1}
54
55where
56
57.. math::
58
59    S_N(q) = \frac{a_N}{N}[1 + w^2 - 2 w \cos(q \langle D \rangle)]^2
60
61and
62
63.. math::
64
65    a_N &= 4w^2 - 2(w^3 + w) \cos(q \langle D \rangle) \\
66        &\quad - 4w^{N+2}\cos(Nq \langle D \rangle)
67        + 2 w^{N+3}\cos[(N-1)q \langle D \rangle]
68        + 2w^{N+1}\cos[(N+1)q \langle D \rangle]
69
70for the layer spacing distribution $w = \exp(-\sigma_D^2 q^2/2)$.
71
72Non-integer numbers of stacks are calculated as a linear combination of
73the lower and higher values
74
75.. math::
76
77    N_L = x_N N + (1 - x_N)(N+1)
78
79The 2D scattering intensity is the same as 1D, regardless of the orientation
80of the $q$ vector which is defined as
81
82.. math::
83
84    q = \sqrt{q_x^2 + q_y^2}
85
86
87Reference
88---------
89
90.. [#] M Bergstrom, J S Pedersen, P Schurtenberger, S U Egelhaaf, *J. Phys. Chem. B*, 103 (1999) 9888-9897
91
92Source
93------
94
95`lamellar_stack_paracrystal.py <https://github.com/SasView/sasmodels/blob/master/sasmodels/models/lamellar_stack_paracrystal.py>`_
96
97`lamellar_stack_paracrystal.c <https://github.com/SasView/sasmodels/blob/master/sasmodels/models/lamellar_stack_paracrystal.c>`_
98
99Authorship and Verification
100----------------------------
101
102* **Author:**
103* **Last Modified by:**
104* **Last Reviewed by:**
105* **Source added by :** Steve King **Date:** March 25, 2019
106"""
107import numpy as np
108from numpy import inf
109
110name = "lamellar_stack_paracrystal"
111title = "Random lamellar sheet with paracrystal structure factor"
112description = """\
113    [Random lamellar phase with paracrystal structure factor]
114        randomly oriented stacks of infinite sheets
115        with paracrytal S(Q), having polydisperse spacing.
116        sld = sheet scattering length density
117        sld_solvent = solvent scattering length density
118        background = incoherent background
119        scale = scale factor
120"""
121category = "shape:lamellae"
122
123single = False
124
125#             ["name", "units", default, [lower, upper], "type","description"],
126parameters = [["thickness", "Ang", 33.0, [0, inf], "volume",
127               "sheet thickness"],
128              ["Nlayers", "", 20, [1, inf], "",
129               "Number of layers"],
130              ["d_spacing", "Ang", 250., [0.0, inf], "",
131               "lamellar spacing of paracrystal stack"],
132              ["sigma_d", "Ang", 0.0, [0.0, inf], "",
133               "Sigma (polydispersity) of the lamellar spacing"],
134              ["sld", "1e-6/Ang^2", 1.0, [-inf, inf], "sld",
135               "layer scattering length density"],
136              ["sld_solvent", "1e-6/Ang^2", 6.34, [-inf, inf], "sld",
137               "Solvent scattering length density"],
138             ]
139
140
141source = ["lamellar_stack_paracrystal.c"]
142
143form_volume = """
144    return 1.0;
145"""
146
147def random():
148    """Return a random parameter set for the model."""
149    total_thickness = 10**np.random.uniform(2, 4.7)
150    Nlayers = np.random.randint(2, 200)
151    d_spacing = total_thickness / Nlayers
152    thickness = d_spacing * np.random.uniform(0, 1)
153    # Let polydispersity peak around 15%; 95% < 0.4; max=100%
154    sigma_d = np.random.beta(1.5, 7)
155    pars = dict(
156        thickness=thickness,
157        Nlayers=Nlayers,
158        d_spacing=d_spacing,
159        sigma_d=sigma_d,
160    )
161    return pars
162
163demo = dict(scale=1, background=0,
164            thickness=33, Nlayers=20, d_spacing=250, sigma_d=0.2,
165            sld=1.0, sld_solvent=6.34,
166            thickness_pd=0.2, thickness_pd_n=40)
167
168#
169tests = [
170    [{'scale': 1.0, 'background': 0.0, 'thickness': 33., 'Nlayers': 20.0,
171      'd_spacing': 250., 'sigma_d': 0.2, 'sld': 1.0,
172      'sld_solvent': 6.34, 'thickness_pd': 0.0, 'thickness_pd_n': 40},
173     [0.001, 0.215268], [21829.3, 0.00487686]],
174]
175# ADDED by: RKH  ON: 18Mar2016  converted from sasview previously,
176# now renaming everything & sorting the docs
Note: See TracBrowser for help on using the repository browser.