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

core_shell_microgelscostrafo411magnetic_modelrelease_v0.94release_v0.95ticket-1257-vesicle-productticket_1156ticket_1265_superballticket_822_more_unit_tests
Last change on this file since c6ca41e was c6ca41e, checked in by butler, 8 years ago

fix name of old multishell model to multilayer vesicle as agreed. Also
fixed parameters to match new agreements. reran tests

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