source: sasmodels/sasmodels/models/multi_shell.py @ d51ea74

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

Code review from TN

  • Property mode set to 100644
File size: 3.5 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_fig1.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
36.. figure:: img/multi_shell_1d.jpg
37
38    1D plot using the default values (with 200 data point).
39
40Our model uses the form factor calculations implemented in a c-library provided
41by the NIST Center for Neutron Research (Kline, 2006).
42
43Reference
44---------
45B Cabane, *Small Angle Scattering Methods*,
46in *Surfactant Solutions: New Methods of Investigation*,
47Ch.2, Surfactant Science Series Vol. 22, Ed. R Zana and M Dekker,
48New York, (1987).
49
50"""
51
52from numpy import inf
53
54name = "multi_shell"
55title = "Multi shell model"
56description = """
57    MultiShell (Sphere) Model (or Multilamellar Vesicles): Model parameters;
58    scale : scale factor
59    core_radius : Core radius of the multishell
60    s_thickness: shell thickness
61    w_thickness: water thickness
62    core_sld: core scattering length density
63    shell_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    ["core_radius", "Ang",        60.0, [0.0, inf],  "", "Core radius of the multishell"],
73    ["s_thickness", "Ang",        10.0, [0.0, inf],  "", "Shell thickness"],
74    ["w_thickness", "Ang",        10.0, [0.0, inf],  "", "Water thickness"],
75    ["core_sld",    "1e-6/Ang^2",  6.4, [-inf, inf], "", "Core scattering length density"],
76    ["shell_sld",   "1e-6/Ang^2",  0.4, [-inf, inf], "", "Shell scattering length density"],
77    ["n_pairs",     "",            2.0, [1.0, inf],  "", "Number of pairs of water and shell"],
78    ]
79# pylint: enable=bad-whitespace, line-too-long
80
81source = ["lib/sph_j1c.c", "multi_shell.c"]
82
83polydispersity = ["core_radius", "n_pairs"]
84
85demo = dict(scale=1, background=0,
86            core_radius=60.0,
87            s_thickness=10.0,
88            w_thickness=10.0,
89            core_sld=6.4,
90            shell_sld=0.4,
91            n_pairs=2.0)
92
93oldname = 'MultiShellModel'
94oldpars = dict()
95
96tests = [
97    # Accuracy tests based on content in test/utest_other_models.py
98    [{'core_radius': 60.0,
99      's_thickness': 10.0,
100      'w_thickness': 10.0,
101      'core_sld': 6.4,
102      'shell_sld': 0.4,
103      'n_pairs': 2.0,
104      'scale': 1.0,
105      'background': 0.001,
106     }, 0.001, 2442.81],
107
108    [{'core_radius': 60.0,
109      's_thickness': 10.0,
110      'w_thickness': 10.0,
111      'core_sld': 6.4,
112      'shell_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.