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

core_shell_microgelsmagnetic_modelticket-1257-vesicle-productticket_1156ticket_1265_superballticket_822_more_unit_tests
Last change on this file since fc0b7aa was 129bdc4, checked in by richardh, 6 years ago

new model with long name, core_shell_bicelle_elliptical_belt_rough, using new orientation, hence in thsi branch

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