[246517d] | 1 | #mono_gauss_coil model |
---|
| 2 | #conversion of DebyeModel.py |
---|
| 3 | #converted by Steve King, Mar 2016 |
---|
| 4 | r""" |
---|
[40a87fa] | 5 | This Debye Gaussian coil model strictly describes the scattering from |
---|
| 6 | *monodisperse* polymer chains in theta solvents or polymer melts, conditions |
---|
| 7 | under which the distances between segments follow a Gaussian distribution. |
---|
| 8 | Provided the number of segments is large (ie, high molecular weight polymers) |
---|
| 9 | the single-chain form factor P(Q) is that described by Debye (1947). |
---|
[246517d] | 10 | |
---|
[40a87fa] | 11 | To describe the scattering from *polydisperse* polymer chains see the |
---|
| 12 | :ref:`poly-gauss-coil` model. |
---|
[246517d] | 13 | |
---|
| 14 | Definition |
---|
| 15 | ---------- |
---|
| 16 | |
---|
[40a87fa] | 17 | .. math:: |
---|
| 18 | |
---|
| 19 | I(q) = \text{scale} \cdot I_0 \cdot P(q) + \text{background} |
---|
[15bd6e7] | 20 | |
---|
[246517d] | 21 | where |
---|
| 22 | |
---|
[40a87fa] | 23 | .. math:: |
---|
[246517d] | 24 | |
---|
[40a87fa] | 25 | I_0 &= \phi_\text{poly} \cdot V |
---|
| 26 | \cdot (\rho_\text{poly} - \rho_\text{solv})^2 |
---|
[15bd6e7] | 27 | |
---|
[40a87fa] | 28 | P(q) &= 2 [\exp(-Z) + Z - 1] / Z^2 |
---|
[246517d] | 29 | |
---|
[40a87fa] | 30 | Z &= (q R_g)^2 |
---|
[246517d] | 31 | |
---|
[40a87fa] | 32 | V &= M / (N_A \delta) |
---|
[15bd6e7] | 33 | |
---|
[40a87fa] | 34 | Here, $\phi_\text{poly}$ is the volume fraction of polymer, $V$ is the |
---|
| 35 | volume of a polymer coil, *M* is the molecular weight of the polymer, |
---|
| 36 | $N_A$ is Avogadro's Number, $\delta$ is the bulk density of the polymer, |
---|
| 37 | $\rho_\text{poly}$ is the sld of the polymer, $\rho\text{solv}$ is the |
---|
| 38 | sld of the solvent, and $R_g$ is the radius of gyration of the polymer coil. |
---|
[246517d] | 39 | |
---|
[40a87fa] | 40 | The 2D scattering intensity is calculated in the same way as the 1D, |
---|
| 41 | but where the *q* vector is redefined as |
---|
[246517d] | 42 | |
---|
| 43 | .. math:: |
---|
| 44 | |
---|
| 45 | q = \sqrt{q_x^2 + q_y^2} |
---|
| 46 | |
---|
| 47 | References |
---|
| 48 | ---------- |
---|
| 49 | |
---|
| 50 | P Debye, *J. Phys. Colloid. Chem.*, 51 (1947) 18. |
---|
| 51 | |
---|
[40a87fa] | 52 | R J Roe, *Methods of X-Ray and Neutron Scattering in Polymer Science*, |
---|
| 53 | Oxford University Press, New York (2000). |
---|
[246517d] | 54 | |
---|
| 55 | http://www.ncnr.nist.gov/staff/hammouda/distance_learning/chapter_28.pdf |
---|
| 56 | """ |
---|
| 57 | |
---|
[2c74c11] | 58 | from numpy import inf, exp, errstate |
---|
[246517d] | 59 | |
---|
[40a87fa] | 60 | name = "mono_gauss_coil" |
---|
| 61 | title = "Scattering from monodisperse polymer coils" |
---|
[246517d] | 62 | |
---|
[40a87fa] | 63 | description = """ |
---|
[246517d] | 64 | Evaluates the scattering from |
---|
[15bd6e7] | 65 | monodisperse polymer chains. |
---|
[246517d] | 66 | """ |
---|
[40a87fa] | 67 | category = "shape-independent" |
---|
[246517d] | 68 | |
---|
[40a87fa] | 69 | # pylint: disable=bad-whitespace, line-too-long |
---|
| 70 | # ["name", "units", default, [lower, upper], "type", "description"], |
---|
| 71 | parameters = [ |
---|
| 72 | ["i_zero", "1/cm", 70.0, [0.0, inf], "", "Intensity at q=0"], |
---|
[a807206] | 73 | ["rg", "Ang", 75.0, [0.0, inf], "", "Radius of gyration"], |
---|
[40a87fa] | 74 | ] |
---|
| 75 | # pylint: enable=bad-whitespace, line-too-long |
---|
[246517d] | 76 | |
---|
| 77 | # NB: Scale and Background are implicit parameters on every model |
---|
[a807206] | 78 | def Iq(q, i_zero, rg): |
---|
[246517d] | 79 | # pylint: disable = missing-docstring |
---|
[a807206] | 80 | z = (q * rg)**2 |
---|
[246517d] | 81 | |
---|
[2c74c11] | 82 | with errstate(invalid='ignore'): |
---|
| 83 | inten = (i_zero * 2.0) * (exp(-z) + z - 1.0)/z**2 |
---|
| 84 | inten[q == 0] = i_zero |
---|
| 85 | return inten |
---|
| 86 | Iq.vectorized = True # Iq accepts an array of q values |
---|
[246517d] | 87 | |
---|
[a807206] | 88 | demo = dict(scale=1.0, i_zero=70.0, rg=75.0, background=0.0) |
---|
[246517d] | 89 | |
---|
[f10bc52] | 90 | # these unit test values taken from SasView 3.1.2 |
---|
[40a87fa] | 91 | tests = [ |
---|
[a807206] | 92 | [{'scale': 1.0, 'i_zero': 70.0, 'rg': 75.0, 'background': 0.0}, |
---|
[15bd6e7] | 93 | [0.0106939, 0.469418], [57.1241, 0.112859]], |
---|
[246517d] | 94 | ] |
---|