source: sasmodels/sasmodels/models/core_shell_bicelle_elliptical_belt_rough.py @ d277229

core_shell_microgelsmagnetic_modelticket-1257-vesicle-productticket_1156ticket_1265_superballticket_822_more_unit_tests
Last change on this file since d277229 was d277229, checked in by grethevj, 6 years ago

Models updated to include choices for effective interaction radii

  • Property mode set to 100644
File size: 8.4 KB
Line 
1r"""
2Definition
3----------
4
5This model provides the form factor for an elliptical cylinder with a
6core-shell scattering length density profile. Thus this is a variation
7of the core-shell bicelle model, but with an elliptical cylinder for the core.
8In this version the "rim" or "belt" does NOT extend the full length of
9the particle, but has the same length as the core. Outer shells on the
10rims and flat ends may be of different thicknesses and scattering length
11densities. The form factor is normalized by the total particle volume.
12This version includes an approximate "interfacial roughness".
13
14
15.. figure:: img/core_shell_bicelle_belt_geometry.png
16
17    Schematic cross-section of bicelle with belt. Note however that the model
18    here calculates for rectangular, not curved, rims as shown below.
19
20.. figure:: img/core_shell_bicelle_belt_parameters.png
21
22   Cross section of model used here. Users will have
23   to decide how to distribute "heads" and "tails" between the rim, face
24   and core regions in order to estimate appropriate starting parameters.
25
26Given the scattering length densities (sld) $\rho_c$, the core sld, $\rho_f$,
27the face sld, $\rho_r$, the rim sld and $\rho_s$ the solvent sld, the
28scattering length density variation along the bicelle axis is:
29
30.. math::
31
32    \rho(r) =
33      \begin{cases}
34      &\rho_c \text{ for } 0 \lt r \lt R;   -L/2 \lt z\lt L/2 \\[1.5ex]
35      &\rho_f \text{ for } 0 \lt r \lt R;   -(L/2 +t_\text{face}) \lt z\lt -L/2;
36      L/2 \lt z\lt (L/2+t_\text{face}) \\[1.5ex]
37      &\rho_r\text{ for } R \lt r \lt R+t_\text{rim}; -L/2 \lt z\lt L/2
38      \end{cases}
39
40The form factor for the bicelle is calculated in cylindrical coordinates, where
41$\alpha$ is the angle between the $Q$ vector and the cylinder axis, and $\psi$
42is the angle for the ellipsoidal cross section core, to give:
43
44.. math::
45
46    I(Q,\alpha,\psi) = \frac{\text{scale}}{V_t}
47        \cdot F(Q,\alpha, \psi)^2 \cdot \sin(\alpha)
48        \cdot\exp\left\{ -\frac{1}{2}Q^2\sigma^2 \right\} + \text{background}
49
50where a numerical integration of $F(Q,\alpha, \psi)^2\sin(\alpha)$ is
51carried out over $\alpha$ and $\psi$ for:
52
53.. math::
54
55    F(Q,\alpha,\psi) = &\bigg[
56      (\rho_c -\rho_r - \rho_f + \rho_s) V_c
57      \frac{2J_1(QR'\sin \alpha)}{QR'\sin\alpha}
58      \frac{\sin(QL\cos\alpha/2)}{Q(L/2)\cos\alpha} \\
59    &+(\rho_f - \rho_s) V_{c+f}
60      \frac{2J_1(QR'\sin\alpha)}{QR'\sin\alpha}
61      \frac{\sin(Q(L/2+t_f)\cos\alpha)}{Q(L/2+t_f)\cos\alpha} \\
62    &+(\rho_r - \rho_s) V_{c+r}
63      \frac{2J_1(Q(R'+t_r)\sin\alpha)}{Q(R'+t_r)\sin\alpha}
64      \frac{\sin(Q(L/2)\cos\alpha)}{Q(L/2)\cos\alpha}
65    \bigg]
66
67where
68
69.. math::
70
71    R' = \frac{R}{\sqrt{2}}
72        \sqrt{(1+X_\text{core}^{2}) + (1-X_\text{core}^{2})\cos(\psi)}
73
74
75and $V_t = \pi (R+t_r)(X_\text{core} R+t_r) L + 2 \pi X_\text{core} R^2 t_f$ is
76the total volume of the bicelle, $V_c = \pi X_\text{core} R^2 L$ the volume of
77the core, $V_{c+f} = \pi X_\text{core} R^2 (L+2 t_f)$ the volume of the core
78plus the volume of the faces, $V_{c+r} = \pi (R+t_r)(X_\text{core} R+t_r) L$
79the volume of the core plus the rim, $R$ is the radius of the core,
80$X_\text{core}$ is the axial ratio of the core, $L$ the length of the core,
81$t_f$ the thickness of the face, $t_r$ the thickness of the rim and $J_1$ the
82usual first order bessel function. The core has radii $R$ and $X_\text{core} R$
83so is circular, as for the core_shell_bicelle model, for $X_\text{core}=1$.
84Note that you may need to limit the range of $X_\text{core}$, especially if
85using the Monte-Carlo algorithm, as setting radius to $R/X_\text{core}$ and
86axial ratio to $1/X_\text{core}$ gives an equivalent solution!
87
88An approximation for the effects of "Gaussian interfacial roughness" $\sigma$
89is included, by multiplying $I(Q)$ by
90$\exp\left \{ -\frac{1}{2}Q^2\sigma^2 \right \}$. This applies, in some way, to
91all interfaces in the model not just the external ones. (Note that for a one
92dimensional system convolution of the scattering length density profile with
93a Gaussian of standard deviation $\sigma$ does exactly this multiplication.)
94Leave $\sigma$ set to zero for the usual sharp interfaces.
95
96The output of the 1D scattering intensity function for randomly oriented
97bicelles is then given by integrating over all possible $\alpha$ and $\psi$.
98
99For oriented bicelles the *theta*, *phi* and *psi* orientation parameters
100will appear when fitting 2D data, for further details of the calculation
101and angular dispersions  see :ref:`orientation` .
102
103.. figure:: img/elliptical_cylinder_angle_definition.png
104
105    Definition of the angles for the oriented core_shell_bicelle_elliptical
106    particles.
107
108
109
110References
111----------
112
113.. [#]
114
115Authorship and Verification
116----------------------------
117
118* **Author:** Richard Heenan **Date:** October 5, 2017
119* **Last Modified by:**  Richard Heenan new 2d orientation **Date:** October 5, 2017
120* **Last Reviewed by:**  Richard Heenan 2d calc seems agree with 1d **Date:** Nov 2, 2017
121"""
122
123from numpy import inf, sin, cos, pi
124
125name = "core_shell_bicelle_elliptical_belt_rough"
126title = "Elliptical cylinder with a core-shell scattering length density profile.."
127description = """
128    core_shell_bicelle_elliptical_belt_rough
129    Elliptical cylinder core, optional shell on the two flat faces, and "belt" shell of
130    uniform thickness on its rim (in this case NOT extending around the end faces).
131    with approximate interfacial roughness.
132    Please see full documentation for equations and further details.
133    Involves a double numerical integral around the ellipsoid diameter
134    and the angle of the cylinder axis to Q.
135    Compare also the core_shell_bicelle and elliptical_cylinder models.
136      """
137category = "shape:cylinder"
138
139# pylint: disable=bad-whitespace, line-too-long
140#             ["name", "units", default, [lower, upper], "type", "description"],
141parameters = [
142    ["radius",         "Ang",       30, [0, inf],    "volume",      "Cylinder core radius r_minor"],
143    ["x_core",        "None",       3,  [0, inf],    "volume",      "Axial ratio of core, X = r_major/r_minor"],
144    ["thick_rim",  "Ang",            8, [0, inf],    "volume",      "Rim or belt shell thickness"],
145    ["thick_face", "Ang",           14, [0, inf],    "volume",      "Cylinder face thickness"],
146    ["length",         "Ang",       50, [0, inf],    "volume",      "Cylinder length"],
147    ["sld_core",       "1e-6/Ang^2", 4, [-inf, inf], "sld",         "Cylinder core scattering length density"],
148    ["sld_face",       "1e-6/Ang^2", 7, [-inf, inf], "sld",         "Cylinder face scattering length density"],
149    ["sld_rim",        "1e-6/Ang^2", 1, [-inf, inf], "sld",         "Cylinder rim scattering length density"],
150    ["sld_solvent",    "1e-6/Ang^2", 6, [-inf, inf], "sld",         "Solvent scattering length density"],
151    ["sigma",       "Ang",        0,    [0, inf],    "",            "Interfacial roughness"],
152    ["theta",       "degrees",    90.0, [-360, 360], "orientation", "Cylinder axis to beam angle"],
153    ["phi",         "degrees",    0,    [-360, 360], "orientation", "Rotation about beam"],
154    ["psi",         "degrees",    0,    [-360, 360], "orientation", "Rotation about cylinder axis"],
155    ]
156
157# pylint: enable=bad-whitespace, line-too-long
158
159source = ["lib/sas_Si.c", "lib/polevl.c", "lib/sas_J1.c", "lib/gauss76.c",
160          "core_shell_bicelle_elliptical_belt_rough.c"]
161have_Fq = True
162effective_radius_type = ["equivalent sphere","outer rim average radius","outer rim min radius",
163                         "outer max radius", "half outer thickness","half diagonal"]
164
165demo = dict(scale=1, background=0,
166            radius=30.0,
167            x_core=3.0,
168            thick_rim=8.0,
169            thick_face=14.0,
170            length=50.0,
171            sld_core=4.0,
172            sld_face=7.0,
173            sld_rim=1.0,
174            sld_solvent=6.0,
175            theta=90,
176            phi=0,
177            psi=0,
178            sigma=0)
179
180q = 0.1
181# april 6 2017, rkh added a 2d unit test, NOT READY YET pull #890 branch assume correct!
182qx = q*cos(pi/6.0)
183qy = q*sin(pi/6.0)
184
185tests = [
186    [{'radius': 30.0, 'x_core': 3.0, 'thick_rim':8.0, 'thick_face':14.0, 'length':50.0}, 'ER', 1],
187    [{'radius': 30.0, 'x_core': 3.0, 'thick_rim':8.0, 'thick_face':14.0, 'length':50.0}, 'VR', 1],
188
189    [{'radius': 30.0, 'x_core': 3.0, 'thick_rim':8.0, 'thick_face':14.0, 'length':50.0,
190      'sld_core':4.0, 'sld_face':7.0, 'sld_rim':1.0, 'sld_solvent':6.0, 'background':0.0},
191     0.015, 189.328],
192    #[{'theta':80., 'phi':10.}, (qx, qy), 7.88866563001 ],
193]
194
195del qx, qy  # not necessary to delete, but cleaner
Note: See TracBrowser for help on using the repository browser.