1 | r""" |
---|
2 | Definition |
---|
3 | ---------- |
---|
4 | |
---|
5 | The form factor for this bent disc is essentially that of a hyperbolic |
---|
6 | paraboloid and calculated as |
---|
7 | |
---|
8 | .. math:: |
---|
9 | |
---|
10 | P(q) = (\Delta \rho )^2 V \int^{\pi/2}_0 d\psi \sin{\psi} sinc^2 |
---|
11 | \left( \frac{qd\cos{\psi}}{2} \right) |
---|
12 | \left[ \left( S^2_0+C^2_0\right) + 2\sum_{n=1}^{\infty} |
---|
13 | \left( S^2_n+C^2_n\right) \right] |
---|
14 | |
---|
15 | where |
---|
16 | |
---|
17 | .. math:: |
---|
18 | |
---|
19 | C_n = \frac{1}{r^2}\int^{R}_{0} r dr\cos(qr^2\alpha \cos{\psi}) |
---|
20 | J_n\left( qr^2\beta \cos{\psi}\right) |
---|
21 | J_{2n}\left( qr \sin{\psi}\right) |
---|
22 | |
---|
23 | .. math:: |
---|
24 | |
---|
25 | S_n = \frac{1}{r^2}\int^{R}_{0} r dr\sin(qr^2\alpha \cos{\psi}) |
---|
26 | J_n\left( qr^2\beta \cos{\psi}\right) |
---|
27 | J_{2n}\left( qr \sin{\psi}\right) |
---|
28 | |
---|
29 | and $\Delta \rho \text{ is } \rho_{pringle}-\rho_{solvent}$, $V$ is the volume of |
---|
30 | the disc, $\psi$ is the angle between the normal to the disc and the q vector, |
---|
31 | $d$ and $R$ are the "pringle" thickness and radius respectively, $\alpha$ and |
---|
32 | $\beta$ are the two curvature parameters, and $J_n$ is the n\ :sup:`th` order |
---|
33 | Bessel function of the first kind. |
---|
34 | |
---|
35 | .. figure:: img/pringles_fig1.png |
---|
36 | |
---|
37 | Schematic of model shape (Graphic from Matt Henderson, matt@matthen.com) |
---|
38 | |
---|
39 | Reference |
---|
40 | --------- |
---|
41 | |
---|
42 | .. [#] Karen Edler, Universtiy of Bath, Private Communication. 2012. Derivation by Stefan Alexandru Rautu. |
---|
43 | .. [#] L. Onsager, *Ann. New York Acad. Sci.*, 51 (1949) 627-659 |
---|
44 | |
---|
45 | Source |
---|
46 | ------ |
---|
47 | |
---|
48 | `pringle.py <https://github.com/SasView/sasmodels/blob/master/sasmodels/models/pringle.py>`_ |
---|
49 | |
---|
50 | `pringle.c <https://github.com/SasView/sasmodels/blob/master/sasmodels/models/pringle.c>`_ |
---|
51 | |
---|
52 | Authorship and Verification |
---|
53 | ---------------------------- |
---|
54 | |
---|
55 | * **Author:** Andrew Jackson **Date:** 2008 |
---|
56 | * **Last Modified by:** Wojciech Wpotrzebowski **Date:** March 20, 2016 |
---|
57 | * **Last Reviewed by:** Andrew Jackson **Date:** September 26, 2016 |
---|
58 | * **Source added by :** Steve King **Date:** March 25, 2019 |
---|
59 | """ |
---|
60 | |
---|
61 | import numpy as np |
---|
62 | from numpy import inf |
---|
63 | |
---|
64 | name = "pringle" |
---|
65 | title = "The Pringle model provides the form factor, $P(q)$, for a 'pringle' \ |
---|
66 | or 'saddle-shaped' disc that is bent in two directions." |
---|
67 | description = """\ |
---|
68 | |
---|
69 | """ |
---|
70 | category = "shape:cylinder" |
---|
71 | |
---|
72 | # pylint: disable=bad-whitespace, line-too-long |
---|
73 | # ["name", "units", default, [lower, upper], "type","description"], |
---|
74 | parameters = [ |
---|
75 | ["radius", "Ang", 60.0, [0, inf], "volume", "Pringle radius"], |
---|
76 | ["thickness", "Ang", 10.0, [0, inf], "volume", "Thickness of pringle"], |
---|
77 | ["alpha", "", 0.001, [-inf, inf], "volume", "Curvature parameter alpha"], |
---|
78 | ["beta", "", 0.02, [-inf, inf], "volume", "Curvature paramter beta"], |
---|
79 | ["sld", "1e-6/Ang^2", 1.0, [-inf, inf], "sld", "Pringle sld"], |
---|
80 | ["sld_solvent", "1e-6/Ang^2", 6.3, [-inf, inf], "sld", "Solvent sld"] |
---|
81 | ] |
---|
82 | # pylint: enable=bad-whitespace, line-too-long |
---|
83 | |
---|
84 | |
---|
85 | source = ["lib/polevl.c", "lib/sas_J0.c", "lib/sas_J1.c", |
---|
86 | "lib/sas_JN.c", "lib/gauss76.c", "pringle.c"] |
---|
87 | effective_radius_type = [ |
---|
88 | "equivalent cylinder excluded volume", |
---|
89 | "equivalent volume sphere", |
---|
90 | "radius"] |
---|
91 | |
---|
92 | def random(): |
---|
93 | """Return a random parameter set for the model.""" |
---|
94 | alpha, beta = 10**np.random.uniform(-1, 1, size=2) |
---|
95 | radius = 10**np.random.uniform(1, 3) |
---|
96 | thickness = 10**np.random.uniform(0.7, 2) |
---|
97 | pars = dict( |
---|
98 | radius=radius, |
---|
99 | thickness=thickness, |
---|
100 | alpha=alpha, |
---|
101 | beta=beta, |
---|
102 | ) |
---|
103 | return pars |
---|
104 | |
---|
105 | tests = [ |
---|
106 | [{'scale' : 1.0, |
---|
107 | 'radius': 60.0, |
---|
108 | 'thickness': 10.0, |
---|
109 | 'alpha': 0.001, |
---|
110 | 'beta': 0.02, |
---|
111 | 'sld': 1.0, |
---|
112 | 'sld_solvent': 6.3, |
---|
113 | 'background': 0.001, |
---|
114 | }, 0.1, 9.87676], |
---|
115 | |
---|
116 | [{'scale' : 1.0, |
---|
117 | 'radius': 60.0, |
---|
118 | 'thickness': 10.0, |
---|
119 | 'alpha': 0.001, |
---|
120 | 'beta': 0.02, |
---|
121 | 'sld': 1.0, |
---|
122 | 'sld_solvent': 6.3, |
---|
123 | 'background': 0.001, |
---|
124 | }, 0.01, 290.56723], |
---|
125 | |
---|
126 | [{'scale' : 1.0, |
---|
127 | 'radius': 60.0, |
---|
128 | 'thickness': 10.0, |
---|
129 | 'alpha': 0.001, |
---|
130 | 'beta': 0.02, |
---|
131 | 'sld': 1.0, |
---|
132 | 'sld_solvent': 6.3, |
---|
133 | 'background': 0.001, |
---|
134 | }, 0.001, 317.40847], |
---|
135 | ] |
---|