source: sasmodels/sasmodels/models/core_shell_bicelle.py @ 42356c8

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

label all sld parameters

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