Changeset 40a87fa in sasmodels for sasmodels/models/mono_gauss_coil.py


Ignore:
Timestamp:
Aug 8, 2016 9:24:11 AM (8 years ago)
Author:
Paul Kienzle <pkienzle@…>
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
Message:

lint and latex cleanup

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/models/mono_gauss_coil.py

    r2c74c11 r40a87fa  
    22#conversion of DebyeModel.py 
    33#converted by Steve King, Mar 2016 
     4r""" 
     5This Debye Gaussian coil model strictly describes the scattering from 
     6*monodisperse* polymer chains in theta solvents or polymer melts, conditions 
     7under which the distances between segments follow a Gaussian distribution. 
     8Provided the number of segments is large (ie, high molecular weight polymers) 
     9the single-chain form factor P(Q) is that described by Debye (1947). 
    410 
    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. 
     11To describe the scattering from *polydisperse* polymer chains see the 
     12:ref:`poly-gauss-coil` model. 
    1113 
    1214Definition 
    1315---------- 
    1416 
    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} 
    1620 
    1721where 
    1822 
    19      *I*\ :sub:`0` = |phi|\ :sub:`poly` |cdot| *V* |cdot| (|rho|\ :sub:`poly` - |rho|\ :sub:`solv`)\  :sup:`2` 
     23.. math:: 
    2024 
    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 
    2227 
    23      *Z* = (*q R* \ :sub:`g`)\ :sup:`2` 
     28     P(q) &= 2 [\exp(-Z) + Z - 1] / Z^2 
    2429 
    25 and 
     30     Z &= (q R_g)^2 
    2631 
    27      *V* = *M* / (*N*\ :sub:`A` |delta|) 
     32     V &= M / (N_A \delta) 
    2833 
    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. 
     34Here, $\phi_\text{poly}$ is the volume fraction of polymer, $V$ is the 
     35volume 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 
     38sld of the solvent, and $R_g$ is the radius of gyration of the polymer coil. 
    3039 
    31 The 2D scattering intensity is calculated in the same way as the 1D, but where the *q* vector is redefined as 
     40The 2D scattering intensity is calculated in the same way as the 1D, 
     41but where the *q* vector is redefined as 
    3242 
    3343.. math:: 
     
    4050P Debye, *J. Phys. Colloid. Chem.*, 51 (1947) 18. 
    4151 
    42 R J Roe, *Methods of X-Ray and Neutron Scattering in Polymer Science*, Oxford University Press, New York (2000). 
     52R J Roe, *Methods of X-Ray and Neutron Scattering in Polymer Science*, 
     53Oxford University Press, New York (2000). 
    4354 
    4455http://www.ncnr.nist.gov/staff/hammouda/distance_learning/chapter_28.pdf 
     
    4758from numpy import inf, exp, errstate 
    4859 
    49 name =  "mono_gauss_coil" 
    50 title =  "Scattering from monodisperse polymer coils" 
     60name = "mono_gauss_coil" 
     61title = "Scattering from monodisperse polymer coils" 
    5162 
    52 description =  """ 
     63description = """ 
    5364    Evaluates the scattering from  
    5465    monodisperse polymer chains. 
    5566    """ 
    56 category =  "shape-independent" 
     67category = "shape-independent" 
    5768 
    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"], 
     71parameters = [ 
     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 
    6176 
    6277# NB: Scale and Background are implicit parameters on every model 
     
    7186Iq.vectorized = True # Iq accepts an array of q values 
    7287 
    73 demo =  dict(scale = 1.0, 
    74             i_zero = 70.0, 
    75             radius_gyration = 75.0, 
    76             background = 0.0) 
     88demo = dict(scale=1.0, i_zero=70.0, radius_gyration=75.0, background=0.0) 
    7789 
    7890# these unit test values taken from SasView 3.1.2 
    79 tests =  [ 
     91tests = [ 
    8092    [{'scale': 1.0, 'i_zero': 70.0, 'radius_gyration': 75.0, 'background': 0.0}, 
    8193     [0.0106939, 0.469418], [57.1241, 0.112859]], 
Note: See TracChangeset for help on using the changeset viewer.