source: sasmodels/sasmodels/models/multilayer_vesicle.py @ 6cefbc9

core_shell_microgelscostrafo411magnetic_modelrelease_v0.94release_v0.95ticket-1257-vesicle-productticket_1156ticket_1265_superballticket_822_more_unit_tests
Last change on this file since 6cefbc9 was 9a4811a, checked in by wojciech, 8 years ago

Magnetic documentation is properly referrenced now

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