1 | r""" |
---|
2 | This model provides the form factor for $N$ spherical pearls of radius $R$ |
---|
3 | linearly joined by short strings (or segment length or edge separation) |
---|
4 | $l$ $(= A - 2R)$. $A$ is the center-to-center pearl separation distance. |
---|
5 | The thickness of each string is assumed to be negligible. |
---|
6 | |
---|
7 | .. figure:: img/linear_pearls_geometry.jpg |
---|
8 | |
---|
9 | |
---|
10 | Definition |
---|
11 | ---------- |
---|
12 | |
---|
13 | The output of the scattering intensity function for the linear_pearls model |
---|
14 | is given by (Dobrynin, 1996) |
---|
15 | |
---|
16 | .. math:: |
---|
17 | |
---|
18 | P(Q) = \frac{scale}{V}\left[ m_{p}^2 |
---|
19 | \left(N+2\sum_{n-1}^{N-1}(N-n)\frac{sin(qnl)}{qnl}\right) |
---|
20 | \left( 3\frac{sin(qR)-qRcos(qR)}{(qr)^3}\right)^2\right] |
---|
21 | |
---|
22 | where the mass $m_p$ is $(SLD_{pearl}-SLD_{solvent})*(volume\ of\ N\ pearls)$. |
---|
23 | V is the total volume. |
---|
24 | |
---|
25 | The 2D scattering intensity is the same as P(q) above, |
---|
26 | regardless of the orientation of the q vector. |
---|
27 | |
---|
28 | References |
---|
29 | ---------- |
---|
30 | |
---|
31 | A V Dobrynin, M Rubinstein and S P Obukhov, *Macromol.*, |
---|
32 | 29 (1996) 2974-2979 |
---|
33 | |
---|
34 | """ |
---|
35 | |
---|
36 | from numpy import inf |
---|
37 | |
---|
38 | name = "linear_pearls" |
---|
39 | title = "Linear pearls model of scattering from spherical pearls." |
---|
40 | description = """ |
---|
41 | Calculate form factor for Pearl Necklace Model |
---|
42 | [Macromol. 1996, 29, 2974-2979] |
---|
43 | Parameters: |
---|
44 | |
---|
45 | sld_pearl: the SLD of the pearl spheres |
---|
46 | sld_solv: the SLD of the solvent |
---|
47 | num_pearls: number of the pearls |
---|
48 | radius: the radius of a pearl |
---|
49 | edge_separation: the length of string segment; surface to surface |
---|
50 | """ |
---|
51 | category = "shape:sphere" |
---|
52 | |
---|
53 | # pylint: disable=bad-whitespace, line-too-long |
---|
54 | # ["name", "units", default, [lower, upper], "type", "description"], |
---|
55 | parameters = [ |
---|
56 | ["radius", "Ang", 80.0, [0, inf], "", "Radius of the pearls"], |
---|
57 | ["edge_sep", "Ang", 350.0, [0, inf], "", "Length of the string segment - surface to surface"], |
---|
58 | ["num_pearls", "", 3.0, [0, inf], "", "Number of the pearls"], |
---|
59 | ["sld", "1e-6/Ang^2", 1.0, [-inf, inf], "sld", "SLD of the pearl spheres"], |
---|
60 | ["sld_solvent", "1e-6/Ang^2", 6.3, [-inf, inf], "sld", "SLD of the solvent"], |
---|
61 | ] |
---|
62 | # pylint: enable=bad-whitespace, line-too-long |
---|
63 | single = False |
---|
64 | |
---|
65 | source = ["lib/sas_3j1x_x.c", "linear_pearls.c"] |
---|
66 | |
---|
67 | demo = dict(scale=1.0, background=0.0, |
---|
68 | radius=80.0, |
---|
69 | edge_sep=350.0, |
---|
70 | num_pearls=3, |
---|
71 | sld=1.0, |
---|
72 | sld_solvent=6.3) |
---|
73 | |
---|
74 | """ |
---|
75 | Tests temporarily disabled, until single-double precision accuracy issue solved. |
---|
76 | |
---|
77 | tests = [ |
---|
78 | # Accuracy tests based on content in test/utest_model_pearlnecklace.py |
---|
79 | [{'radius': 20.0, |
---|
80 | 'num_pearls': 2.0, |
---|
81 | 'sld': 1.0, |
---|
82 | 'sld_solvent': 6.3, |
---|
83 | 'edge_sep': 400.0, |
---|
84 | }, 0.001, 185.135], |
---|
85 | |
---|
86 | # Additional tests with larger range of parameters |
---|
87 | [{'radius': 120.0, |
---|
88 | 'num_pearls': 5.0, |
---|
89 | 'sld': 2.0, |
---|
90 | 'sld_solvent': 2.3, |
---|
91 | 'edge_sep': 100.0, |
---|
92 | }, 0.01, 45.4984], |
---|
93 | |
---|
94 | [{'radius': 7.0, |
---|
95 | 'num_pearls': 2.0, |
---|
96 | 'sld': 10.0, |
---|
97 | 'sld_solvent': 99.3, |
---|
98 | 'edge_sep': 20.0, |
---|
99 | }, 1.0, 0.632811], |
---|
100 | ] |
---|
101 | """ |
---|