1 | #mono_gauss_coil model |
---|
2 | #conversion of DebyeModel.py |
---|
3 | #converted by Steve King, Mar 2016 |
---|
4 | r""" |
---|
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). |
---|
10 | |
---|
11 | To describe the scattering from *polydisperse* polymer chains see the |
---|
12 | :ref:`poly-gauss-coil` model. |
---|
13 | |
---|
14 | Definition |
---|
15 | ---------- |
---|
16 | |
---|
17 | .. math:: |
---|
18 | |
---|
19 | I(q) = \text{scale} \cdot I_0 \cdot P(q) + \text{background} |
---|
20 | |
---|
21 | where |
---|
22 | |
---|
23 | .. math:: |
---|
24 | |
---|
25 | I_0 &= \phi_\text{poly} \cdot V |
---|
26 | \cdot (\rho_\text{poly} - \rho_\text{solv})^2 \\ |
---|
27 | P(q) &= 2 [\exp(-Z) + Z - 1] / Z^2 \\ |
---|
28 | Z &= (q R_g)^2 \\ |
---|
29 | V &= M / (N_A \delta) |
---|
30 | |
---|
31 | Here, $\phi_\text{poly}$ is the volume fraction of polymer, $V$ is the |
---|
32 | volume of a polymer coil, *M* is the molecular weight of the polymer, |
---|
33 | $N_A$ is Avogadro's Number, $\delta$ is the bulk density of the polymer, |
---|
34 | $\rho_\text{poly}$ is the sld of the polymer, $\rho\text{solv}$ is the |
---|
35 | sld of the solvent, and $R_g$ is the radius of gyration of the polymer coil. |
---|
36 | |
---|
37 | The 2D scattering intensity is calculated in the same way as the 1D, |
---|
38 | but where the *q* vector is redefined as |
---|
39 | |
---|
40 | .. math:: |
---|
41 | |
---|
42 | q = \sqrt{q_x^2 + q_y^2} |
---|
43 | |
---|
44 | References |
---|
45 | ---------- |
---|
46 | |
---|
47 | .. [#] P Debye, *J. Phys. Colloid. Chem.*, 51 (1947) 18. |
---|
48 | .. [#] R J Roe, *Methods of X-Ray and Neutron Scattering in Polymer Science*, Oxford University Press, New York (2000). |
---|
49 | .. [#] http://www.ncnr.nist.gov/staff/hammouda/distance_learning/chapter_28.pdf |
---|
50 | |
---|
51 | Source |
---|
52 | ------ |
---|
53 | |
---|
54 | `mono_gauss_coil.py <https://github.com/SasView/sasmodels/blob/master/sasmodels/models/mono_gauss_coil.py>`_ |
---|
55 | |
---|
56 | `mono_gauss_coil.c <https://github.com/SasView/sasmodels/blob/master/sasmodels/models/mono_gauss_coil.c>`_ |
---|
57 | |
---|
58 | Authorship and Verification |
---|
59 | ---------------------------- |
---|
60 | |
---|
61 | * **Author:** |
---|
62 | * **Last Modified by:** |
---|
63 | * **Last Reviewed by:** |
---|
64 | * **Source added by :** Steve King **Date:** March 25, 2019""" |
---|
65 | |
---|
66 | import numpy as np |
---|
67 | from numpy import inf |
---|
68 | |
---|
69 | name = "mono_gauss_coil" |
---|
70 | title = "Scattering from monodisperse polymer coils" |
---|
71 | |
---|
72 | description = """ |
---|
73 | Evaluates the scattering from |
---|
74 | monodisperse polymer chains. |
---|
75 | """ |
---|
76 | category = "shape-independent" |
---|
77 | |
---|
78 | # pylint: disable=bad-whitespace, line-too-long |
---|
79 | # ["name", "units", default, [lower, upper], "type", "description"], |
---|
80 | parameters = [ |
---|
81 | ["i_zero", "1/cm", 70.0, [0.0, inf], "", "Intensity at q=0"], |
---|
82 | ["rg", "Ang", 75.0, [0.0, inf], "volume", "Radius of gyration"], |
---|
83 | ] |
---|
84 | # pylint: enable=bad-whitespace, line-too-long |
---|
85 | |
---|
86 | source = ["mono_gauss_coil.c"] |
---|
87 | have_Fq = False |
---|
88 | radius_effective_modes = ["R_g", "2R_g", "3R_g", "sqrt(5/3)*R_g"] |
---|
89 | |
---|
90 | |
---|
91 | def random(): |
---|
92 | """Return a random parameter set for the model.""" |
---|
93 | rg = 10**np.random.uniform(0, 4) |
---|
94 | #rg = 1e3 |
---|
95 | pars = dict( |
---|
96 | #scale=1, background=0, |
---|
97 | i_zero=1e7, # i_zero is a simple scale |
---|
98 | rg=rg, |
---|
99 | ) |
---|
100 | return pars |
---|
101 | |
---|
102 | demo = dict(scale=1.0, i_zero=70.0, rg=75.0, background=0.0) |
---|
103 | |
---|
104 | # these unit test values taken from SasView 3.1.2 |
---|
105 | tests = [ |
---|
106 | [{'scale': 1.0, 'i_zero': 70.0, 'rg': 75.0, 'background': 0.0}, |
---|
107 | [0.0106939, 0.469418], [57.1241, 0.112859]], |
---|
108 | ] |
---|