Changeset 19dcb933 in sasmodels for sasmodels/models/cylinder.py
- Timestamp:
- Sep 3, 2014 3:16:10 AM (10 years ago)
- Branches:
- master, core_shell_microgels, costrafo411, magnetic_model, release_v0.94, release_v0.95, ticket-1257-vesicle-product, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
- Children:
- 1c7ffdc
- Parents:
- 87985ca
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sasmodels/models/cylinder.py
r5d4777d r19dcb933 14 14 .. math:: 15 15 16 P( q,\alpha) = \frac{\text{scale}}{V}f^2(q) + \text{bkg}16 P(Q,\alpha) = {\text{scale} \over V} F^2(Q) + \text{background} 17 17 18 18 where … … 20 20 .. math:: 21 21 22 f(q) = 2 (\Delta \rho) V 23 \frac{\sin (q L/2 \cos \alpha)}{q L/2 \cos \alpha} 24 \frac{J_1 (q r \sin \alpha)}{q r \sin \alpha} 22 F(Q) = 2 (\Delta \rho) V 23 {\sin \left(Q\tfrac12 L\cos\alpha \right) 24 \over Q\tfrac12 L \cos \alpha} 25 {J_1 \left(Q R \sin \alpha\right) \over Q R \sin \alpha} 25 26 26 27 and $\alpha$ is the angle between the axis of the cylinder and $\vec q$, $V$ 27 is the volume of the cylinder, $L$ is the length of the cylinder, $ r$ is the28 radius of the cylinder, and $ d\rho$ (contrast) is the scattering length density29 d ifference between the scatterer and the solvent. $J_1$ is the first order30 Bessel function.28 is the volume of the cylinder, $L$ is the length of the cylinder, $R$ is the 29 radius of the cylinder, and $\Delta\rho$ (contrast) is the scattering length 30 density difference between the scatterer and the solvent. $J_1$ is the 31 first order Bessel function. 31 32 32 33 To provide easy access to the orientation of the cylinder, we define the 33 34 axis of the cylinder using two angles $\theta$ and $\phi$. Those angles 34 are defined in Figure:num:`figure #cylinder-orientation`.35 are defined in :num:`figure #cylinder-orientation`. 35 36 36 37 .. _cylinder-orientation: 37 38 38 .. figure:: img/ image061.JPG (should be img/cylinder-1.jpg, or img/cylinder-orientation.jpg)39 .. figure:: img/orientation.jpg 39 40 40 41 Definition of the angles for oriented cylinders. 41 42 42 .. figure:: img/ image062.JPG43 .. figure:: img/orientation2.jpg 43 44 44 45 Examples of the angles for oriented pp against the detector plane. … … 53 54 .. math:: 54 55 55 P( q) = \frac{\text{scale}}{V}56 \int_0^{\pi/2} f^2(q,\alpha) \sin \alphad\alpha + \text{background}56 P(Q) = {\text{scale} \over V} 57 \int_0^{\pi/2} F^2(Q,\alpha) \sin \alpha\ d\alpha + \text{background} 57 58 58 59 The *theta* and *phi* parameters are not used for the 1D output. Our … … 65 66 Validation of our code was done by comparing the output of the 1D model 66 67 to the output of the software provided by the NIST (Kline, 2006). 67 Figure :num:`figure #cylinder-compare` shows a comparison of68 :num:`Figure #cylinder-compare` shows a comparison of 68 69 the 1D output of our model and the output of the NIST software. 69 70 70 71 .. _cylinder-compare: 71 72 72 .. figure:: img/ image065.JPG73 .. figure:: img/cylinder_compare.jpg 73 74 74 75 Comparison of the SasView scattering intensity for a cylinder with the 75 76 output of the NIST SANS analysis software. 76 The parameters were set to: * Scale* = 1.0, *Radius* = 20 |Ang|,77 * Length* = 400 |Ang|, *Contrast* = 3e-6 |Ang^-2|, and78 * Background* = 0.01 |cm^-1|.77 The parameters were set to: *scale* = 1.0, *radius* = 20 |Ang|, 78 *length* = 400 |Ang|, *contrast* = 3e-6 |Ang^-2|, and 79 *background* = 0.01 |cm^-1|. 79 80 80 81 In general, averaging over a distribution of orientations is done by … … 83 84 .. math:: 84 85 85 P( q) = \int_0^{\pi/2} d\phi86 \int_0^\pi p(\theta, \phi) P_0( q,\alpha) \sin \thetad\theta86 P(Q) = \int_0^{\pi/2} d\phi 87 \int_0^\pi p(\theta, \phi) P_0(Q,\alpha) \sin \theta\ d\theta 87 88 88 89 89 90 where $p(\theta,\phi)$ is the probability distribution for the orientation 90 and $P_0( q,\alpha)$ is the scattering intensity for the fully oriented91 and $P_0(Q,\alpha)$ is the scattering intensity for the fully oriented 91 92 system. Since we have no other software to compare the implementation of 92 93 the intensity for fully oriented cylinders, we can compare the result of 93 94 averaging our 2D output using a uniform distribution $p(\theta, \phi) = 1.0$. 94 Figure :num:`figure #cylinder-crosscheck` shows the result of95 :num:`Figure #cylinder-crosscheck` shows the result of 95 96 such a cross-check. 96 97 97 98 .. _cylinder-crosscheck: 98 99 99 .. figure:: img/ image066.JPG100 .. figure:: img/cylinder_crosscheck.jpg 100 101 101 102 Comparison of the intensity for uniformly distributed cylinders 102 103 calculated from our 2D model and the intensity from the NIST SANS 103 104 analysis software. 104 The parameters used were: * Scale* = 1.0, *Radius* = 20 |Ang|,105 * Length* = 400 |Ang|, *Contrast* = 3e-6 |Ang^-2|, and106 * Background* = 0.0 |cm^-1|.105 The parameters used were: *scale* = 1.0, *radius* = 20 |Ang|, 106 *length* = 400 |Ang|, *contrast* = 3e-6 |Ang^-2|, and 107 *background* = 0.0 |cm^-1|. 107 108 """ 108 109
Note: See TracChangeset
for help on using the changeset viewer.