source: sasmodels/sasmodels/models/multilayer_vesicle.py @ 42356c8

core_shell_microgelscostrafo411magnetic_modelrelease_v0.94release_v0.95ticket-1257-vesicle-productticket_1156ticket_1265_superballticket_822_more_unit_tests
Last change on this file since 42356c8 was 42356c8, checked in by Paul Kienzle <pkienzle@…>, 8 years ago

label all sld parameters

  • Property mode set to 100644
File size: 3.7 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
31For information about polarised and magnetic scattering, see
32the :doc:`magnetic help <../sasgui/perspectives/fitting/mag_help>` 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 pairs of water/shell
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],  "", "Core radius of the multishell"],
76    ["thick_shell", "Ang",        10.0, [0.0, inf],  "sld", "Shell thickness"],
77    ["thick_solvent", "Ang",        10.0, [0.0, inf],  "", "Water thickness"],
78    ["sld_solvent",    "1e-6/Ang^2",  6.4, [-inf, inf], "sld", "Core 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 pairs of water and shell"],
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.