Changeset 64eecf7 in sasmodels for sasmodels/models/core_shell_bicelle.py
- Timestamp:
- Sep 5, 2017 11:40:09 AM (7 years ago)
- Branches:
- master, core_shell_microgels, costrafo411, magnetic_model, ticket-1257-vesicle-product, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
- Children:
- 30b60d2
- Parents:
- a53bf6b (diff), 142a8e2 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sasmodels/models/core_shell_bicelle.py
rf52d400 r64eecf7 17 17 .. figure:: img/core_shell_bicelle_parameters.png 18 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 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 21 and core regions in order to estimate appropriate starting parameters. 22 22 … … 29 29 .. math:: 30 30 31 \rho(r) = 32 \begin{cases} 31 \rho(r) = 32 \begin{cases} 33 33 &\rho_c \text{ for } 0 \lt r \lt R; -L \lt z\lt L \\[1.5ex] 34 34 &\rho_f \text{ for } 0 \lt r \lt R; -(L+2t) \lt z\lt -L; … … 51 51 52 52 \begin{align} 53 F(Q,\alpha) = &\bigg[ 53 F(Q,\alpha) = &\bigg[ 54 54 (\rho_c - \rho_f) V_c \frac{2J_1(QRsin \alpha)}{QRsin\alpha}\frac{sin(QLcos\alpha/2)}{Q(L/2)cos\alpha} \\ 55 55 &+(\rho_f - \rho_r) V_{c+f} \frac{2J_1(QRsin\alpha)}{QRsin\alpha}\frac{sin(Q(L/2+t_f)cos\alpha)}{Q(L/2+t_f)cos\alpha} \\ 56 56 &+(\rho_r - \rho_s) V_t \frac{2J_1(Q(R+t_r)sin\alpha)}{Q(R+t_r)sin\alpha}\frac{sin(Q(L/2+t_f)cos\alpha)}{Q(L/2+t_f)cos\alpha} 57 57 \bigg] 58 \end{align} 58 \end{align} 59 59 60 60 where $V_t$ is the total volume of the bicelle, $V_c$ the volume of the core, … … 66 66 cylinders is then given by integrating over all possible $\theta$ and $\phi$. 67 67 68 The *theta* and *phi* parameters are not used for the 1D output. 68 For oriented bicelles the *theta*, and *phi* orientation parameters will appear when fitting 2D data, 69 see the :ref:`cylinder` model for further information. 69 70 Our implementation of the scattering kernel and the 1D scattering intensity 70 71 use the c-library from NIST. 71 72 72 .. figure:: img/cylinder_angle_definition. jpg73 .. figure:: img/cylinder_angle_definition.png 73 74 74 Definition of the angles for the oriented core shell bicelle tmodel. 75 Definition of the angles for the oriented core shell bicelle model, 76 note that the cylinder axis of the bicelle starts along the beam direction 77 when $\theta = \phi = 0$. 75 78 76 79 … … 91 94 """ 92 95 93 from numpy import inf, sin, cos 96 from numpy import inf, sin, cos, pi 94 97 95 98 name = "core_shell_bicelle" 96 99 title = "Circular cylinder with a core-shell scattering length density profile.." 97 100 description = """ 98 P(q,alpha)= (scale/Vs)*f(q)^(2) + bkg, where: 101 P(q,alpha)= (scale/Vs)*f(q)^(2) + bkg, where: 99 102 f(q)= Vt(sld_rim - sld_solvent)* sin[qLt.cos(alpha)/2] 100 103 /[qLt.cos(alpha)/2]*J1(qRout.sin(alpha)) … … 138 141 ["sld_rim", "1e-6/Ang^2", 4, [-inf, inf], "sld", "Cylinder rim scattering length density"], 139 142 ["sld_solvent", "1e-6/Ang^2", 1, [-inf, inf], "sld", "Solvent scattering length density"], 140 ["theta", "degrees", 90, [- inf, inf], "orientation", "In planeangle"],141 ["phi", "degrees", 0, [- inf, inf], "orientation", "Out of plane angle"],143 ["theta", "degrees", 90, [-360, 360], "orientation", "cylinder axis to beam angle"], 144 ["phi", "degrees", 0, [-360, 360], "orientation", "rotation about beam"] 142 145 ] 143 146 … … 146 149 source = ["lib/sas_Si.c", "lib/polevl.c", "lib/sas_J1.c", "lib/gauss76.c", 147 150 "core_shell_bicelle.c"] 151 152 def random(): 153 import numpy as np 154 pars = dict( 155 radius=10**np.random.uniform(1.3, 3), 156 length=10**np.random.uniform(1.3, 4), 157 thick_rim=10**np.random.uniform(0, 1.7), 158 thick_face=10**np.random.uniform(0, 1.7), 159 ) 160 return pars 148 161 149 162 demo = dict(scale=1, background=0, … … 158 171 theta=90, 159 172 phi=0) 173 q = 0.1 174 # april 6 2017, rkh add unit tests, NOT compared with any other calc method, assume correct! 175 qx = q*cos(pi/6.0) 176 qy = q*sin(pi/6.0) 177 tests = [[{}, 0.05, 7.4883545957], 178 [{'theta':80., 'phi':10.}, (qx, qy), 2.81048892474 ] 179 ] 180 del qx, qy # not necessary to delete, but cleaner 160 181 161 #qx, qy = 0.4 * cos(pi/2.0), 0.5 * sin(0)
Note: See TracChangeset
for help on using the changeset viewer.