1 | r""" |
---|
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. |
---|
8 | |
---|
9 | Definitions |
---|
10 | ----------- |
---|
11 | |
---|
12 | The returned value is scaled to units of |cm^-1|\ |sr^-1|, absolute scale. |
---|
13 | |
---|
14 | The capped cylinder geometry is defined as |
---|
15 | |
---|
16 | .. image:: img/image112.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 |
---|
21 | |
---|
22 | .. math:: |
---|
23 | |
---|
24 | h = - \sqrt{R^2 - r^2} |
---|
25 | |
---|
26 | The scattered intensity $I(q)$ is calculated as |
---|
27 | |
---|
28 | .. math:: |
---|
29 | |
---|
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 \frac{sin(Q(L/2) \cos \theta)}{Q(L/2) \cos \theta} \ |
---|
37 | \frac{2 J_1(Q r \sin \theta)}{Q r \sin \theta} \ |
---|
38 | + 4 \pi R^3 \int_{-h/R}^1{dt \cos [ Q cos\theta (Rt + h + L/2)] \ |
---|
39 | x (1-t^2)\frac{J_1[Q R \sin \theta (1-t^2)^{1/2}]}{Q R \sin \theta (1-t^2)^{1/2} |
---|
40 | |
---|
41 | The $\left< \ldots \right>$ brackets denote an average of the structure over |
---|
42 | all orientations. $\left< A^2(q)\right>$ is then the form factor, $P(q)$. |
---|
43 | The scale factor is equivalent to the volume fraction of cylinders, each of |
---|
44 | volume, $V$. Contrast is the difference of scattering length densities of |
---|
45 | the cylinder and the surrounding solvent. |
---|
46 | |
---|
47 | The volume of the capped cylinder is (with $h$ as a positive value here) |
---|
48 | |
---|
49 | .. math:: |
---|
50 | |
---|
51 | V = \pi r_c^2 L + \frac{2\pi}{3}(R-h)^2(2R + h) |
---|
52 | |
---|
53 | |
---|
54 | and its radius-of-gyration is |
---|
55 | |
---|
56 | R_g^2 = \left[ \frac{12}{5}R^5 + R^4(6h+\frac{3}{2}L) \ |
---|
57 | + R^2(4h^2 + L^2 + 4Lh) + R^2(3Lh^2 + [frac{3}{2}L^2h) \ |
---|
58 | + \frac{2}{5}h^5 - \frac{1}{2}Lh^4 - \frac{1}{2}L^2h^3 \ |
---|
59 | + \frac{1}{4}L^3r^2 + \frac{3}{2}Lr^4\right] \ |
---|
60 | (4R^3 6R^2h - 2h^3 + 3r^2L)^{-1} |
---|
61 | |
---|
62 | |
---|
63 | **The requirement that $R \ge r$ is not enforced in the model! It is up to |
---|
64 | you to restrict this during analysis.** |
---|
65 | |
---|
66 | Figure :num:`figure #capped-cylinder-1d` shows the output produced by |
---|
67 | a running the 1D capped cylinder model, using *qmin* = 0.001 |Ang^-1|, |
---|
68 | *qmax* = 0.7 |Ang^-1| and the default values of the parameters. |
---|
69 | |
---|
70 | .. _capped-cylinder-1d: |
---|
71 | |
---|
72 | .. figure:: img/image117.jpg |
---|
73 | |
---|
74 | 1D plot using the default values (w/256 data point). |
---|
75 | |
---|
76 | The 2D scattering intensity is calculated similar to the 2D cylinder model. |
---|
77 | Figure :num:`figure #capped-cylinder-2d` shows the output for $\theta=45^\circ$ |
---|
78 | and $\phi=0^\circ$ with default values for the other parameters. |
---|
79 | |
---|
80 | .. _capped-cylinder-2d: |
---|
81 | |
---|
82 | .. figure:: img/image118.JPG |
---|
83 | |
---|
84 | 2D plot (w/(256X265) data points). |
---|
85 | |
---|
86 | .. figure:: img/image061.JPG |
---|
87 | |
---|
88 | Definition of the angles for oriented 2D cylinders. |
---|
89 | |
---|
90 | .. figure:: img/image062.jpg |
---|
91 | |
---|
92 | Examples of the angles for oriented pp against the detector plane. |
---|
93 | |
---|
94 | REFERENCE |
---|
95 | |
---|
96 | H Kaya, *J. Appl. Cryst.*, 37 (2004) 223-230 |
---|
97 | |
---|
98 | H Kaya and N-R deSouza, *J. Appl. Cryst.*, 37 (2004) 508-509 (addenda and errata) |
---|
99 | """ |
---|
100 | from numpy import inf |
---|
101 | |
---|
102 | name = "capped_cylinder" |
---|
103 | title = "Right circular cylinder with spherical end caps and uniform SLD" |
---|
104 | description = """That is, a sphereocylinder |
---|
105 | with end caps that have a radius larger than |
---|
106 | that of the cylinder and the center of the |
---|
107 | end cap radius lies within the cylinder. |
---|
108 | Note: As the length of cylinder -->0, |
---|
109 | it becomes a ConvexLens. |
---|
110 | It must be that radius <(=) cap_radius. |
---|
111 | [Parameters]; |
---|
112 | scale: volume fraction of spheres, |
---|
113 | background:incoherent background, |
---|
114 | radius: radius of the cylinder, |
---|
115 | length: length of the cylinder, |
---|
116 | cap_radius: radius of the semi-spherical cap, |
---|
117 | sld: SLD of the capped cylinder, |
---|
118 | solvent_sld: SLD of the solvent. |
---|
119 | """ |
---|
120 | |
---|
121 | parameters = [ |
---|
122 | # [ "name", "units", default, [lower, upper], "type", |
---|
123 | # "description" ], |
---|
124 | [ "sld", "1e-6/Ang^2", 4, [-inf,inf], "", |
---|
125 | "Cylinder scattering length density" ], |
---|
126 | [ "solvent_sld", "1e-6/Ang^2", 1, [-inf,inf], "", |
---|
127 | "Solvent scattering length density" ], |
---|
128 | [ "radius", "Ang", 20, [0, inf], "volume", |
---|
129 | "Cylinder radius" ], |
---|
130 | # TODO: use an expression for cap radius with fixed bounds. |
---|
131 | # The current form requires cap radius R bigger than cylinder radius r. |
---|
132 | # Could instead use R/r in [1,inf], r/R in [0,1], or the angle between |
---|
133 | # cylinder and cap in [0,90]. The problem is similar for the barbell |
---|
134 | # model. Propose r/R in [0,1] in both cases, with the model specifying |
---|
135 | # cylinder radius in the capped cylinder model and sphere radius in the |
---|
136 | # barbell model. This leads to the natural value of zero for no cap |
---|
137 | # in the capped cylinder, and zero for no bar in the barbell model. In |
---|
138 | # both models, one would be a pill. |
---|
139 | [ "cap_radius", "Ang", 20, [0, inf], "volume", |
---|
140 | "Cap radius" ], |
---|
141 | [ "length", "Ang", 400, [0, inf], "volume", |
---|
142 | "Cylinder length" ], |
---|
143 | [ "theta", "degrees", 60, [-inf, inf], "orientation", |
---|
144 | "In plane angle" ], |
---|
145 | [ "phi", "degrees", 60, [-inf, inf], "orientation", |
---|
146 | "Out of plane angle" ], |
---|
147 | ] |
---|
148 | |
---|
149 | source = [ "lib/J1.c", "lib/gauss76.c", "capped_cylinder.c" ] |
---|
150 | |
---|
151 | |
---|
152 | |
---|