[577912b] | 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_fig1.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 | .. figure:: img/linear_pearls_1d.jpg |
---|
| 29 | |
---|
| 30 | 1D plot using the default values (w/500 data point). |
---|
| 31 | |
---|
| 32 | References |
---|
| 33 | ---------- |
---|
| 34 | |
---|
| 35 | A V Dobrynin, M Rubinstein and S P Obukhov, *Macromol.*, |
---|
| 36 | 29 (1996) 2974-2979 |
---|
| 37 | |
---|
| 38 | """ |
---|
| 39 | |
---|
| 40 | from numpy import inf |
---|
| 41 | |
---|
| 42 | name = "linear_pearls" |
---|
| 43 | title = "Linear pearls model of scattering from spherical pearls." |
---|
| 44 | description = """ |
---|
| 45 | Calculate form factor for Pearl Necklace Model |
---|
| 46 | [Macromol. 1996, 29, 2974-2979] |
---|
| 47 | Parameters: |
---|
| 48 | |
---|
| 49 | sld_pearl: the SLD of the pearl spheres |
---|
| 50 | sld_solv: the SLD of the solvent |
---|
| 51 | num_pearls: number of the pearls |
---|
| 52 | radius: the radius of a pearl |
---|
| 53 | edge_separation: the length of string segment; surface to surface |
---|
| 54 | """ |
---|
| 55 | category = "shape:sphere" |
---|
| 56 | |
---|
| 57 | # pylint: disable=bad-whitespace, line-too-long |
---|
| 58 | # ["name", "units", default, [lower, upper], "type", "description"], |
---|
| 59 | parameters = [ |
---|
| 60 | ["radius", "Ang", 80.0, [0, inf], "", "Radius of the pearls"], |
---|
| 61 | ["edge_sep", "Ang", 350.0, [0, inf], "", "Length of the string segment - surface to surface"], |
---|
| 62 | ["num_pearls", "", 3.0, [0, inf], "", "Number of the pearls"], |
---|
| 63 | ["pearl_sld", "1e-6/Ang^2", 1.0, [-inf, inf], "", "SLD of the pearl spheres"], |
---|
| 64 | ["solvent_sld", "1e-6/Ang^2", 6.3, [-inf, inf], "", "SLD of the solvent"], |
---|
| 65 | ] |
---|
| 66 | # pylint: enable=bad-whitespace, line-too-long |
---|
| 67 | |
---|
| 68 | source = ["linear_pearls.c"] |
---|
| 69 | |
---|
| 70 | demo = dict(scale=1.0, background=0.0, |
---|
| 71 | radius=80.0, |
---|
| 72 | edge_sep=350.0, |
---|
| 73 | num_pearls=3, |
---|
| 74 | pearl_sld=1.0, |
---|
| 75 | solvent_sld=6.3) |
---|
| 76 | |
---|
| 77 | oldname = "LinearPearlsModel" |
---|
| 78 | |
---|
| 79 | oldpars = dict(edge_sep='edge_separation', |
---|
| 80 | pearl_sld='sld_pearl', |
---|
| 81 | solvent_sld='sld_solv') |
---|
| 82 | |
---|
| 83 | """ |
---|
| 84 | Tests temporarily disabled, until single-double precision accuracy issue solved. |
---|
| 85 | |
---|
| 86 | tests = [ |
---|
| 87 | # Accuracy tests based on content in test/utest_model_pearlnecklace.py |
---|
| 88 | [{'radius': 20.0, |
---|
| 89 | 'num_pearls': 2.0, |
---|
| 90 | 'pearl_sld': 1.0, |
---|
| 91 | 'solvent_sld': 6.3, |
---|
| 92 | 'edge_sep': 400.0, |
---|
| 93 | }, 0.001, 185.135], |
---|
| 94 | |
---|
| 95 | # Additional tests with larger range of parameters |
---|
| 96 | [{'radius': 120.0, |
---|
| 97 | 'num_pearls': 5.0, |
---|
| 98 | 'pearl_sld': 2.0, |
---|
| 99 | 'solvent_sld': 2.3, |
---|
| 100 | 'edge_sep': 100.0, |
---|
| 101 | }, 0.01, 45.4984], |
---|
| 102 | |
---|
| 103 | [{'radius': 7.0, |
---|
| 104 | 'num_pearls': 2.0, |
---|
| 105 | 'pearl_sld': 10.0, |
---|
| 106 | 'solvent_sld': 99.3, |
---|
| 107 | 'edge_sep': 20.0, |
---|
| 108 | }, 1.0, 0.632811], |
---|
| 109 | ] |
---|
[32c743d] | 110 | """ |
---|