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

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

Changed documentation link to missing file polar_mag_help.html in
sphere.py, _spherepy.py, fuzzy_sphere.py, and multilayer_vesicle.py to
point to \sasview\src\sas\sasgui\perspectives\fitting\media\mag_help.rst
as in core_multi_shell.py and which does exist. This means the
integrated docs will build and link properly, but further breaks the
sasmodels docs (see #554).

  • Property mode set to 100644
File size: 3.9 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],  "", "Shell thickness"],
77    ["thick_solvent", "Ang",        10.0, [0.0, inf],  "", "Water thickness"],
78    ["sld_solvent",    "1e-6/Ang^2",  6.4, [-inf, inf], "", "Core scattering length density"],
79    ["sld",   "1e-6/Ang^2",  0.4, [-inf, inf], "", "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
97oldname = 'MultiShellModel'
98oldpars = dict(radius='core_radius',
99               thick_shell='s_thickness', thick_solvent='w_thickness',
100               sld_solvent='core_sld', sld='shell_sld')
101
102tests = [
103    # Accuracy tests based on content in test/utest_other_models.py
104    [{'radius': 60.0,
105      'thick_shell': 10.0,
106      'thick_solvent': 10.0,
107      'sld_solvent': 6.4,
108      'sld': 0.4,
109      'n_pairs': 2.0,
110      'scale': 1.0,
111      'background': 0.001,
112     }, 0.001, 122.1405],
113
114    [{'volfraction': 1.0,
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      'scale': 1.0,
122      'background': 0.001,
123     }, (0.001, 0.30903), 1.61873],
124    ]
Note: See TracBrowser for help on using the repository browser.