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

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

Converted MultiShellModel?

  • Property mode set to 100644
File size: 3.1 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
6Definition
7----------
8
9.. figure:: img/multi_shell_fig1.jpg
10
11The 2D scattering intensity is the same as 1D, regardless of the orientation
12of the q vector which is defined as:
13
14.. math::
15
16    q = \sqrt{q_x^2 + q_y^2}
17
18.. note:
19    The outer most radius
20    $core_radius + n_pairs * s_thickness + (n_pairs - 1) * w_thickness$
21    is used as the effective radius for *S(Q)* when $P(Q) * S(Q)$ is applied.
22
23
24.. figure:: img/multi_shell_1d.jpg
25
26    1D plot using the default values (with 200 data point).
27
28Our model uses the form factor calculations implemented in a c-library provided
29by the NIST Center for Neutron Research (Kline, 2006).
30
31Reference
32---------
33B Cabane, *Small Angle Scattering Methods*,
34in *Surfactant Solutions: New Methods of Investigation*,
35Ch.2, Surfactant Science Series Vol. 22, Ed. R Zana and M Dekker,
36New York, (1987).
37
38"""
39
40from numpy import inf
41
42name = "multi_shell"
43title = "Multi shell model"
44description = """
45    MultiShell (Sphere) Model (or Multilamellar Vesicles): Model parameters;
46    scale : scale factor
47    core_radius : Core radius of the multishell
48    s_thickness: shell thickness
49    w_thickness: water thickness
50    core_sld: core scattering length density
51    shell_sld: shell scattering length density
52    n_pairs:number of pairs of water/shell
53    background: incoherent background
54        """
55category = "shape:sphere"
56
57# pylint: disable=bad-whitespace, line-too-long
58#   ["name", "units", default, [lower, upper], "type","description"],
59parameters = [
60    ["core_radius", "Ang",        60.0, [0.0, inf],  "", "Core radius of the multishell"],
61    ["s_thickness", "Ang",        10.0, [0.0, inf],  "", "Shell thickness"],
62    ["w_thickness", "Ang",        10.0, [0.0, inf],  "", "Water thickness"],
63    ["core_sld",    "1e-6/Ang^2",  6.4, [-inf, inf], "", "Core scattering length density"],
64    ["shell_sld",   "1e-6/Ang^2",  0.4, [-inf, inf], "", "Shell scattering length density"],
65    ["n_pairs",     "",            2.0, [1.0, inf],  "", "Number of pairs of water and shell"],
66    ]
67# pylint: enable=bad-whitespace, line-too-long
68
69source = ["multi_shell.c"]
70
71demo = dict(scale=1, background=0,
72            core_radius=60.0,
73            s_thickness=10.0,
74            w_thickness=10.0,
75            core_sld=6.4,
76            shell_sld=0.4,
77            n_pairs=2.0)
78
79oldname = 'MultiShellModel'
80oldpars = dict()
81
82tests = [
83    # Accuracy tests based on content in test/utest_other_models.py
84    [{'core_radius': 60.0,
85      's_thickness': 10.0,
86      'w_thickness': 10.0,
87      'core_sld': 6.4,
88      'shell_sld': 0.4,
89      'n_pairs': 2.0,
90      'scale': 1.0,
91      'background': 0.001,
92     }, 0.001, 2442.81],
93
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, 0.30903), 1.61873],
103    ]
Note: See TracBrowser for help on using the repository browser.