Changeset 404ebbd in sasmodels for sasmodels/models/elliptical_cylinder.py
- Timestamp:
- Jul 30, 2017 12:56:22 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:
- 48462b0
- Parents:
- a151caa
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sasmodels/models/elliptical_cylinder.py
r9802ab3 r404ebbd 33 33 34 34 a = qr'\sin(\alpha) 35 35 36 36 b = q\frac{L}{2}\cos(\alpha) 37 37 38 38 r'=\frac{r_{minor}}{\sqrt{2}}\sqrt{(1+\nu^{2}) + (1-\nu^{2})cos(\psi)} 39 39 … … 57 57 define the axis of the cylinder using two angles $\theta$, $\phi$ and $\Psi$ 58 58 (see :ref:`cylinder orientation <cylinder-angle-definition>`). The angle 59 $\Psi$ is the rotational angle around its own long_c axis. 59 $\Psi$ is the rotational angle around its own long_c axis. 60 60 61 61 All angle parameters are valid and given only for 2D calculation; ie, an … … 72 72 detector plane, with $\Psi$ = 0. 73 73 74 The $\theta$ and $\phi$ parameters to orient the cylinder only appear in the model when fitting 2d data. 74 The $\theta$ and $\phi$ parameters to orient the cylinder only appear in the model when fitting 2d data. 75 75 On introducing "Orientational Distribution" in the angles, "distribution of theta" and "distribution of phi" parameters will 76 appear. These are actually rotations about the axes $\delta_1$ and $\delta_2$ of the cylinder, the $b$ and $a$ axes of the 77 cylinder cross section. (When $\theta = \phi = 0$ these are parallel to the $Y$ and $X$ axes of the instrument.) 78 The third orientation distribution, in $\psi$, is about the $c$ axis of the particle. Some experimentation may be required to 79 understand the 2d patterns fully. (Earlier implementations had numerical integration issues in some circumstances when orientation 80 distributions passed through 90 degrees, such situations, with very broad distributions, should still be approached with care.) 76 appear. These are actually rotations about the axes $\delta_1$ and $\delta_2$ of the cylinder, the $b$ and $a$ axes of the 77 cylinder cross section. (When $\theta = \phi = 0$ these are parallel to the $Y$ and $X$ axes of the instrument.) 78 The third orientation distribution, in $\psi$, is about the $c$ axis of the particle. Some experimentation may be required to 79 understand the 2d patterns fully. (Earlier implementations had numerical integration issues in some circumstances when orientation 80 distributions passed through 90 degrees, such situations, with very broad distributions, should still be approached with care.) 81 81 82 82 NB: The 2nd virial coefficient of the cylinder is calculated based on the … … 110 110 111 111 * **Author:** 112 * **Last Modified by:** 112 * **Last Modified by:** 113 113 * **Last Reviewed by:** Richard Heenan - corrected equation in docs **Date:** December 21, 2016 114 114 … … 156 156 + (length + radius) * (length + pi * radius)) 157 157 return 0.5 * (ddd) ** (1. / 3.) 158 159 def random(): 160 import numpy as np 161 # V = pi * radius_major * radius_minor * length; 162 V = 10**np.random.uniform(3, 9) 163 length = 10**np.random.uniform(1, 3) 164 axis_ratio = 10**(4*np.random.uniform(-2, 2) 165 radius_minor = np.sqrt(V/length/axis_ratio) 166 Vf = 10**np.random.uniform(-4, -2) 167 pars = dict( 168 #background=0, sld=0, sld_solvent=1, 169 scale=1e9*Vf/V, 170 length=length, 171 radius_minor=radius_minor, 172 axis_ratio=axis_ratio, 173 ) 174 return pars 175 158 176 q = 0.1 159 177 # april 6 2017, rkh added a 2d unit test, NOT READY YET pull #890 branch assume correct!
Note: See TracChangeset
for help on using the changeset viewer.