[246517d] | 1 | #poly_gauss_coil model |
---|
| 2 | #conversion of Poly_GaussCoil.py |
---|
| 3 | #converted by Steve King, Mar 2016 |
---|
| 4 | |
---|
| 5 | |
---|
| 6 | |
---|
| 7 | r""" |
---|
| 8 | This empirical model describes the scattering from *polydisperse* polymer chains in theta solvents or polymer melts, assuming a Schulz-Zimm type molecular weight distribution. |
---|
| 9 | |
---|
| 10 | To describe the scattering from *monodisperse* polymer chains, see the :ref:`mono_gauss_coil <mono-gauss-coil>` model. |
---|
| 11 | |
---|
| 12 | Definition |
---|
| 13 | ---------- |
---|
| 14 | |
---|
| 15 | *I(q)* = *scale* |cdot| *I* \ :sub:`0` |cdot| *P(q)* + *background* |
---|
| 16 | |
---|
| 17 | where |
---|
| 18 | |
---|
| 19 | *I*\ :sub:`0` = |phi|\ :sub:`poly` |cdot| *V* |cdot| (|rho|\ :sub:`poly` - |rho|\ :sub:`solv`)\ :sup:`2` |
---|
| 20 | |
---|
| 21 | *P(q)* = 2 [(1 + UZ)\ :sup:`-1/U` + Z - 1] / [(1 + U) Z\ :sup:`2`] |
---|
| 22 | |
---|
| 23 | *Z* = [(*q R*\ :sub:`g`)\ :sup:`2`] / (1 + 2U) |
---|
| 24 | |
---|
| 25 | *U* = (Mw / Mn) - 1 = (*polydispersity ratio*) - 1 |
---|
| 26 | |
---|
| 27 | and |
---|
| 28 | |
---|
| 29 | *V* = *M* / (*N*\ :sub:`A` |delta|) |
---|
| 30 | |
---|
| 31 | 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. |
---|
| 32 | |
---|
| 33 | The 2D scattering intensity is calculated in the same way as the 1D, but where the *q* vector is redefined as |
---|
| 34 | |
---|
| 35 | .. math:: |
---|
| 36 | |
---|
| 37 | q = \sqrt{q_x^2 + q_y^2} |
---|
| 38 | |
---|
| 39 | References |
---|
| 40 | ---------- |
---|
| 41 | |
---|
| 42 | O Glatter and O Kratky (editors), *Small Angle X-ray Scattering*, Academic Press, (1982) |
---|
| 43 | Page 404. |
---|
| 44 | |
---|
| 45 | J S Higgins, H C Benoit, *Polymers and Neutron Scattering*, Oxford Science Publications, (1996). |
---|
| 46 | |
---|
| 47 | S M King, *Small Angle Neutron Scattering* in *Modern Techniques for Polymer Characterisation*, Wiley, (1999). |
---|
| 48 | |
---|
| 49 | http://www.ncnr.nist.gov/staff/hammouda/distance_learning/chapter_28.pdf |
---|
| 50 | """ |
---|
| 51 | |
---|
[09b84ed] | 52 | from numpy import inf, sqrt, exp, power |
---|
[246517d] | 53 | |
---|
| 54 | name = "poly_gauss_coil" |
---|
| 55 | title = "Scattering from polydisperse polymer coils" |
---|
| 56 | |
---|
| 57 | description = """ |
---|
| 58 | Evaluates the scattering from |
---|
| 59 | polydisperse polymer chains. |
---|
| 60 | """ |
---|
| 61 | category = "shape-independent" |
---|
| 62 | |
---|
| 63 | # ["name", "units", default, [lower, upper], "type", "description"], |
---|
| 64 | parameters = [["i_zero", "1/cm", 70.0, [0.0, inf], "", "Intensity at q=0"], |
---|
| 65 | ["radius_gyration", "Ang", 75.0, [0.0, inf], "", "Radius of gyration"], |
---|
| 66 | ["polydispersity", "None", 2.0, [1.0, inf], "", "Polymer Mw/Mn"]] |
---|
| 67 | |
---|
| 68 | # NB: Scale and Background are implicit parameters on every model |
---|
| 69 | def Iq(q, i_zero, radius_gyration, polydispersity): |
---|
| 70 | # pylint: disable = missing-docstring |
---|
| 71 | u = polydispersity - 1.0 |
---|
| 72 | z = ((q * radius_gyration) * (q * radius_gyration)) / (1.0 + 2.0 * u) |
---|
| 73 | if (q == 0).any(): |
---|
[09b84ed] | 74 | inten = i_zero |
---|
[246517d] | 75 | else: |
---|
[09b84ed] | 76 | # need to trap the case of the polydispersity being 1 (ie, monodispersity!) |
---|
| 77 | if polydispersity == 1: |
---|
| 78 | inten = i_zero * 2.0 * (exp(-z) + z - 1.0 ) / (z * z) |
---|
| 79 | else: |
---|
| 80 | minusoneonu = -1.0 / u |
---|
| 81 | inten = i_zero * 2.0 * (power((1.0 + u * z),minusoneonu) + z - 1.0 ) / ((1.0 + u) * (z * z)) |
---|
[246517d] | 82 | return inten |
---|
[09b84ed] | 83 | #Iq.vectorized = True # Iq accepts an array of q values |
---|
[246517d] | 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 | i_zero = 70.0, |
---|
| 92 | radius_gyration = 75.0, |
---|
| 93 | polydispersity = 2.0, |
---|
| 94 | background = 0.0) |
---|
| 95 | |
---|
| 96 | oldname = "Poly_GaussCoil" |
---|
| 97 | oldpars = dict(scale = 'scale', |
---|
| 98 | radius_gyration = 'rg', |
---|
| 99 | polydispersity = 'poly_m', |
---|
| 100 | background = 'background') |
---|
| 101 | |
---|
[09b84ed] | 102 | # these unit test values taken from SasView 3.1.2 |
---|
[246517d] | 103 | tests = [ |
---|
[09b84ed] | 104 | [{'scale': 1.0, 'i_zero': 70.0, 'radius_gyration': 75.0, 'polydispersity': 2.0, 'background': 0.0}, |
---|
[246517d] | 105 | [0.0106939, 0.469418], [57.6405, 0.169016]], |
---|
| 106 | ] |
---|