Changeset eb69cce in sasmodels for sasmodels/models/capped_cylinder.py
- Timestamp:
- Nov 30, 2015 7:18:41 PM (8 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:
- d18f8a8
- Parents:
- d138d43
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sasmodels/models/capped_cylinder.py
r485aee2 reb69cce 1 1 r""" 2 2 Calculates the scattering from a cylinder with spherical section end-caps. 3 This model simply becomes the a convex lens when the length of the cylinder 4 $L=0$, that is, a sphereocylinder with end caps that have a radius larger 5 than that of the cylinder and the center of the end cap radius lies within 6 the cylinder. See the diagram for the details of the geometry and 7 restrictions on parameter values.3 Like :ref:`barbell`, this is a sphereocylinder with end caps that have a 4 radius larger than that of the cylinder, but with the center of the end cap 5 radius lying within the cylinder. This model simply becomes the a convex 6 lens when the length of the cylinder $L=0$. See the diagram for the details 7 of the geometry and restrictions on parameter values. 8 8 9 9 Definitions 10 10 ----------- 11 11 12 The returned value is scaled to units of |cm^-1|\ |sr^-1|, absolute scale. 12 .. figure:: img/capped_cylinder_geometry.jpg 13 13 14 The capped cylinder geometry is defined as 14 Capped cylinder geometry, where $r$ is *radius*, $R$ is *bell_radius* and 15 $L$ is *length*. Since the end cap radius $R \geq r$ and by definition 16 for this geometry $h < 0$, $h$ is then defined by $r$ and $R$ as 17 $h = - \sqrt{R^2 - r^2}$ 15 18 16 .. image:: img/capped_cylinder_geometry.jpg 17 18 where $r$ is the radius of the cylinder. All other parameters are as defined 19 in the diagram. Since the end cap radius $R \ge r$ and by definition for this 20 geometry $h < 0$, $h$ is then defined by $r$ and $R$ as 19 The scattered intensity $I(q)$ is calculated as 21 20 22 21 .. math:: 23 22 24 h = - \sqrt{R^2 - r^2}23 I(q) = \frac{\Delta \rho^2}{V} \left<A^2(q)\right> 25 24 26 The scattered intensity $I(Q)$ is calculatedas25 where the amplitude $A(q)$ is given as 27 26 28 27 .. math:: 29 28 30 I(Q) = \frac{(\Delta \rho)^2}{V} \left< A^2(Q)\right> 31 32 where the amplitude $A(Q)$ is given as 33 34 .. math:: 35 36 A(Q) =&\ \pi r^2L 37 {\sin\left(\tfrac12 QL\cos\theta\right) 38 \over \tfrac12 QL\cos\theta} 39 {2 J_1(Qr\sin\theta) \over Qr\sin\theta} \\ 29 A(q) =&\ \pi r^2L 30 \frac{\sin\left(\tfrac12 qL\cos\theta\right)} 31 {\tfrac12 qL\cos\theta} 32 \frac{2 J_1(qr\sin\theta)}{qr\sin\theta} \\ 40 33 &\ + 4 \pi R^3 \int_{-h/R}^1 dt 41 \cos\left[ Q\cos\theta34 \cos\left[ q\cos\theta 42 35 \left(Rt + h + {\tfrac12} L\right)\right] 43 36 \times (1-t^2) 44 {J_1\left[QR\sin\theta \left(1-t^2\right)^{1/2}\right]45 \over QR\sin\theta \left(1-t^2\right)^{1/2}}37 \frac{J_1\left[qR\sin\theta \left(1-t^2\right)^{1/2}\right]} 38 {qR\sin\theta \left(1-t^2\right)^{1/2}} 46 39 47 The $\left< \ldots\right>$ brackets denote an average of the structure over48 all orientations. $\left< A^2( Q)\right>$ is then the form factor, $P(Q)$.40 The $\left<\ldots\right>$ brackets denote an average of the structure over 41 all orientations. $\left< A^2(q)\right>$ is then the form factor, $P(q)$. 49 42 The scale factor is equivalent to the volume fraction of cylinders, each of 50 volume, $V$. Contrast is the difference of scattering length densities of51 the cylinder and the surrounding solvent.43 volume, $V$. Contrast $\Delta\rho$ is the difference of scattering length 44 densities of the cylinder and the surrounding solvent. 52 45 53 46 The volume of the capped cylinder is (with $h$ as a positive value here) … … 58 51 59 52 60 and its radius -of-gyration is53 and its radius of gyration is 61 54 62 55 .. math:: … … 73 66 .. note:: 74 67 75 The requirement that $R \ge r$ is not enforced in the model!68 The requirement that $R \geq r$ is not enforced in the model! 76 69 It is up to you to restrict this during analysis. 77 70 … … 104 97 Examples of the angles for oriented pp against the detector plane. 105 98 106 REFERENCE 99 References 100 ---------- 107 101 108 102 H Kaya, *J. Appl. Cryst.*, 37 (2004) 223-230
Note: See TracChangeset
for help on using the changeset viewer.