Changeset 40a87fa in sasmodels for sasmodels/models/mono_gauss_coil.py
- Timestamp:
- Aug 8, 2016 9:24:11 AM (8 years ago)
- Branches:
- master, core_shell_microgels, costrafo411, magnetic_model, release_v0.94, release_v0.95, ticket-1257-vesicle-product, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
- Children:
- 2472141
- Parents:
- 2d65d51
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sasmodels/models/mono_gauss_coil.py
r2c74c11 r40a87fa 2 2 #conversion of DebyeModel.py 3 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). 4 10 5 6 7 r""" 8 This Debye Gaussian coil model strictly describes the scattering from *monodisperse* polymer chains in theta solvents or polymer melts, conditions under which the distances between segments follow a Gaussian distribution. Provided the number of segments is large (ie, high molecular weight polymers) the single-chain form factor P(Q) is that described by Debye (1947). 9 10 To describe the scattering from *polydisperse* polymer chains see the :ref:`poly_gauss_coil <poly-gauss-coil>` model. 11 To describe the scattering from *polydisperse* polymer chains see the 12 :ref:`poly-gauss-coil` model. 11 13 12 14 Definition 13 15 ---------- 14 16 15 *I(q)* = *scale* |cdot| *I* \ :sub:`0` |cdot| *P(q)* + *background* 17 .. math:: 18 19 I(q) = \text{scale} \cdot I_0 \cdot P(q) + \text{background} 16 20 17 21 where 18 22 19 *I*\ :sub:`0` = |phi|\ :sub:`poly` |cdot| *V* |cdot| (|rho|\ :sub:`poly` - |rho|\ :sub:`solv`)\ :sup:`2` 23 .. math:: 20 24 21 *P(q)* = 2 [exp(-Z) + Z - 1] / Z \ :sup:`2` 25 I_0 &= \phi_\text{poly} \cdot V 26 \cdot (\rho_\text{poly} - \rho_\text{solv})^2 22 27 23 *Z* = (*q R* \ :sub:`g`)\ :sup:`2`28 P(q) &= 2 [\exp(-Z) + Z - 1] / Z^2 24 29 25 and 30 Z &= (q R_g)^2 26 31 27 *V* = *M* / (*N*\ :sub:`A` |delta|)32 V &= M / (N_A \delta) 28 33 29 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. 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. 30 39 31 The 2D scattering intensity is calculated in the same way as the 1D, but where the *q* vector is redefined as 40 The 2D scattering intensity is calculated in the same way as the 1D, 41 but where the *q* vector is redefined as 32 42 33 43 .. math:: … … 40 50 P Debye, *J. Phys. Colloid. Chem.*, 51 (1947) 18. 41 51 42 R J Roe, *Methods of X-Ray and Neutron Scattering in Polymer Science*, Oxford University Press, New York (2000). 52 R J Roe, *Methods of X-Ray and Neutron Scattering in Polymer Science*, 53 Oxford University Press, New York (2000). 43 54 44 55 http://www.ncnr.nist.gov/staff/hammouda/distance_learning/chapter_28.pdf … … 47 58 from numpy import inf, exp, errstate 48 59 49 name = 50 title = 60 name = "mono_gauss_coil" 61 title = "Scattering from monodisperse polymer coils" 51 62 52 description = 63 description = """ 53 64 Evaluates the scattering from 54 65 monodisperse polymer chains. 55 66 """ 56 category = 67 category = "shape-independent" 57 68 58 # ["name", "units", default, [lower, upper], "type", "description"], 59 parameters = [["i_zero", "1/cm", 70.0, [0.0, inf], "", "Intensity at q=0"], 60 ["radius_gyration", "Ang", 75.0, [0.0, inf], "", "Radius of gyration"]] 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"], 73 ["radius_gyration", "Ang", 75.0, [0.0, inf], "", "Radius of gyration"], 74 ] 75 # pylint: enable=bad-whitespace, line-too-long 61 76 62 77 # NB: Scale and Background are implicit parameters on every model … … 71 86 Iq.vectorized = True # Iq accepts an array of q values 72 87 73 demo = dict(scale = 1.0, 74 i_zero = 70.0, 75 radius_gyration = 75.0, 76 background = 0.0) 88 demo = dict(scale=1.0, i_zero=70.0, radius_gyration=75.0, background=0.0) 77 89 78 90 # these unit test values taken from SasView 3.1.2 79 tests = 91 tests = [ 80 92 [{'scale': 1.0, 'i_zero': 70.0, 'radius_gyration': 75.0, 'background': 0.0}, 81 93 [0.0106939, 0.469418], [57.1241, 0.112859]],
Note: See TracChangeset
for help on using the changeset viewer.