1 | r""" |
---|
2 | Definition |
---|
3 | ---------- |
---|
4 | |
---|
5 | This model provides the form factor for a circular cylinder with a |
---|
6 | core-shell scattering length density profile. Thus this is a variation |
---|
7 | of a core-shell cylinder or disc where the shell on the walls and ends |
---|
8 | may be of different thicknesses and scattering length densities. The form |
---|
9 | factor is normalized by the particle volume. |
---|
10 | |
---|
11 | |
---|
12 | .. figure:: img/core_shell_bicelle_geometry.png |
---|
13 | |
---|
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. |
---|
22 | |
---|
23 | Given the scattering length densities (sld) $\rho_c$, the core sld, $\rho_f$, |
---|
24 | the face sld, $\rho_r$, the rim sld and $\rho_s$ the solvent sld, the |
---|
25 | scattering 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 | |
---|
37 | The 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} |
---|
44 | |
---|
45 | where |
---|
46 | |
---|
47 | .. math:: |
---|
48 | |
---|
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} |
---|
54 | \bigg] |
---|
55 | \end{align} |
---|
56 | |
---|
57 | where $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 |
---|
59 | of the core, $L$ the length of the core, $t_f$ the thickness of the face, $t_r$ |
---|
60 | the thickness of the rim and $J_1$ the usual first order bessel function. |
---|
61 | |
---|
62 | The output of the 1D scattering intensity function for randomly oriented |
---|
63 | cylinders is then given by integrating over all possible $\theta$ and $\phi$. |
---|
64 | |
---|
65 | The *theta* and *phi* parameters are not used for the 1D output. |
---|
66 | Our implementation of the scattering kernel and the 1D scattering intensity |
---|
67 | use the c-library from NIST. |
---|
68 | |
---|
69 | .. figure:: img/cylinder_angle_definition.jpg |
---|
70 | |
---|
71 | Definition of the angles for the oriented core shell bicelle tmodel. |
---|
72 | |
---|
73 | .. figure:: img/cylinder_angle_projection.jpg |
---|
74 | :width: 600px |
---|
75 | |
---|
76 | Examples of the angles for oriented pp against the detector plane. |
---|
77 | |
---|
78 | References |
---|
79 | ---------- |
---|
80 | |
---|
81 | .. [#] D Singh (2009). *Small angle scattering studies of self assembly in |
---|
82 | lipid mixtures*, John's Hopkins University Thesis (2009) 223-225. `Available |
---|
83 | from Proquest <http://search.proquest.com/docview/304915826?accountid |
---|
84 | =26379>`_ |
---|
85 | |
---|
86 | Authorship and Verification |
---|
87 | ---------------------------- |
---|
88 | |
---|
89 | * **Author:** NIST IGOR/DANSE **Date:** pre 2010 |
---|
90 | * **Last Modified by:** Paul Butler **Date:** September 30, 2016 |
---|
91 | * **Last Reviewed by:** Richard Heenan **Date:** October 5, 2016 |
---|
92 | """ |
---|
93 | |
---|
94 | from numpy import inf, sin, cos |
---|
95 | |
---|
96 | name = "core_shell_bicelle" |
---|
97 | title = "Circular cylinder with a core-shell scattering length density profile.." |
---|
98 | description = """ |
---|
99 | P(q,alpha)= (scale/Vs)*f(q)^(2) + bkg, where: |
---|
100 | f(q)= Vt(sld_rim - sld_solvent)* sin[qLt.cos(alpha)/2] |
---|
101 | /[qLt.cos(alpha)/2]*J1(qRout.sin(alpha)) |
---|
102 | /[qRout.sin(alpha)]+ |
---|
103 | (sld_core-sld_face)*Vc*sin[qLcos(alpha)/2][[qL |
---|
104 | *cos(alpha)/2]*J1(qRc.sin(alpha)) |
---|
105 | /qRc.sin(alpha)]+ |
---|
106 | (sld_face-sld_rim)*(Vc+Vf)*sin[q(L+2.thick_face). |
---|
107 | cos(alpha)/2][[q(L+2.thick_face)*cos(alpha)/2]* |
---|
108 | J1(qRc.sin(alpha))/qRc.sin(alpha)] |
---|
109 | |
---|
110 | alpha:is the angle between the axis of |
---|
111 | the cylinder and the q-vector |
---|
112 | Vt = pi.(Rc + thick_rim)^2.Lt : total volume |
---|
113 | Vc = pi.Rc^2.L :the volume of the core |
---|
114 | Vf = 2.pi.Rc^2.thick_face |
---|
115 | Rc = radius: is the core radius |
---|
116 | L: the length of the core |
---|
117 | Lt = L + 2.thick_face: total length |
---|
118 | Rout = radius + thick_rim |
---|
119 | sld_core, sld_rim, sld_face:scattering length |
---|
120 | densities within the particle |
---|
121 | sld_solvent: the scattering length density |
---|
122 | of the solvent |
---|
123 | bkg: the background |
---|
124 | J1: the first order Bessel function |
---|
125 | theta: axis_theta of the cylinder |
---|
126 | phi: the axis_phi of the cylinder... |
---|
127 | """ |
---|
128 | category = "shape:cylinder" |
---|
129 | |
---|
130 | # pylint: disable=bad-whitespace, line-too-long |
---|
131 | # ["name", "units", default, [lower, upper], "type", "description"], |
---|
132 | parameters = [ |
---|
133 | ["radius", "Ang", 80, [0, inf], "volume", "Cylinder core radius"], |
---|
134 | ["thick_rim", "Ang", 10, [0, inf], "volume", "Rim shell thickness"], |
---|
135 | ["thick_face", "Ang", 10, [0, inf], "volume", "Cylinder face thickness"], |
---|
136 | ["length", "Ang", 50, [0, inf], "volume", "Cylinder length"], |
---|
137 | ["sld_core", "1e-6/Ang^2", 1, [-inf, inf], "sld", "Cylinder core scattering length density"], |
---|
138 | ["sld_face", "1e-6/Ang^2", 4, [-inf, inf], "sld", "Cylinder face scattering length density"], |
---|
139 | ["sld_rim", "1e-6/Ang^2", 4, [-inf, inf], "sld", "Cylinder rim scattering length density"], |
---|
140 | ["sld_solvent", "1e-6/Ang^2", 1, [-inf, inf], "sld", "Solvent scattering length density"], |
---|
141 | ["theta", "degrees", 90, [-inf, inf], "orientation", "In plane angle"], |
---|
142 | ["phi", "degrees", 0, [-inf, inf], "orientation", "Out of plane angle"], |
---|
143 | ] |
---|
144 | |
---|
145 | # pylint: enable=bad-whitespace, line-too-long |
---|
146 | |
---|
147 | source = ["lib/Si.c", "lib/polevl.c", "lib/sas_J1.c", "lib/gauss76.c", |
---|
148 | "core_shell_bicelle.c"] |
---|
149 | |
---|
150 | demo = dict(scale=1, background=0, |
---|
151 | radius=20.0, |
---|
152 | thick_rim=10.0, |
---|
153 | thick_face=10.0, |
---|
154 | length=400.0, |
---|
155 | sld_core=1.0, |
---|
156 | sld_face=4.0, |
---|
157 | sld_rim=4.0, |
---|
158 | sld_solvent=1.0, |
---|
159 | theta=90, |
---|
160 | phi=0) |
---|
161 | |
---|
162 | qx, qy = 0.4 * cos(90), 0.5 * sin(0) |
---|
163 | tests = [ |
---|
164 | # Accuracy tests based on content in test/utest_other_models.py |
---|
165 | [{'radius': 20.0, |
---|
166 | 'thick_rim': 10.0, |
---|
167 | 'thick_face': 10.0, |
---|
168 | 'length': 400.0, |
---|
169 | 'sld_core': 1.0, |
---|
170 | 'sld_face': 4.0, |
---|
171 | 'sld_rim': 4.0, |
---|
172 | 'sld_solvent': 1.0, |
---|
173 | 'background': 0.0, |
---|
174 | }, 0.001, 353.550], |
---|
175 | |
---|
176 | [{'radius': 20.0, |
---|
177 | 'thick_rim': 10.0, |
---|
178 | 'thick_face': 10.0, |
---|
179 | 'length': 400.0, |
---|
180 | 'sld_core': 1.0, |
---|
181 | 'sld_face': 4.0, |
---|
182 | 'sld_rim': 4.0, |
---|
183 | 'sld_solvent': 1.0, |
---|
184 | 'theta': 90.0, |
---|
185 | 'phi': 0.0, |
---|
186 | 'background': 0.00, |
---|
187 | }, (qx, qy), 24.9167], |
---|
188 | |
---|
189 | # Additional tests with larger range of parameters |
---|
190 | [{'radius': 3.0, |
---|
191 | 'thick_rim': 100.0, |
---|
192 | 'thick_face': 100.0, |
---|
193 | 'length': 1200.0, |
---|
194 | 'sld_core': 5.0, |
---|
195 | 'sld_face': 41.0, |
---|
196 | 'sld_rim': 42.0, |
---|
197 | 'sld_solvent': 21.0, |
---|
198 | }, 0.05, 1670.1828], |
---|
199 | ] |
---|