source: sasmodels/sasmodels/models/hollow_cylinder.py @ d138d43

core_shell_microgelscostrafo411magnetic_modelrelease_v0.94release_v0.95ticket-1257-vesicle-productticket_1156ticket_1265_superballticket_822_more_unit_tests
Last change on this file since d138d43 was d138d43, checked in by Paul Kienzle <pkienzle@…>, 8 years ago

remove documentation build errors

  • Property mode set to 100644
File size: 4.1 KB
Line 
1r"""
2This model provides the form factor, $P(q)$, for a monodisperse hollow right
3angle circular cylinder (tube) where the form factor is normalized by the
4volume of the tube
5
6.. math::
7
8    P(q) = \text{scale} \langle F^2 \rangle/V_\text{shell} + \text{background}
9
10where the averaging $\langle \rangle$ is applied only for the 1D calculation.
11
12The inside and outside of the hollow cylinder are assumed have the same SLD.
13
14Definition
15----------
16
17The 1D scattering intensity is calculated in the following way (Guinier, 1955)
18
19.. math::
20
21    \begin{eqnarray}
22    P(q)           &=& (\text{scale})V_\text{shell}\Delta\rho^2
23            \int_0^{1}\Psi^2
24            \left[q_z, R_\text{shell}(1-x^2)^{1/2},
25                       R_\text{core}(1-x^2)^{1/2}\right]
26            \left[\frac{\sin(qHx)}{qHx}\right]^2 dx \\
27    \Psi[q,y,z]    &=& \frac{1}{1-\gamma^2}
28            \left[ \Lambda(qy) - \gamma^2\Lambda(qz) \right] \\
29    \Lambda(a)     &=& 2 J_1(a) / a \\
30    \gamma         &=& R_\text{core} / R_\text{shell} \\
31    V_\text{shell} &=& \pi \left(R_\text{shell}^2 - R_\text{core}^2 \right)L \\
32    J_1(x)         &=& \frac{(\sin(x)-x\cdot \cos(x))}{x^2} \\
33    \end{eqnarray}
34
35where *scale* is a scale factor and $J_1$ is the 1st order
36Bessel function.
37
38To provide easy access to the orientation of the core-shell cylinder, we define
39the axis of the cylinder using two angles $\theta$ and $\phi$. As for the case
40of the cylinder, those angles are defined in Figure 2 of the CylinderModel.
41
42**NB**: The 2nd virial coefficient of the cylinder is calculated
43based on the radius and 2 length values, and used as the effective radius
44for $S(Q)$ when $P(Q) * S(Q)$ is applied.
45
46In the parameters, the contrast represents SLD :sub:`shell` - SLD :sub:`solvent`
47and the *radius* is $R_\text{shell}$ while *core_radius* is $R_\text{core}$.
48
49.. figure:: img/hollow_cylinder_1d.jpg
50
51    1D plot using the default values (w/1000 data point).
52
53.. figure:: img/orientation.jpg
54
55    Definition of the angles for the oriented hollow_cylinder model.
56
57.. figure:: img/orientation2.jpg
58
59    Examples of the angles for oriented pp against the detector plane.
60
61Reference
62---------
63
64L A Feigin and D I Svergun, *Structure Analysis by Small-Angle X-Ray and
65Neutron Scattering*, Plenum Press, New York, (1987)
66"""
67
68from numpy import inf
69
70name = "hollow_cylinder"
71title = ""
72description = """
73P(q) = scale*<f*f>/Vol + background, where f is the scattering amplitude.
74core_radius = the radius of core
75radius = the radius of shell
76length = the total length of the cylinder
77sld = SLD of the shell
78solvent_sld = SLD of the solvent
79background = incoherent background
80"""
81category = "shape:cylinder"
82
83#             ["name", "units", default, [lower, upper], "type","description"],
84parameters = [
85              ["radius", "Ang", 30.0, [0, inf], "volume", "Cylinder radius"],
86              ["core_radius", "Ang", 20.0, [0, inf], "volume", "Hollow core radius"],
87              ["length", "Ang", 400.0, [0, inf], "volume", "Cylinder length"],
88              ["sld", "1/Ang^2", 6.3, [-inf, inf], "", "Cylinder sld"],
89              ["solvent_sld", "1/Ang^2", 1, [-inf, inf], "", "Solvent sld"],
90              ["theta", "[deg]", 90, [-360, 360], "orientation", "Theta angle"],
91              ["phi", "[deg]", 0, [-360, 360], "orientation", "Phi angle"],
92              ]
93
94source = ["lib/J1.c", "lib/gauss76.c", "hollow_cylinder.c"]
95
96# parameters for demo
97demo = dict(scale=1.0,background=0.0,length=400.0,radius=30.0,core_radius=20.0,
98            sld=6.3,solvent_sld=1,theta=90,phi=0,
99            radius_pd=.2, radius_pd_n=9,
100            length_pd=.2, length_pd_n=10,
101            theta_pd=10, theta_pd_n=5,
102            )
103
104# For testing against the old sasview models, include the converted parameter
105# names and the target sasview model name.
106oldname = 'HollowCylinderModel'
107oldpars = dict(scale='scale',background='background',radius='radius',
108               core_radius='core_radius',sld='sldCyl',length='length',
109               solvent_sld='sldSolv',phi='axis_phi',theta='axis_theta')
110
111# Parameters for unit tests
112tests = [
113         [{"radius" : 30.0},0.00005,1764.926]
114         ]
Note: See TracBrowser for help on using the repository browser.