source: sasmodels/sasmodels/models/multilayer_vesicle.py @ 925ad6e

core_shell_microgelscostrafo411magnetic_modelticket-1257-vesicle-productticket_1156ticket_1265_superballticket_822_more_unit_tests
Last change on this file since 925ad6e was 925ad6e, checked in by wojciech, 7 years ago

sph_j1c translated to sas_3j1x_x

  • Property mode set to 100644
File size: 4.5 KB
Line 
1r"""
2Definition
3----------
4
5This model is a trivial extension of the core_shell_sphere function to include
6*N* shells where the core is filled with solvent and the shells are interleaved
7with layers of solvent. For *N = 1*, this returns the same as the vesicle model,
8except for the normalisation, which here is to outermost volume.
9The shell thicknessess and SLD are constant for all shells as expected for
10a multilayer vesicle.
11
12.. figure:: img/multi_shell_geometry.jpg
13
14    Geometry of the multilayer_vesicle model.
15
16See the :ref:`core-shell-sphere` model for more documentation.
17
18The 1D scattering intensity is calculated in the following way (Guinier, 1955)
19
20.. math::
21
22    P(q) = \frac{\text{scale.volfraction}}{V_t} F^2(q) + \text{background}
23
24where
25
26.. math::
27
28     F(q) = (\rho_{shell}-\rho_{solv}) \sum_{i=1}^{n\_pairs} \left[
29     3V(R_i)\frac{\sin(qR_i)-qR_i\cos(qR_i)}{(qR_i)^3} \\
30      - 3V(R_i+t_s)\frac{\sin(q(R_i+t_s))-q(R_i+t_s)\cos(q(R_i+t_s))}{(q(R_i+t_s))^3}
31     \right]
32
33
34where $R_i = r_c + (i-1)(t_s + t_w)$
35   
36where $V_t$ is the volume of the whole particle, $V(R)$ is the volume of a sphere
37of radius $R$, $r_c$ is the radius of the core, $\rho_{shell}$ is the scattering length
38density of a shell, $\rho_{solv}$ is the scattering length density of the solvent.
39
40
41The 2D scattering intensity is the same as 1D, regardless of the orientation
42of the q vector which is defined as:
43
44.. math::
45
46    q = \sqrt{q_x^2 + q_y^2}
47
48
49The outer most radius
50
51$radius + n\_pairs * thick\_shell + (n\_pairs- 1) * thick\_solvent$
52
53is used for both the volume fraction normalization and for the
54effective radius for *S(Q)* when $P(Q) * S(Q)$ is applied.
55
56For information about polarised and magnetic scattering, see
57the :ref:`magnetism` documentation.
58
59This code is based on the form factor calculations implemented in the NIST
60Center for Neutron Research provided c-library (Kline, 2006).
61
62References
63----------
64
65B Cabane, *Small Angle Scattering Methods*,
66in *Surfactant Solutions: New Methods of Investigation*,
67Ch.2, Surfactant Science Series Vol. 22, Ed. R Zana and M Dekker,
68New York, (1987).
69
70**Author:** NIST IGOR/DANSE **on:** pre 2010
71
72**Last Modified by:** Piotr Rozyczko**on:** Feb 24, 2016
73
74**Last Reviewed by:** Paul Butler **on:** March 20, 2016
75
76"""
77
78from numpy import inf
79
80name = "multilayer_vesicle"
81title = "P(Q) for a Multi-lamellar vesicle"
82description = """
83    multilayer_vesicle model parameters;
84    scale : scale factor for abs intensity if needed else 1.0
85    volfraction: volume fraction
86    radius : Core radius of the multishell
87    thick_shell: shell thickness
88    thick_solvent: water thickness
89    sld_solvent: solvent scattering length density
90    sld: shell scattering length density
91    n_pairs:number of "shell plus solvent" layer pairs
92    background: incoherent background
93        """
94category = "shape:sphere"
95
96# pylint: disable=bad-whitespace, line-too-long
97#   ["name", "units", default, [lower, upper], "type","description"],
98parameters = [
99    ["volfraction", "",  0.05, [0.0, 1],  "", "volume fraction of vesicles"],
100    ["radius", "Ang", 60.0, [0.0, inf],  "", "radius of solvent filled core"],
101    ["thick_shell", "Ang",        10.0, [0.0, inf],  "", "thickness of one shell"],
102    ["thick_solvent", "Ang",        10.0, [0.0, inf],  "", "solvent thickness between shells"],
103    ["sld_solvent",    "1e-6/Ang^2",  6.4, [-inf, inf], "sld", "solvent scattering length density"],
104    ["sld",   "1e-6/Ang^2",  0.4, [-inf, inf], "sld", "Shell scattering length density"],
105    ["n_pairs",     "",            2.0, [1.0, inf],  "", "Number of shell plus solvent layer pairs"],
106    ]
107# pylint: enable=bad-whitespace, line-too-long
108
109source = ["lib/sas_3j1x_x.c", "multilayer_vesicle.c"]
110
111polydispersity = ["radius", "n_pairs"]
112
113demo = dict(scale=1, background=0,
114            volfraction=0.05,
115            radius=60.0,
116            thick_shell=10.0,
117            thick_solvent=10.0,
118            sld_solvent=6.4,
119            sld=0.4,
120            n_pairs=2.0)
121
122tests = [
123    # Accuracy tests based on content in test/utest_other_models.py
124    [{'radius': 60.0,
125      'thick_shell': 10.0,
126      'thick_solvent': 10.0,
127      'sld_solvent': 6.4,
128      'sld': 0.4,
129      'n_pairs': 2.0,
130      'scale': 1.0,
131      'background': 0.001,
132     }, 0.001, 122.1405],
133
134    [{'volfraction': 1.0,
135      'radius': 60.0,
136      'thick_shell': 10.0,
137      'thick_solvent': 10.0,
138      'sld_solvent': 6.4,
139      'sld': 0.4,
140      'n_pairs': 2.0,
141      'scale': 1.0,
142      'background': 0.001,
143     }, (0.001, 0.30903), 1.61873],
144    ]
Note: See TracBrowser for help on using the repository browser.