Changeset 8f04da4 in sasmodels for sasmodels/models/core_shell_bicelle_elliptical.py
- Timestamp:
- Aug 2, 2017 12:53:56 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:
- bd21b12
- Parents:
- 1511c37c
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sasmodels/models/core_shell_bicelle_elliptical.py
r9802ab3 r8f04da4 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 Outer shells on the rims and flat ends may be of different thicknesses and 8 Outer shells on the rims and flat ends may be of different thicknesses and 9 9 scattering length densities. The form factor is normalized by the total particle volume. 10 10 … … 17 17 .. figure:: img/core_shell_bicelle_parameters.png 18 18 19 Cross section of model used here. Users will have 20 to decide how to distribute "heads" and "tails" between the rim, face 19 Cross section of 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 … … 27 27 .. math:: 28 28 29 \rho(r) = 30 \begin{cases} 29 \rho(r) = 30 \begin{cases} 31 31 &\rho_c \text{ for } 0 \lt r \lt R; -L \lt z\lt L \\[1.5ex] 32 32 &\rho_f \text{ for } 0 \lt r \lt R; -(L+2t) \lt z\lt -L; … … 48 48 .. math:: 49 49 50 \begin{align} 51 F(Q,\alpha,\psi) = &\bigg[ 50 \begin{align} 51 F(Q,\alpha,\psi) = &\bigg[ 52 52 (\rho_c - \rho_f) V_c \frac{2J_1(QR'sin \alpha)}{QR'sin\alpha}\frac{sin(QLcos\alpha/2)}{Q(L/2)cos\alpha} \\ 53 53 &+(\rho_f - \rho_r) 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} \\ 54 54 &+(\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} 55 55 \bigg] 56 \end{align} 56 \end{align} 57 57 58 58 where … … 61 61 62 62 R'=\frac{R}{\sqrt{2}}\sqrt{(1+X_{core}^{2}) + (1-X_{core}^{2})cos(\psi)} 63 64 65 and $V_t = \pi.(R+t_r)(Xcore.R+t_r)^2.(L+2.t_f)$ is the total volume of the bicelle, 66 $V_c = \pi.Xcore.R^2.L$ the volume of the core, $V_{c+f} = \pi.Xcore.R^2.(L+2.t_f)$ 63 64 65 and $V_t = \pi.(R+t_r)(Xcore.R+t_r)^2.(L+2.t_f)$ is the total volume of the bicelle, 66 $V_c = \pi.Xcore.R^2.L$ the volume of the core, $V_{c+f} = \pi.Xcore.R^2.(L+2.t_f)$ 67 67 the volume of the core plus the volume of the faces, $R$ is the radius 68 of the core, $Xcore$ is the axial ratio of the core, $L$ the length of the core, 69 $t_f$ the thickness of the face, $t_r$ the thickness of the rim and $J_1$ the usual 70 first order bessel function. The core has radii $R$ and $Xcore.R$ so is circular, 71 as for the core_shell_bicelle model, for $Xcore$ =1. Note that you may need to 72 limit the range of $Xcore$, especially if using the Monte-Carlo algorithm, as 68 of the core, $Xcore$ is the axial ratio of the core, $L$ the length of the core, 69 $t_f$ the thickness of the face, $t_r$ the thickness of the rim and $J_1$ the usual 70 first order bessel function. The core has radii $R$ and $Xcore.R$ so is circular, 71 as for the core_shell_bicelle model, for $Xcore$ =1. Note that you may need to 72 limit the range of $Xcore$, especially if using the Monte-Carlo algorithm, as 73 73 setting radius to $R/Xcore$ and axial ratio to $1/Xcore$ gives an equivalent solution! 74 74 … … 76 76 bicelles is then given by integrating over all possible $\alpha$ and $\psi$. 77 77 78 For oriented bicelles the *theta*, *phi* and *psi* orientation parameters will appear when fitting 2D data, 78 For oriented bicelles the *theta*, *phi* and *psi* orientation parameters will appear when fitting 2D data, 79 79 see the :ref:`elliptical-cylinder` model for further information. 80 80 … … 82 82 .. figure:: img/elliptical_cylinder_angle_definition.png 83 83 84 Definition of the angles for the oriented core_shell_bicelle_elliptical particles. 84 Definition of the angles for the oriented core_shell_bicelle_elliptical particles. 85 85 86 86 … … 105 105 description = """ 106 106 core_shell_bicelle_elliptical 107 Elliptical cylinder core, optional shell on the two flat faces, and shell of 108 uniform thickness on its rim (extending around the end faces). 107 Elliptical cylinder core, optional shell on the two flat faces, and shell of 108 uniform thickness on its rim (extending around the end faces). 109 109 Please see full documentation for equations and further details. 110 110 Involves a double numerical integral around the ellipsoid diameter … … 136 136 "core_shell_bicelle_elliptical.c"] 137 137 138 demo = dict(scale=1, background=0, 139 radius=30.0, 140 x_core=3.0, 141 thick_rim=8.0, 142 thick_face=14.0, 143 length=50.0, 144 sld_core=4.0, 145 sld_face=7.0, 146 sld_rim=1.0, 147 sld_solvent=6.0, 148 theta=90, 149 phi=0, 150 psi=0) 138 def random(): 139 import numpy as np 140 outer_major = 10**np.random.uniform(1, 4.7) 141 outer_minor = 10**np.random.uniform(1, 4.7) 142 # Use a distribution with a preference for thin shell or thin core, 143 # limited by the minimum radius. Avoid core,shell radii < 1 144 min_radius = min(outer_major, outer_minor) 145 thick_rim = np.random.beta(0.5, 0.5)*(min_radius-2) + 1 146 radius_major = outer_major - thick_rim 147 radius_minor = outer_minor - thick_rim 148 radius = radius_major 149 x_core = radius_minor/radius_major 150 outer_length = 10**np.random.uniform(1, 4.7) 151 # Caps should be a small percentage of the total length, but at least one 152 # angstrom long. Since outer length >= 10, the following will suffice 153 thick_face = 10**np.random.uniform(-np.log10(outer_length), -1)*outer_length 154 length = outer_length - thick_face 155 pars = dict( 156 radius=radius, 157 x_core=x_core, 158 thick_rim=thick_rim, 159 thick_face=thick_face, 160 length=length 161 ) 162 return pars 163 151 164 152 165 q = 0.1
Note: See TracChangeset
for help on using the changeset viewer.