source: sasmodels/sasmodels/models/multi_shell.py @ 2f0c07d

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

make figure names regular (geometry, angle_definition, angle_projection)

  • Property mode set to 100644
File size: 3.4 KB
Line 
1r"""
2This model provides the form factor, *P(q)*, for a multi-lamellar vesicle
3with *N* shells where the core is filled with solvent and the shells are
4interleaved with layers of solvent. For *N = 1*, this returns the VesicleModel.
5
6For information about polarised and magnetic scattering, click here_.
7
8.. _here: polar_mag_help.html
9
10Definition
11----------
12
13This model is a trivial extension of the CoreShell function to a larger number
14of shells. See the core_shell_ function for a diagram and documentation.
15
16.. _core_shell: core_shell_sphere.html
17
18Be careful! The SLDs and scale can be highly correlated. Hold as many of these
19parameters fixed as possible.
20
21.. figure:: img/multi_shell_geometry.jpg
22
23The 2D scattering intensity is the same as 1D, regardless of the orientation
24of the q vector which is defined as:
25
26.. math::
27
28    q = \sqrt{q_x^2 + q_y^2}
29
30.. note:
31    The outer most radius
32    $core_radius + n_pairs * s_thickness + (n_pairs - 1) * w_thickness$
33    is used as the effective radius for *S(Q)* when $P(Q) * S(Q)$ is applied.
34
35
36Our model uses the form factor calculations implemented in a c-library provided
37by the NIST Center for Neutron Research (Kline, 2006).
38
39Reference
40---------
41B Cabane, *Small Angle Scattering Methods*,
42in *Surfactant Solutions: New Methods of Investigation*,
43Ch.2, Surfactant Science Series Vol. 22, Ed. R Zana and M Dekker,
44New York, (1987).
45
46"""
47
48from numpy import inf
49
50name = "multi_shell"
51title = "Multi shell model"
52description = """
53    MultiShell (Sphere) Model (or Multilamellar Vesicles): Model parameters;
54    scale : scale factor
55    core_radius : Core radius of the multishell
56    s_thickness: shell thickness
57    w_thickness: water thickness
58    core_sld: core scattering length density
59    shell_sld: shell scattering length density
60    n_pairs:number of pairs of water/shell
61    background: incoherent background
62        """
63category = "shape:sphere"
64
65# pylint: disable=bad-whitespace, line-too-long
66#   ["name", "units", default, [lower, upper], "type","description"],
67parameters = [
68    ["core_radius", "Ang",        60.0, [0.0, inf],  "", "Core radius of the multishell"],
69    ["s_thickness", "Ang",        10.0, [0.0, inf],  "", "Shell thickness"],
70    ["w_thickness", "Ang",        10.0, [0.0, inf],  "", "Water thickness"],
71    ["core_sld",    "1e-6/Ang^2",  6.4, [-inf, inf], "", "Core scattering length density"],
72    ["shell_sld",   "1e-6/Ang^2",  0.4, [-inf, inf], "", "Shell scattering length density"],
73    ["n_pairs",     "",            2.0, [1.0, inf],  "", "Number of pairs of water and shell"],
74    ]
75# pylint: enable=bad-whitespace, line-too-long
76
77source = ["lib/sph_j1c.c", "multi_shell.c"]
78
79polydispersity = ["core_radius", "n_pairs"]
80
81demo = dict(scale=1, background=0,
82            core_radius=60.0,
83            s_thickness=10.0,
84            w_thickness=10.0,
85            core_sld=6.4,
86            shell_sld=0.4,
87            n_pairs=2.0)
88
89oldname = 'MultiShellModel'
90oldpars = dict()
91
92tests = [
93    # Accuracy tests based on content in test/utest_other_models.py
94    [{'core_radius': 60.0,
95      's_thickness': 10.0,
96      'w_thickness': 10.0,
97      'core_sld': 6.4,
98      'shell_sld': 0.4,
99      'n_pairs': 2.0,
100      'scale': 1.0,
101      'background': 0.001,
102     }, 0.001, 2442.81],
103
104    [{'core_radius': 60.0,
105      's_thickness': 10.0,
106      'w_thickness': 10.0,
107      'core_sld': 6.4,
108      'shell_sld': 0.4,
109      'n_pairs': 2.0,
110      'scale': 1.0,
111      'background': 0.001,
112     }, (0.001, 0.30903), 1.61873],
113    ]
Note: See TracBrowser for help on using the repository browser.