1 | r""" |
---|
2 | This model provides the form factor, $P(q)$, for a 'pringle' or 'saddle-shaped' |
---|
3 | object (a hyperbolic paraboloid). |
---|
4 | |
---|
5 | .. figure:: img/pringles_fig1.png |
---|
6 | |
---|
7 | (Graphic from Matt Henderson, matt@matthen.com) |
---|
8 | |
---|
9 | The returned value is in units of cm^-1, on absolute scale. |
---|
10 | |
---|
11 | Definition |
---|
12 | ---------- |
---|
13 | |
---|
14 | The form factor calculated is |
---|
15 | |
---|
16 | .. math:: |
---|
17 | |
---|
18 | I(q) = (\Delta \rho )^2 V \int^{\pi/2}_0 d\psi \sin{\psi} sinc^2 |
---|
19 | \left( \frac{qd\cos{\psi}}{2} \right) |
---|
20 | \left[ \left( S^2_0+C^2_0\right) + 2\sum_{n=1}^{\infty} |
---|
21 | \left( S^2_0+C^2_0\right) \right] |
---|
22 | |
---|
23 | where |
---|
24 | |
---|
25 | .. math:: |
---|
26 | |
---|
27 | C_n = \int^{R}_{0} r dr\cos{qr^2\alpha \cos{\psi}} |
---|
28 | J_n\left( qr^2\beta \cos{\psi}\right) |
---|
29 | J_{2n}\left( qr \sin{\psi}\right) |
---|
30 | |
---|
31 | .. math:: |
---|
32 | |
---|
33 | S_n = \int^{R}_{0} r dr\sin{qr^2\alpha \cos{\psi}} |
---|
34 | J_n\left( qr^2\beta \cos{\psi}\right) |
---|
35 | J_{2n}\left( qr \sin{\psi}\right) |
---|
36 | |
---|
37 | |
---|
38 | .. figure:: img/pringle-vs-cylinder.png |
---|
39 | |
---|
40 | 1D plot using the default values (with 150 data points). |
---|
41 | |
---|
42 | Reference |
---|
43 | --------- |
---|
44 | |
---|
45 | Stefan Alexandru Rautu, Private Communication. 2012. |
---|
46 | As of 2016: stefanar@ncbs.res.in |
---|
47 | |
---|
48 | """ |
---|
49 | |
---|
50 | from numpy import inf, pi |
---|
51 | |
---|
52 | name = "pringles" |
---|
53 | title = "Pringles model for K Edler. Represents a disc that is bent in two directions." |
---|
54 | description = """\ |
---|
55 | |
---|
56 | """ |
---|
57 | category = "shape:cylinder" |
---|
58 | |
---|
59 | # pylint: disable=bad-whitespace, line-too-long |
---|
60 | # ["name", "units", default, [lower, upper], "type","description"], |
---|
61 | parameters = [ |
---|
62 | ["radius", "Ang", 60.0, [0, inf], "volume", "Pringle radius"], |
---|
63 | ["thickness", "Ang", 10.0, [0, inf], "volume", "Thickness of pringle"], |
---|
64 | ["alpha", "", 0.001, [-inf, inf], "", "Curvature parameter alpha"], |
---|
65 | ["beta", "", 0.02, [-inf, inf], "", "Curvature paramter beta"], |
---|
66 | ["sld_pringle", "1e-6/Ang^2", 1.0, [-inf, inf], "", "Pringle sld"], |
---|
67 | ["sld_solvent", "1e-6/Ang^2", 6.3, [-inf, inf], "", "Solvent sld"] |
---|
68 | ] |
---|
69 | # pylint: enable=bad-whitespace, line-too-long |
---|
70 | |
---|
71 | source = ["lib/polevl.c", "lib/sas_J0.c", "lib/sas_J1.c", \ |
---|
72 | "lib/sas_JN.c", "lib/gauss76.c", "pringle.c"] |
---|
73 | |
---|
74 | def ER(radius, thickness): |
---|
75 | """ |
---|
76 | Return equivalent radius (ER) |
---|
77 | """ |
---|
78 | ddd = 0.75 * radius * (2 * radius * thickness + (thickness + radius) \ |
---|
79 | * (thickness + pi * radius)) |
---|
80 | return 0.5 * (ddd) ** (1. / 3.) |
---|
81 | |
---|
82 | demo = dict(background=0.0, |
---|
83 | scale=1.0, |
---|
84 | radius=60.0, |
---|
85 | thickness=10.0, |
---|
86 | alpha=0.001, |
---|
87 | beta=0.02, |
---|
88 | sld_pringle=1.0, |
---|
89 | sld_solvent=6.35) |
---|
90 | |
---|
91 | oldname = 'PringlesModel' |
---|
92 | oldpars = dict(background='background', |
---|
93 | scale='scale', |
---|
94 | radius='radius', |
---|
95 | thickness='thickness', |
---|
96 | alpha='alpha', |
---|
97 | beta='beta', |
---|
98 | pringle_sld='sld_pringle', |
---|
99 | solvent_sld='sld_solvent') |
---|
100 | |
---|
101 | tests = [ |
---|
102 | [{'scale' : 1.0, |
---|
103 | 'radius': 60.0, |
---|
104 | 'thickness': 10.0, |
---|
105 | 'alpha': 0.001, |
---|
106 | 'beta': 0.02, |
---|
107 | 'sld_pringle': 1.0, |
---|
108 | 'sld_solvent': 6.3, |
---|
109 | 'background': 6.3, |
---|
110 | }, 0.1, 16.185532], |
---|
111 | |
---|
112 | [{'scale' : 1.0, |
---|
113 | 'radius': 60.0, |
---|
114 | 'thickness': 10.0, |
---|
115 | 'alpha': 0.001, |
---|
116 | 'beta': 0.02, |
---|
117 | 'sld_pringle': 1.0, |
---|
118 | 'sld_solvent': 6.3, |
---|
119 | 'background': 6.3, |
---|
120 | }, 0.01, 297.153496], |
---|
121 | |
---|
122 | [{'scale' : 1.0, |
---|
123 | 'radius': 60.0, |
---|
124 | 'thickness': 10.0, |
---|
125 | 'alpha': 0.001, |
---|
126 | 'beta': 0.02, |
---|
127 | 'sld_pringle': 1.0, |
---|
128 | 'sld_solvent': 6.3, |
---|
129 | 'background': 6.3, |
---|
130 | }, 0.001, 324.021256415], |
---|
131 | |
---|
132 | [{'scale' : 1.0, |
---|
133 | 'radius': 60.0, |
---|
134 | 'thickness': 10.0, |
---|
135 | 'alpha': 0.001, |
---|
136 | 'beta': 0.02, |
---|
137 | 'sld_pringle': 1.0, |
---|
138 | 'sld_solvent': 6.3, |
---|
139 | 'background': 6.3, |
---|
140 | }, (0.001, 90.0), 6.30000026876], |
---|
141 | ] |
---|