source: sasmodels/sasmodels/models/core_shell_bicelle.py @ 40a87fa

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

lint and latex cleanup

  • Property mode set to 100644
File size: 4.7 KB
Line 
1r"""
2
3Definition
4----------
5This model provides the form factor for a circular cylinder with a
6core-shell scattering length density profile. Thus this is a variation
7of a core-shell cylinder or disc where the shell on the walls and ends
8may be of different thicknesses and scattering length densities. The form
9factor is normalized by the particle volume.
10
11.. _core-shell-bicelle-geometry:
12
13.. figure:: img/core_shell_bicelle_geometry.png
14
15    (Graphic from DOI: 10.1039/C0NP00002G, note however that the model here
16    calculates for rectangular, not curved, rims.)
17
18The output of the 1D scattering intensity function for randomly oriented
19cylinders is then given by the equation above.
20
21The *theta* and *phi* parameters are not used for the 1D output.
22Our implementation of the scattering kernel and the 1D scattering intensity
23use the c-library from NIST.
24
25.. figure:: img/cylinder_angle_definition.jpg
26
27    Definition of the angles for the oriented core shell bicelle tmodel.
28
29.. figure:: img/cylinder_angle_projection.jpg
30
31    Examples of the angles for oriented pp against the detector plane.
32
33References
34----------
35
36L A Feigin and D I Svergun,
37*Structure Analysis by Small-Angle X-Ray and Neutron Scattering,*
38Plenum Press, New York, (1987)
39
40"""
41
42from numpy import inf, sin, cos
43
44name = "core_shell_bicelle"
45title = "Circular cylinder with a core-shell scattering length density profile.."
46description = """
47    P(q,alpha)= scale/Vs*f(q)^(2) + bkg,  where: f(q)= 2(sld_core
48    - solvant_sld)* Vc*sin[qLcos(alpha/2)]
49    /[qLcos(alpha/2)]*J1(qRsin(alpha))
50    /[qRsin(alpha)]+2(shell_sld-sld_solvent)
51    *Vs*sin[q(L+T)cos(alpha/2)][[q(L+T)
52    *cos(alpha/2)]*J1(q(R+T)sin(alpha))
53    /q(R+T)sin(alpha)]
54
55    alpha:is the angle between the axis of
56    the cylinder and the q-vector
57    Vs: the volume of the outer shell
58    Vc: the volume of the core
59    L: the length of the core
60    shell_sld: the scattering length density
61    of the shell
62    sld_solvent: the scattering length density
63    of the solvent
64    bkg: the background
65    T: the thickness
66    R+T: is the outer radius
67    L+2T: The total length of the outershell
68    J1: the first order Bessel function
69    theta: axis_theta of the cylinder
70    phi: the axis_phi of the cylinder...
71        """
72category = "shape:cylinder"
73
74# pylint: disable=bad-whitespace, line-too-long
75#             ["name", "units", default, [lower, upper], "type", "description"],
76parameters = [
77    ["radius",         "Ang",       20, [0, inf],    "volume",      "Cylinder core radius"],
78    ["rim_thickness",  "Ang",       10, [0, inf],    "volume",      "Rim shell thickness"],
79    ["face_thickness", "Ang",       10, [0, inf],    "volume",      "Cylinder face thickness"],
80    ["length",         "Ang",      400, [0, inf],    "volume",      "Cylinder length"],
81    ["sld_core",       "1e-6/Ang^2", 1, [-inf, inf], "sld",         "Cylinder core scattering length density"],
82    ["sld_face",       "1e-6/Ang^2", 4, [-inf, inf], "sld",         "Cylinder face scattering length density"],
83    ["sld_rim",        "1e-6/Ang^2", 4, [-inf, inf], "sld",         "Cylinder rim scattering length density"],
84    ["sld_solvent",    "1e-6/Ang^2", 1, [-inf, inf], "sld",         "Solvent scattering length density"],
85    ["theta",          "degrees",   90, [-inf, inf], "orientation", "In plane angle"],
86    ["phi",            "degrees",    0, [-inf, inf], "orientation", "Out of plane angle"],
87    ]
88
89# pylint: enable=bad-whitespace, line-too-long
90
91source = ["lib/Si.c", "lib/polevl.c", "lib/sas_J1.c", "lib/gauss76.c",
92          "core_shell_bicelle.c"]
93
94demo = dict(scale=1, background=0,
95            radius=20.0,
96            rim_thickness=10.0,
97            face_thickness=10.0,
98            length=400.0,
99            sld_core=1.0,
100            sld_face=4.0,
101            sld_rim=4.0,
102            sld_solvent=1.0,
103            theta=90,
104            phi=0)
105
106qx, qy = 0.4 * cos(90), 0.5 * sin(0)
107tests = [
108    # Accuracy tests based on content in test/utest_other_models.py
109    [{'radius': 20.0,
110      'rim_thickness': 10.0,
111      'face_thickness': 10.0,
112      'length': 400.0,
113      'sld_core': 1.0,
114      'sld_face': 4.0,
115      'sld_rim': 4.0,
116      'sld_solvent': 1.0,
117      'background': 0.0,
118     }, 0.001, 353.550],
119
120    [{'radius': 20.0,
121      'rim_thickness': 10.0,
122      'face_thickness': 10.0,
123      'length': 400.0,
124      'sld_core': 1.0,
125      'sld_face': 4.0,
126      'sld_rim': 4.0,
127      'sld_solvent': 1.0,
128      'theta': 90.0,
129      'phi': 0.0,
130      'background': 0.00,
131     }, (qx, qy), 24.9167],
132
133    # Additional tests with larger range of parameters
134    [{'radius': 3.0,
135      'rim_thickness': 100.0,
136      'face_thickness': 100.0,
137      'length': 1200.0,
138      'sld_core': 5.0,
139      'sld_face': 41.0,
140      'sld_rim': 42.0,
141      'sld_solvent': 21.0,
142     }, 0.05, 1670.1828],
143    ]
Note: See TracBrowser for help on using the repository browser.