Changeset 110f69c in sasmodels for sasmodels/models
- Timestamp:
- Nov 28, 2017 11:17:57 AM (6 years ago)
- Branches:
- master, core_shell_microgels, magnetic_model, ticket-1257-vesicle-product, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
- Children:
- e65c3ba
- Parents:
- 167d0f1
- Location:
- sasmodels/models
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
sasmodels/models/core_shell_bicelle_elliptical_belt_rough.py
r129bdc4 r110f69c 6 6 core-shell scattering length density profile. Thus this is a variation 7 7 of the core-shell bicelle model, but with an elliptical cylinder for the core. 8 In this version the "rim" or "belt" does NOT extend the full length of the particle,9 but has the same length as the core. 10 Outer shells on the rims and flat ends may be of different thicknesses and 11 scattering lengthdensities. The form factor is normalized by the total particle volume.8 In this version the "rim" or "belt" does NOT extend the full length of 9 the particle, but has the same length as the core. Outer shells on the 10 rims and flat ends may be of different thicknesses and scattering length 11 densities. The form factor is normalized by the total particle volume. 12 12 This version includes an approximate "interfacial roughness". 13 13 … … 15 15 .. figure:: img/core_shell_bicelle_belt_geometry.png 16 16 17 Schematic cross-section of bicelle with belt. Note however that the model here18 calculates for rectangular, not curved, rims as shown below.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 19 20 20 .. figure:: img/core_shell_bicelle_belt_parameters.png 21 21 22 Cross section of model used here. Users will have 23 to decide how to distribute "heads" and "tails" between the rim, face 22 Cross section of model used here. Users will have 23 to decide how to distribute "heads" and "tails" between the rim, face 24 24 and core regions in order to estimate appropriate starting parameters. 25 25 … … 30 30 .. math:: 31 31 32 \rho(r) = 33 \begin{cases} 32 \rho(r) = 33 \begin{cases} 34 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/235 &\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 38 \end{cases} 39 39 40 40 The 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 angle42 for the ellipsoidal cross section core, to give:41 $\alpha$ is the angle between the $Q$ vector and the cylinder axis, and $\psi$ 42 is the angle for the ellipsoidal cross section core, to give: 43 43 44 44 .. math:: 45 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} 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} 48 49 49 where a numerical integration of $F(Q,\alpha, \psi)^2.sin(\alpha)$ is carried out over \alpha and \psi for: 50 where a numerical integration of $F(Q,\alpha, \psi)^2\sin(\alpha)$ is 51 carried out over $\alpha$ and $\psi$ for: 50 52 51 53 .. math:: 52 54 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} 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} 58 65 \bigg] 59 \end{align}60 66 61 67 where … … 63 69 .. math:: 64 70 65 R'=\frac{R}{\sqrt{2}}\sqrt{(1+X_{core}^{2}) + (1-X_{core}^{2})cos(\psi)} 66 67 68 and $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)$ 70 the volume of the core plus the volume of the faces, $V_{c+r} = \pi.(R+t_r)(Xcore.R+t_r),.L$ 71 the volume of the core plus the rim, $R$ is the radius 72 of 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 74 first order bessel function. The core has radii $R$ and $Xcore.R$ so is circular, 75 as for the core_shell_bicelle model, for $Xcore$ =1. Note that you may need to 76 limit the range of $Xcore$, especially if using the Monte-Carlo algorithm, as 77 setting radius to $R/Xcore$ and axial ratio to $1/Xcore$ gives an equivalent solution! 71 R' = \frac{R}{\sqrt{2}} 72 \sqrt{(1+X_\text{core}^{2}) + (1-X_\text{core}^{2})\cos(\psi)} 78 73 79 An approximation for the effects of "Gaussian interfacial roughness" $\sigma$ is included, 80 by multiplying $I(Q)$ by $exp\left \{ -\frac{1}{2}Q^2\sigma^2 \right \}$ . This 81 applies, 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 83 with a Gaussian of standard deviation $\sigma$ does exactly this multiplication.) Leave 84 $\sigma$ set to zero for the usual sharp interfaces. 74 75 and $V_t = \pi (R+t_r)(X_\text{core} R+t_r) L + 2 \pi X_\text{core} R^2 t_f$ is 76 the total volume of the bicelle, $V_c = \pi X_\text{core} R^2 L$ the volume of 77 the core, $V_{c+f} = \pi X_\text{core} R^2 (L+2 t_f)$ the volume of the core 78 plus the volume of the faces, $V_{c+r} = \pi (R+t_r)(X_\text{core} R+t_r) L$ 79 the 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 82 usual first order bessel function. The core has radii $R$ and $X_\text{core} R$ 83 so is circular, as for the core_shell_bicelle model, for $X_\text{core}=1$. 84 Note that you may need to limit the range of $X_\text{core}$, especially if 85 using the Monte-Carlo algorithm, as setting radius to $R/X_\text{core}$ and 86 axial ratio to $1/X_\text{core}$ gives an equivalent solution! 87 88 An approximation for the effects of "Gaussian interfacial roughness" $\sigma$ 89 is included, by multiplying $I(Q)$ by 90 $\exp\left \{ -\frac{1}{2}Q^2\sigma^2 \right \}$. This applies, in some way, to 91 all interfaces in the model not just the external ones. (Note that for a one 92 dimensional system convolution of the scattering length density profile with 93 a Gaussian of standard deviation $\sigma$ does exactly this multiplication.) 94 Leave $\sigma$ set to zero for the usual sharp interfaces. 85 95 86 96 The output of the 1D scattering intensity function for randomly oriented 87 97 bicelles is then given by integrating over all possible $\alpha$ and $\psi$. 88 98 89 For oriented bicelles the *theta*, *phi* and *psi* orientation parameters will appear when fitting 2D data, 90 for further details of the calculation and angular dispersions see :ref:`orientation` . 99 For oriented bicelles the *theta*, *phi* and *psi* orientation parameters 100 will appear when fitting 2D data, for further details of the calculation 101 and angular dispersions see :ref:`orientation` . 91 102 92 103 .. figure:: img/elliptical_cylinder_angle_definition.png 93 104 94 Definition of the angles for the oriented core_shell_bicelle_elliptical particles. 105 Definition of the angles for the oriented core_shell_bicelle_elliptical 106 particles. 95 107 96 108 … … 115 127 description = """ 116 128 core_shell_bicelle_elliptical_belt_rough 117 Elliptical cylinder core, optional shell on the two flat faces, and "belt" shell of 129 Elliptical cylinder core, optional shell on the two flat faces, and "belt" shell of 118 130 uniform thickness on its rim (in this case NOT extending around the end faces). 119 131 with approximate interfacial roughness. … … 173 185 174 186 [{'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 187 'sld_core':4.0, 'sld_face':7.0, 'sld_rim':1.0, 'sld_solvent':6.0, 'background':0.0}, 188 0.015, 189.328], 189 #[{'theta':80., 'phi':10.}, (qx, qy), 7.88866563001 ], 190 ] 179 191 180 192 del qx, qy # not necessary to delete, but cleaner -
sasmodels/models/ellipsoid.py
reda8b30 r110f69c 53 53 r = R_e \left[ 1 + u^2\left(R_p^2/R_e^2 - 1\right)\right]^{1/2} 54 54 55 For 2d data from oriented ellipsoids the direction of the rotation axis of 56 the ellipsoid is defined using two angles $\theta$ and $\phi$ as for the 55 For 2d data from oriented ellipsoids the direction of the rotation axis of 56 the ellipsoid is defined using two angles $\theta$ and $\phi$ as for the 57 57 :ref:`cylinder orientation figure <cylinder-angle-definition>`. 58 58 For the ellipsoid, $\theta$ is the angle between the rotational axis 59 59 and the $z$ -axis in the $xz$ plane followed by a rotation by $\phi$ 60 in the $xy$ plane, for further details of the calculation and angular 60 in the $xy$ plane, for further details of the calculation and angular 61 61 dispersions see :ref:`orientation` . 62 62 … … 209 209 qy = q*sin(pi/6.0) 210 210 tests = [[{}, 0.05, 54.8525847025], 211 [{'theta':80., 'phi':10.}, (qx, qy), 1.74134670026 211 [{'theta':80., 'phi':10.}, (qx, qy), 1.74134670026], 212 212 ] 213 213 del qx, qy # not necessary to delete, but cleaner -
sasmodels/models/stacked_disks.py
reda8b30 r110f69c 74 74 the layers. 75 75 76 2d scattering from oriented stacks is calculated in the same way as for cylinders, 77 for further details of the calculation and angular dispersions see :ref:`orientation` . 76 2d scattering from oriented stacks is calculated in the same way as for 77 cylinders, for further details of the calculation and angular dispersions 78 see :ref:`orientation`. 78 79 79 80 .. figure:: img/cylinder_angle_definition.png 80 81 81 82 Angles $\theta$ and $\phi$ orient the stack of discs relative 82 to the beam line coordinates, where the beam is along the $z$ axis. Rotation $\theta$, initially 83 in the $xz$ plane, is carried out first, then rotation $\phi$ about the $z$ axis. Orientation distributions 84 are described as rotations about two perpendicular axes $\delta_1$ and $\delta_2$ 85 in the frame of the cylinder itself, which when $\theta = \phi = 0$ are parallel to the $Y$ and $X$ axes. 83 to the beam line coordinates, where the beam is along the $z$ axis. 84 Rotation $\theta$, initially in the $xz$ plane, is carried out first, 85 then rotation $\phi$ about the $z$ axis. Orientation distributions are 86 described as rotations about two perpendicular axes $\delta_1$ and 87 $\delta_2$ in the frame of the cylinder itself, which when 88 $\theta = \phi = 0$ are parallel to the $Y$ and $X$ axes. 86 89 87 90
Note: See TracChangeset
for help on using the changeset viewer.