source: sasmodels/sasmodels/models/core_shell_bicelle.py @ 0d6e865

core_shell_microgelscostrafo411magnetic_modelticket-1257-vesicle-productticket_1156ticket_1265_superballticket_822_more_unit_tests
Last change on this file since 0d6e865 was 0d6e865, checked in by dirk, 8 years ago

Rewriting selected models in spherical coordinates. This fixes ticket #492 for these models.

  • Property mode set to 100644
File size: 6.1 KB
RevLine 
[8007311]1r"""
2Definition
3----------
[adc753d]4
[40a87fa]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.
[8007311]10
11
12.. figure:: img/core_shell_bicelle_geometry.png
13
[a0fee3b]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.
[8007311]22
[adc753d]23Given the scattering length densities (sld) $\rho_c$, the core sld, $\rho_f$,
24the face sld, $\rho_r$, the rim sld and $\rho_s$ the solvent sld, the
25scattering length density variation along the cylinder axis is:
26
27.. math::
28
29    \rho(r) =
30      \begin{cases}
31      &\rho_c \text{ for } 0 \lt r \lt R; -L \lt z\lt L \\[1.5ex]
32      &\rho_f \text{ for } 0 \lt r \lt R; -(L+2t) \lt z\lt -L;
33      L \lt z\lt (L+2t) \\[1.5ex]
34      &\rho_r\text{ for } 0 \lt r \lt R; -(L+2t) \lt z\lt -L; L \lt z\lt (L+2t)
35      \end{cases}
36
37The form factor for the bicelle is calculated in cylindrical coordinates, where
38$\alpha$ is the angle between the $Q$ vector and the cylinder axis, to give:
39
40.. math::
41
42    I(Q,\alpha) = \frac{\text{scale}}{V} \cdot
43        F(Q,\alpha)^2 + \text{background}
[416f5c7]44
[adc753d]45where
46
47.. math::
48
[416f5c7]49        \begin{align}   
50    F(Q,\alpha) = &\bigg[
51    (\rho_c - \rho_f) V_c \frac{J_1(QRsin \alpha)}{QRsin\alpha}\frac{2 \cdot sin(QLcos\alpha/2)}{QLcos\alpha} \\
52    &+(\rho_f - \rho_r) V_{c+f} \frac{J_1(QRsin\alpha)}{QRsin\alpha}\frac{2 \cdot sin(Q(L/2+t_f)cos\alpha)}{Q(L+2t_f)cos\alpha} \\
53    &+(\rho_r - \rho_s) V_t \frac{J_1(Q(R+t_r)sin\alpha)}{Q(R+t_r)sin\alpha}\frac{2 \cdot sin(Q(L/2+t_f)cos\alpha)}{Q(L+2t_f)cos\alpha}
[adc753d]54    \bigg]
55    \end{align}
56
57where $V_t$ is the total volume of the bicelle, $V_c$ the volume of the core,
58$V_{c+f}$ the volume of the core plus the volume of the faces, $R$ is the radius
59of the core, $L$ the length of the core, $t_f$ the thickness of the face, $t_r$
60the thickness of the rim and $J_1$ the usual first order bessel function.
61
[8007311]62The output of the 1D scattering intensity function for randomly oriented
[adc753d]63cylinders is then given by integrating over all possible $\theta$ and $\phi$.
[8007311]64
65The *theta* and *phi* parameters are not used for the 1D output.
66Our implementation of the scattering kernel and the 1D scattering intensity
67use the c-library from NIST.
68
[2f0c07d]69.. figure:: img/cylinder_angle_definition.jpg
[8007311]70
[2f0c07d]71    Definition of the angles for the oriented core shell bicelle tmodel.
[8007311]72
73
74References
75----------
76
[adc753d]77.. [#] D Singh (2009). *Small angle scattering studies of self assembly in
78   lipid mixtures*, John's Hopkins University Thesis (2009) 223-225. `Available
79   from Proquest <http://search.proquest.com/docview/304915826?accountid
80   =26379>`_
[b0c4271]81
82Authorship and Verification
83----------------------------
84
85* **Author:** NIST IGOR/DANSE **Date:** pre 2010
[adc753d]86* **Last Modified by:** Paul Butler **Date:** September 30, 2016
87* **Last Reviewed by:** Richard Heenan **Date:** October 5, 2016
[8007311]88"""
89
90from numpy import inf, sin, cos
91
92name = "core_shell_bicelle"
93title = "Circular cylinder with a core-shell scattering length density profile.."
94description = """
[a0fee3b]95    P(q,alpha)= (scale/Vs)*f(q)^(2) + bkg,  where:
96    f(q)= Vt(sld_rim - sld_solvent)* sin[qLt.cos(alpha)/2]
97    /[qLt.cos(alpha)/2]*J1(qRout.sin(alpha))
98    /[qRout.sin(alpha)]+
99    (sld_core-sld_face)*Vc*sin[qLcos(alpha)/2][[qL
100    *cos(alpha)/2]*J1(qRc.sin(alpha))
101    /qRc.sin(alpha)]+
102    (sld_face-sld_rim)*(Vc+Vf)*sin[q(L+2.thick_face).
103    cos(alpha)/2][[q(L+2.thick_face)*cos(alpha)/2]*
104    J1(qRc.sin(alpha))/qRc.sin(alpha)]
[8007311]105
106    alpha:is the angle between the axis of
107    the cylinder and the q-vector
[a0fee3b]108    Vt = pi.(Rc + thick_rim)^2.Lt : total volume
109    Vc = pi.Rc^2.L :the volume of the core
110    Vf = 2.pi.Rc^2.thick_face
111    Rc = radius: is the core radius
[8007311]112    L: the length of the core
[a0fee3b]113    Lt = L + 2.thick_face: total length
114    Rout = radius + thick_rim
115    sld_core, sld_rim, sld_face:scattering length
116    densities within the particle
[aad336c]117    sld_solvent: the scattering length density
[8007311]118    of the solvent
119    bkg: the background
120    J1: the first order Bessel function
121    theta: axis_theta of the cylinder
122    phi: the axis_phi of the cylinder...
123        """
124category = "shape:cylinder"
125
126# pylint: disable=bad-whitespace, line-too-long
127#             ["name", "units", default, [lower, upper], "type", "description"],
128parameters = [
[416f5c7]129    ["radius",         "Ang",       80, [0, inf],    "volume",      "Cylinder core radius"],
[2222134]130    ["thick_rim",  "Ang",       10, [0, inf],    "volume",      "Rim shell thickness"],
131    ["thick_face", "Ang",       10, [0, inf],    "volume",      "Cylinder face thickness"],
[416f5c7]132    ["length",         "Ang",      50, [0, inf],    "volume",      "Cylinder length"],
[42356c8]133    ["sld_core",       "1e-6/Ang^2", 1, [-inf, inf], "sld",         "Cylinder core scattering length density"],
134    ["sld_face",       "1e-6/Ang^2", 4, [-inf, inf], "sld",         "Cylinder face scattering length density"],
135    ["sld_rim",        "1e-6/Ang^2", 4, [-inf, inf], "sld",         "Cylinder rim scattering length density"],
136    ["sld_solvent",    "1e-6/Ang^2", 1, [-inf, inf], "sld",         "Solvent scattering length density"],
[8007311]137    ["theta",          "degrees",   90, [-inf, inf], "orientation", "In plane angle"],
138    ["phi",            "degrees",    0, [-inf, inf], "orientation", "Out of plane angle"],
139    ]
140
141# pylint: enable=bad-whitespace, line-too-long
142
[40a87fa]143source = ["lib/Si.c", "lib/polevl.c", "lib/sas_J1.c", "lib/gauss76.c",
144          "core_shell_bicelle.c"]
[8007311]145
146demo = dict(scale=1, background=0,
147            radius=20.0,
[2222134]148            thick_rim=10.0,
149            thick_face=10.0,
[8007311]150            length=400.0,
[aad336c]151            sld_core=1.0,
152            sld_face=4.0,
153            sld_rim=4.0,
154            sld_solvent=1.0,
[8007311]155            theta=90,
156            phi=0)
157
158qx, qy = 0.4 * cos(90), 0.5 * sin(0)
Note: See TracBrowser for help on using the repository browser.