[cf404cb] | 1 | r""" |
---|
[841753c] | 2 | This model provides the form factor for a pearl necklace composed of two |
---|
| 3 | elements: *N* pearls (homogeneous spheres of radius *R*) freely jointed by *M* |
---|
[cf404cb] | 4 | rods (like strings - with a total mass *Mw* = *M* \* *m*\ :sub:`r` + *N* \* *m*\ |
---|
[841753c] | 5 | :sub:`s`, and the string segment length (or edge separation) *l* |
---|
[cf404cb] | 6 | (= *A* - 2\ *R*)). *A* is the center-to-center pearl separation distance. |
---|
| 7 | |
---|
| 8 | .. figure:: img/pearl_fig.jpg |
---|
| 9 | |
---|
| 10 | Pearl Necklace schematic |
---|
| 11 | |
---|
| 12 | Definition |
---|
| 13 | ---------- |
---|
| 14 | |
---|
[841753c] | 15 | The output of the scattering intensity function for the PearlNecklaceModel is |
---|
[cf404cb] | 16 | given by (Schweins, 2004) |
---|
| 17 | |
---|
| 18 | .. math:: |
---|
| 19 | |
---|
| 20 | I(q)=\frac{ \text{scale} }{V} \cdot \frac{(S_{ss}(q)+S_{ff}(q)+S_{fs}(q))} |
---|
| 21 | {(M \cdot m_f + N \cdot m_s)^2} + \text{bkg} |
---|
| 22 | |
---|
| 23 | where |
---|
| 24 | |
---|
| 25 | .. math:: |
---|
| 26 | |
---|
| 27 | S_{ss}(q) &= sm_s^2\psi^2(q)[\frac{N}{1-sin(qA)/qA}-\frac{N}{2}- |
---|
| 28 | \frac{1-(sin(qA)/qA)^N}{(1-sin(qA)/qA)^2}\cdot\frac{sin(qA)}{qA}] \\ |
---|
| 29 | S_{ff}(q) &= sm_r^2[M\{2\Lambda(q)-(\frac{sin(ql/2)}{ql/2})\}+ |
---|
| 30 | \frac{2M\beta^2(q)}{1-sin(qA)/qA}-2\beta^2(q)\cdot |
---|
| 31 | \frac{1-(sin(qA)/qA)^M}{(1-sin(qA)/qA)^2}] \\ |
---|
| 32 | S_{fs}(q) &= m_r \beta (q) \cdot m_s \psi (q) \cdot 4[ |
---|
| 33 | \frac{N-1}{1-sin(qA)/qA}-\frac{1-(sin(qA)/qA)^{N-1}}{(1-sin(qA)/qA)^2} |
---|
| 34 | \cdot \frac{sin(qA)}{qA}] \\ |
---|
| 35 | \psi(q) &= 3 \cdot \frac{sin(qR)-(qR)\cdot cos(qR)}{(qR)^3} \\ |
---|
| 36 | \Lambda(q) &= \frac{\int_0^{ql}\frac{sin(t)}{t}dt}{ql} \\ |
---|
| 37 | \beta(q) &= \frac{\int_{qR}^{q(A-R)}\frac{sin(t)}{t}dt}{ql} |
---|
| 38 | |
---|
[841753c] | 39 | where the mass *m*\ :sub:`i` is (SLD\ :sub:`i` - SLD\ :sub:`solvent`) \* |
---|
[cf404cb] | 40 | (volume of the *N* pearls/rods). *V* is the total volume of the necklace. |
---|
| 41 | |
---|
[841753c] | 42 | The 2D scattering intensity is the same as $P(q)$ above, regardless of the |
---|
[cf404cb] | 43 | orientation of the *q* vector. |
---|
| 44 | |
---|
| 45 | The returned value is scaled to units of |cm^-1| and the parameters of the |
---|
| 46 | pearl_necklace model are the following |
---|
| 47 | |
---|
| 48 | NB: *number_of_pearls* must be an integer. |
---|
| 49 | |
---|
| 50 | .. figure:: img/pearl_plot.jpg |
---|
| 51 | |
---|
| 52 | 1D plot using the default values (w/1000 data point). |
---|
| 53 | |
---|
| 54 | REFERENCE |
---|
| 55 | |
---|
[841753c] | 56 | R Schweins and K Huber, *Particle Scattering Factor of Pearl Necklace Chains*, |
---|
[cf404cb] | 57 | *Macromol. Symp.* 211 (2004) 25-42 2004 |
---|
| 58 | """ |
---|
| 59 | |
---|
[f12357f] | 60 | from numpy import inf, pi |
---|
[cf404cb] | 61 | |
---|
| 62 | name = "pearl_necklace" |
---|
| 63 | title = "Colloidal spheres chained together with o preferential orientation" |
---|
| 64 | description = """ |
---|
| 65 | Calculate form factor for Pearl Necklace Model |
---|
| 66 | [Macromol. Symp. 2004, 211, 25-42] |
---|
| 67 | Parameters: |
---|
| 68 | background:background |
---|
| 69 | scale: scale factor |
---|
| 70 | sld: the SLD of the pearl spheres |
---|
| 71 | sld_string: the SLD of the strings |
---|
| 72 | sld_solvent: the SLD of the solvent |
---|
| 73 | number_of_pearls: number of the pearls |
---|
| 74 | radius: the radius of a pearl |
---|
| 75 | edge_separation: the length of string segment; surface to surface |
---|
| 76 | string_thickness: thickness (ie, diameter) of the string |
---|
| 77 | """ |
---|
| 78 | category = "shape:cylinder" |
---|
| 79 | |
---|
| 80 | # ["name", "units", default, [lower, upper], "type","description"], |
---|
[841753c] | 81 | parameters = [["radius", "Angstrom", 80.0, [0, inf], "volume", |
---|
[cf404cb] | 82 | "Mean radius of the chained spheres"], |
---|
[841753c] | 83 | ["edge_separation", "Angstrom", 350.0, [0, inf], "volume", |
---|
[cf404cb] | 84 | "Mean separation of chained particles"], |
---|
[841753c] | 85 | ["string_thickness", "Angstrom", 2.5, [0, inf], "volume", |
---|
[cf404cb] | 86 | "Thickness of the chain linkage"], |
---|
[841753c] | 87 | ["number_of_pearls", "none", 3, [0, inf], "volume", |
---|
[cf404cb] | 88 | "Mean number of pearls in each necklace"], |
---|
[841753c] | 89 | ["sld", "Angstrom^2", 1.0, [-inf, inf], "", |
---|
[cf404cb] | 90 | "Scattering length density of the chained spheres"], |
---|
[841753c] | 91 | ["string_sld", "Angstrom^2", 1.0, [-inf, inf], "", |
---|
[cf404cb] | 92 | "Scattering length density of the chain linkage"], |
---|
[841753c] | 93 | ["solvent_sld", "Angstrom^2", 6.3, [-inf, inf], "", |
---|
[cf404cb] | 94 | "Scattering length density of the solvent"], |
---|
[841753c] | 95 | ] |
---|
[cf404cb] | 96 | |
---|
| 97 | source = ["lib/Si.c", "pearl_necklace.c"] |
---|
[d18582e] | 98 | single = False # use double precision unless told otherwise |
---|
[f12357f] | 99 | |
---|
| 100 | def volume(radius, edge_separation, string_thickness, number_of_pearls): |
---|
| 101 | """ |
---|
| 102 | Calculates the total particle volume of the necklace. |
---|
| 103 | Redundant with form_volume. |
---|
| 104 | """ |
---|
| 105 | number_of_strings = number_of_pearls - 1.0 |
---|
| 106 | string_vol = edge_separation * pi * pow((string_thickness / 2.0), 2.0) |
---|
| 107 | pearl_vol = 4.0 /3.0 * pi * pow(radius, 3.0) |
---|
| 108 | total_vol = number_of_strings * string_vol |
---|
| 109 | total_vol += number_of_pearls * pearl_vol |
---|
| 110 | return total_vol |
---|
| 111 | |
---|
| 112 | def ER(radius, edge_separation, string_thickness, number_of_pearls): |
---|
| 113 | """ |
---|
| 114 | Calculation for effective radius. |
---|
| 115 | """ |
---|
| 116 | tot_vol = volume(radius, edge_separation, string_thickness, number_of_pearls) |
---|
| 117 | rad_out = pow((3.0*tot_vol/4.0/pi), 0.33333) |
---|
| 118 | return rad_out |
---|
[cf404cb] | 119 | |
---|
| 120 | # parameters for demo |
---|
| 121 | demo = dict(scale=1, background=0, radius=80.0, edge_separation=350.0, |
---|
| 122 | number_of_pearls=3, sld=1, solvent_sld=6.3, string_sld=1, |
---|
| 123 | string_thickness=2.5, |
---|
| 124 | radius_pd=.2, radius_pd_n=5, |
---|
| 125 | edge_separation_pd=25.0, edge_separation_pd_n=5, |
---|
| 126 | number_of_pearls_pd=0, number_of_pearls_pd_n=0, |
---|
| 127 | string_thickness_pd=0.2, string_thickness_pd_n=5, |
---|
| 128 | ) |
---|
| 129 | |
---|
| 130 | # For testing against the old sasview models, include the converted parameter |
---|
| 131 | # names and the target sasview model name. |
---|
| 132 | oldname = 'PearlNecklaceModel' |
---|
[841753c] | 133 | oldpars = dict(scale='scale', background='background', radius='radius', |
---|
[cf404cb] | 134 | number_of_pearls='num_pearls', solvent_sld='sld_solv', |
---|
| 135 | string_thickness='thick_string', sld='sld_pearl', |
---|
[841753c] | 136 | string_sld='sld_string', edge_separation='edge_separation') |
---|
[f12357f] | 137 | |
---|
| 138 | tests = [[{}, 0.001, 17380.245], [{}, 'ER', 115.39502]] |
---|