1 | #poly_gauss_coil model |
---|
2 | #conversion of Poly_GaussCoil.py |
---|
3 | #converted by Steve King, Mar 2016 |
---|
4 | |
---|
5 | |
---|
6 | |
---|
7 | .._ poly_gauss_coil: |
---|
8 | r""" |
---|
9 | This empirical model describes the scattering from *polydisperse* polymer chains in theta solvents or polymer melts, assuming a Schulz-Zimm type molecular weight distribution. |
---|
10 | |
---|
11 | To describe the scattering from *monodisperse* polymer chains, see the mono_gauss_coil model. |
---|
12 | |
---|
13 | Definition |
---|
14 | ---------- |
---|
15 | |
---|
16 | *I(q)* = *scale* |cdot| *P(q)* + *background* |
---|
17 | |
---|
18 | where |
---|
19 | |
---|
20 | *scale* = |phi|\ :sub:`poly` |cdot| *V* |cdot| (|rho|\ :sub:`poly` - |rho|\ :sub:`solv`)\ :sup:`2` |
---|
21 | |
---|
22 | *P(q)* = 2 [(1 + UZ)\ :sup:`-1/U` + Z - 1] / [(1 + U) Z\ :sup:`2`] |
---|
23 | |
---|
24 | *Z* = [(*q R*\ :sub:`g`)\ :sup:`2`] / (1 + 2U) |
---|
25 | |
---|
26 | *U* = (Mw / Mn) - 1 = (*polydispersity ratio*) - 1 |
---|
27 | |
---|
28 | and |
---|
29 | |
---|
30 | *V* = *M* / (*N*\ :sub:`A` |delta|) |
---|
31 | |
---|
32 | Here, |phi|\ :sub:`poly`, is the volume fraction of polymer, *V* is the volume of a polymer coil, *M* is the molecular weight of the polymer, *N*\ :sub:`A` is Avogadro's Number, |delta| is the bulk density of the polymer, |rho|\ :sub:`poly` is the sld of the polymer, |rho|\ :sub:`solv` is the sld of the solvent, and *R*\ :sub:`g` is the radius of gyration of the polymer coil. |
---|
33 | |
---|
34 | .. figure:: img/poly_gauss_coil_1d.jpg |
---|
35 | |
---|
36 | 1D plot using the default values. |
---|
37 | |
---|
38 | The 2D scattering intensity is calculated in the same way as the 1D, but where the *q* vector is redefined as |
---|
39 | |
---|
40 | .. image:: img/2d_q_vector.gif |
---|
41 | |
---|
42 | References |
---|
43 | ---------- |
---|
44 | |
---|
45 | O Glatter and O Kratky (editors), *Small Angle X-ray Scattering*, Academic Press, (1982) |
---|
46 | Page 404. |
---|
47 | |
---|
48 | J S Higgins, H C Benoit, *Polymers and Neutron Scattering*, Oxford Science Publications, (1996). |
---|
49 | |
---|
50 | S M King, *Small Angle Neutron Scattering* in *Modern Techniques for Polymer Characterisation*, Wiley, (1999). |
---|
51 | |
---|
52 | http://www.ncnr.nist.gov/staff/hammouda/distance_learning/chapter_28.pdf |
---|
53 | """ |
---|
54 | |
---|
55 | from numpy import inf, sqrt, power |
---|
56 | |
---|
57 | name = "poly_gauss_coil" |
---|
58 | title = "Scattering from polydisperse polymer coils" |
---|
59 | |
---|
60 | description = """ |
---|
61 | Evaluates the scattering from |
---|
62 | polydisperse polymer chains. |
---|
63 | """ |
---|
64 | category = "shape-independent" |
---|
65 | |
---|
66 | # ["name", "units", default, [lower, upper], "type", "description"], |
---|
67 | parameters = [["radius_gyration", "Ang", 50.0, [0.0, inf], "", "Radius of gyration"], |
---|
68 | ["polydispersity", "None", 2.0, [1.0, inf], "", "Polymer Mw/Mn"]] |
---|
69 | |
---|
70 | # NB: Scale and Background are implicit parameters on every model |
---|
71 | def Iq(q, radius_gyration, polydispersity): |
---|
72 | # pylint: disable = missing-docstring |
---|
73 | u = polydispersity - 1.0 |
---|
74 | # TO DO |
---|
75 | # should trap the case of polydispersity = 1 by switching to a taylor expansion |
---|
76 | minusoneonu = -1.0 / u |
---|
77 | z = ((x * radius_gyration) * (x * radius_gyration)) / (1.0 + 2.0 * u) |
---|
78 | if x == 0: |
---|
79 | inten = 1.0 |
---|
80 | else: |
---|
81 | inten = 2.0 * (power((1.0 + u * z),minusoneonu) + z - 1.0 ) / ((1.0 + u) * (z * z)) |
---|
82 | return inten |
---|
83 | Iq.vectorized = True # Iq accepts an array of q values |
---|
84 | |
---|
85 | def Iqxy(qx, qy, *args): |
---|
86 | # pylint: disable = missing-docstring |
---|
87 | return Iq(sqrt(qx ** 2 + qy ** 2), *args) |
---|
88 | Iqxy.vectorized = True # Iqxy accepts an array of qx, qy values |
---|
89 | |
---|
90 | demo = dict(scale = 1.0, |
---|
91 | radius_gyration = 50.0, |
---|
92 | polydispersity = 2.0, |
---|
93 | background = 0.0) |
---|
94 | |
---|
95 | oldname = "Poly_GaussCoil" |
---|
96 | oldpars = dict(scale = 'scale', |
---|
97 | radius_gyration = 'rg', |
---|
98 | polydispersity = 'poly_m', |
---|
99 | background = 'background') |
---|
100 | |
---|
101 | tests = [ |
---|
102 | [{'scale': 1.0, 'radius_gyration': 50.0, 'polydispersity': 2.0, 'background': 0.0}, |
---|
103 | [0.0106939, 0.469418], [0.912993, 0.0054163]], |
---|
104 | ] |
---|