source: sasmodels/sasmodels/models/core_shell_bicelle.py @ a0fee3b

core_shell_microgelscostrafo411magnetic_modelticket-1257-vesicle-productticket_1156ticket_1265_superballticket_822_more_unit_tests
Last change on this file since a0fee3b was a0fee3b, checked in by richardh, 8 years ago

improved doc and new figures for core_shell_bicelle

  • Property mode set to 100644
File size: 5.6 KB
Line 
1r"""
2Definition
3----------
4This model provides the form factor for a circular cylinder with a
5core-shell scattering length density profile. Thus this is a variation
6of a core-shell cylinder or disc where the shell on the walls and ends
7may be of different thicknesses and scattering length densities. The form
8factor is normalized by the particle volume.
9
10.. _core-shell-bicelle-geometry:
11
12.. figure:: img/core_shell_bicelle_geometry.png
13
14    Schematic cross-section of bicelle. Note however that the model here
15    calculates for rectangular, not curved, rims as shown below.
16
17.. figure:: img/core_shell_bicelle_parameters.png
18
19   Cross section of cylindrical symmetry model used here. Users will have
20   to decide how to distribute "heads" and "tails" between the rim, face
21   and core regions in order to estimate appropriate starting parameters.
22
23The output of the 1D scattering intensity function for randomly oriented
24cylinders is then given by the equation above.
25
26The *theta* and *phi* parameters are not used for the 1D output.
27Our implementation of the scattering kernel and the 1D scattering intensity
28use the c-library from NIST.
29
30.. figure:: img/cylinder_angle_definition.jpg
31
32    Definition of the angles for the oriented core shell bicelle tmodel.
33
34.. figure:: img/cylinder_angle_projection.jpg
35    :width: 600px
36
37    Examples of the angles for oriented pp against the detector plane.
38
39References
40----------
41
42.. [#Matusmori] `N Matsumori and M Murata <http://dx.doi.org/10.1039/C0NP0000
43   2G>`_, *Nat. Prod. Rep.* 27 (2010) 1480-1492
44.. [#] L A Feigin and D I Svergun, *Structure Analysis by Small-Angle X-Ray and
45   Neutron Scattering,* Plenum Press, New York, (1987)
46
47Authorship and Verification
48----------------------------
49
50* **Author:** NIST IGOR/DANSE **Date:** pre 2010
51* **Last Modified by:** Paul Butler **Date:** Septmber 30, 2016
52* **Last Reviewed by:** Under Review **Date:** October 5, 2016
53
54"""
55
56from numpy import inf, sin, cos
57
58name = "core_shell_bicelle"
59title = "Circular cylinder with a core-shell scattering length density profile.."
60description = """
61    P(q,alpha)= (scale/Vs)*f(q)^(2) + bkg,  where:
62    f(q)= Vt(sld_rim - sld_solvent)* sin[qLt.cos(alpha)/2]
63    /[qLt.cos(alpha)/2]*J1(qRout.sin(alpha))
64    /[qRout.sin(alpha)]+
65    (sld_core-sld_face)*Vc*sin[qLcos(alpha)/2][[qL
66    *cos(alpha)/2]*J1(qRc.sin(alpha))
67    /qRc.sin(alpha)]+
68    (sld_face-sld_rim)*(Vc+Vf)*sin[q(L+2.thick_face).
69    cos(alpha)/2][[q(L+2.thick_face)*cos(alpha)/2]*
70    J1(qRc.sin(alpha))/qRc.sin(alpha)]
71
72    alpha:is the angle between the axis of
73    the cylinder and the q-vector
74    Vt = pi.(Rc + thick_rim)^2.Lt : total volume
75    Vc = pi.Rc^2.L :the volume of the core
76    Vf = 2.pi.Rc^2.thick_face
77    Rc = radius: is the core radius
78    L: the length of the core
79    Lt = L + 2.thick_face: total length
80    Rout = radius + thick_rim
81    sld_core, sld_rim, sld_face:scattering length
82    densities within the particle
83    sld_solvent: the scattering length density
84    of the solvent
85    bkg: the background
86    J1: the first order Bessel function
87    theta: axis_theta of the cylinder
88    phi: the axis_phi of the cylinder...
89        """
90category = "shape:cylinder"
91
92# pylint: disable=bad-whitespace, line-too-long
93#             ["name", "units", default, [lower, upper], "type", "description"],
94parameters = [
95    ["radius",         "Ang",       20, [0, inf],    "volume",      "Cylinder core radius"],
96    ["thick_rim",  "Ang",       10, [0, inf],    "volume",      "Rim shell thickness"],
97    ["thick_face", "Ang",       10, [0, inf],    "volume",      "Cylinder face thickness"],
98    ["length",         "Ang",      400, [0, inf],    "volume",      "Cylinder length"],
99    ["sld_core",       "1e-6/Ang^2", 1, [-inf, inf], "sld",         "Cylinder core scattering length density"],
100    ["sld_face",       "1e-6/Ang^2", 4, [-inf, inf], "sld",         "Cylinder face scattering length density"],
101    ["sld_rim",        "1e-6/Ang^2", 4, [-inf, inf], "sld",         "Cylinder rim scattering length density"],
102    ["sld_solvent",    "1e-6/Ang^2", 1, [-inf, inf], "sld",         "Solvent scattering length density"],
103    ["theta",          "degrees",   90, [-inf, inf], "orientation", "In plane angle"],
104    ["phi",            "degrees",    0, [-inf, inf], "orientation", "Out of plane angle"],
105    ]
106
107# pylint: enable=bad-whitespace, line-too-long
108
109source = ["lib/Si.c", "lib/polevl.c", "lib/sas_J1.c", "lib/gauss76.c",
110          "core_shell_bicelle.c"]
111
112demo = dict(scale=1, background=0,
113            radius=20.0,
114            thick_rim=10.0,
115            thick_face=10.0,
116            length=400.0,
117            sld_core=1.0,
118            sld_face=4.0,
119            sld_rim=4.0,
120            sld_solvent=1.0,
121            theta=90,
122            phi=0)
123
124qx, qy = 0.4 * cos(90), 0.5 * sin(0)
125tests = [
126    # Accuracy tests based on content in test/utest_other_models.py
127    [{'radius': 20.0,
128      'thick_rim': 10.0,
129      'thick_face': 10.0,
130      'length': 400.0,
131      'sld_core': 1.0,
132      'sld_face': 4.0,
133      'sld_rim': 4.0,
134      'sld_solvent': 1.0,
135      'background': 0.0,
136     }, 0.001, 353.550],
137
138    [{'radius': 20.0,
139      'thick_rim': 10.0,
140      'thick_face': 10.0,
141      'length': 400.0,
142      'sld_core': 1.0,
143      'sld_face': 4.0,
144      'sld_rim': 4.0,
145      'sld_solvent': 1.0,
146      'theta': 90.0,
147      'phi': 0.0,
148      'background': 0.00,
149     }, (qx, qy), 24.9167],
150
151    # Additional tests with larger range of parameters
152    [{'radius': 3.0,
153      'thick_rim': 100.0,
154      'thick_face': 100.0,
155      'length': 1200.0,
156      'sld_core': 5.0,
157      'sld_face': 41.0,
158      'sld_rim': 42.0,
159      'sld_solvent': 21.0,
160     }, 0.05, 1670.1828],
161    ]
Note: See TracBrowser for help on using the repository browser.