source: sasmodels/sasmodels/models/multilayer_vesicle.py @ e77872e

core_shell_microgelscostrafo411magnetic_modelticket-1257-vesicle-productticket_1156ticket_1265_superballticket_822_more_unit_tests
Last change on this file since e77872e was e77872e, checked in by richardh, 8 years ago

revised docs for multilayer_vesicle, fixed typo in docs for vesicle

  • Property mode set to 100644
File size: 3.8 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 2D scattering intensity is the same as 1D, regardless of the orientation
19of the q vector which is defined as:
20
21.. math::
22
23    q = \sqrt{q_x^2 + q_y^2}
24
25.. note:
26    The outer most radius
27    $radius + n_pairs * thick_shell + (n_pairs - 1) * thick_solvent$
28    is used for both the volume fraction normalization and for the
29    effective radius for *S(Q)* when $P(Q) * S(Q)$ is applied.
30
31For information about polarised and magnetic scattering, see
32the :ref:`magnetism` documentation.
33
34This code is based on the form factor calculations implemented in the NIST
35Center for Neutron Research provided c-library (Kline, 2006).
36
37References
38----------
39
40B Cabane, *Small Angle Scattering Methods*,
41in *Surfactant Solutions: New Methods of Investigation*,
42Ch.2, Surfactant Science Series Vol. 22, Ed. R Zana and M Dekker,
43New York, (1987).
44
45**Author:** NIST IGOR/DANSE **on:** pre 2010
46
47**Last Modified by:** Piotr Rozyczko**on:** Feb 24, 2016
48
49**Last Reviewed by:** Paul Butler **on:** March 20, 2016
50
51"""
52
53from numpy import inf
54
55name = "multilayer_vesicle"
56title = "P(Q) for a Multi-lamellar vesicle"
57description = """
58    multilayer_vesicle model parameters;
59    scale : scale factor for abs intensity if needed else 1.0
60    volfraction: volume fraction
61    radius : Core radius of the multishell
62    thick_shell: shell thickness
63    thick_solvent: water thickness
64    sld_solvent: solvent scattering length density
65    sld: shell scattering length density
66    n_pairs:number of "shell plus solvent" layer pairs
67    background: incoherent background
68        """
69category = "shape:sphere"
70
71# pylint: disable=bad-whitespace, line-too-long
72#   ["name", "units", default, [lower, upper], "type","description"],
73parameters = [
74    ["volfraction", "",  0.05, [0.0, 1],  "", "volume fraction of vesicles"],
75    ["radius", "Ang", 60.0, [0.0, inf],  "", "radius of solvent filled core"],
76    ["thick_shell", "Ang",        10.0, [0.0, inf],  "", "thickness of one shell"],
77    ["thick_solvent", "Ang",        10.0, [0.0, inf],  "", "solvent thickness between shells"],
78    ["sld_solvent",    "1e-6/Ang^2",  6.4, [-inf, inf], "sld", "solvent scattering length density"],
79    ["sld",   "1e-6/Ang^2",  0.4, [-inf, inf], "sld", "Shell scattering length density"],
80    ["n_pairs",     "",            2.0, [1.0, inf],  "", "Number of shell plus solvent layer pairs"],
81    ]
82# pylint: enable=bad-whitespace, line-too-long
83
84source = ["lib/sph_j1c.c", "multilayer_vesicle.c"]
85
86polydispersity = ["radius", "n_pairs"]
87
88demo = dict(scale=1, background=0,
89            volfraction=0.05,
90            radius=60.0,
91            thick_shell=10.0,
92            thick_solvent=10.0,
93            sld_solvent=6.4,
94            sld=0.4,
95            n_pairs=2.0)
96
97tests = [
98    # Accuracy tests based on content in test/utest_other_models.py
99    [{'radius': 60.0,
100      'thick_shell': 10.0,
101      'thick_solvent': 10.0,
102      'sld_solvent': 6.4,
103      'sld': 0.4,
104      'n_pairs': 2.0,
105      'scale': 1.0,
106      'background': 0.001,
107     }, 0.001, 122.1405],
108
109    [{'volfraction': 1.0,
110      'radius': 60.0,
111      'thick_shell': 10.0,
112      'thick_solvent': 10.0,
113      'sld_solvent': 6.4,
114      'sld': 0.4,
115      'n_pairs': 2.0,
116      'scale': 1.0,
117      'background': 0.001,
118     }, (0.001, 0.30903), 1.61873],
119    ]
Note: See TracBrowser for help on using the repository browser.