source: sasmodels/sasmodels/models/mono_gauss_coil.py @ 2c74c11

core_shell_microgelscostrafo411magnetic_modelrelease_v0.94release_v0.95ticket-1257-vesicle-productticket_1156ticket_1265_superballticket_822_more_unit_tests
Last change on this file since 2c74c11 was 2c74c11, checked in by Paul Kienzle <pkienzle@…>, 8 years ago

implicit Iqxy; fix divide by 0 for q=0

  • Property mode set to 100644
File size: 2.9 KB
Line 
1#mono_gauss_coil model
2#conversion of DebyeModel.py
3#converted by Steve King, Mar 2016
4
5
6
7r"""
8This 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
10To describe the scattering from *polydisperse* polymer chains see the :ref:`poly_gauss_coil <poly-gauss-coil>` model.
11
12Definition
13----------
14
15     *I(q)* = *scale* |cdot| *I* \ :sub:`0` |cdot| *P(q)* + *background*
16
17where
18
19     *I*\ :sub:`0` = |phi|\ :sub:`poly` |cdot| *V* |cdot| (|rho|\ :sub:`poly` - |rho|\ :sub:`solv`)\  :sup:`2`
20
21     *P(q)* = 2 [exp(-Z) + Z - 1] / Z \ :sup:`2`
22
23     *Z* = (*q R* \ :sub:`g`)\ :sup:`2`
24
25and
26
27     *V* = *M* / (*N*\ :sub:`A` |delta|)
28
29Here, |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.
30
31The 2D scattering intensity is calculated in the same way as the 1D, but where the *q* vector is redefined as
32
33.. math::
34
35    q = \sqrt{q_x^2 + q_y^2}
36
37References
38----------
39
40P Debye, *J. Phys. Colloid. Chem.*, 51 (1947) 18.
41
42R J Roe, *Methods of X-Ray and Neutron Scattering in Polymer Science*, Oxford University Press, New York (2000).
43
44http://www.ncnr.nist.gov/staff/hammouda/distance_learning/chapter_28.pdf
45"""
46
47from numpy import inf, exp, errstate
48
49name =  "mono_gauss_coil"
50title =  "Scattering from monodisperse polymer coils"
51
52description =  """
53    Evaluates the scattering from
54    monodisperse polymer chains.
55    """
56category =  "shape-independent"
57
58#             ["name", "units", default, [lower, upper], "type", "description"],
59parameters =  [["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"]]
61
62# NB: Scale and Background are implicit parameters on every model
63def Iq(q, i_zero, radius_gyration):
64    # pylint: disable = missing-docstring
65    z = (q * radius_gyration)**2
66
67    with errstate(invalid='ignore'):
68        inten = (i_zero * 2.0) * (exp(-z) + z - 1.0)/z**2
69        inten[q == 0] = i_zero
70    return inten
71Iq.vectorized = True # Iq accepts an array of q values
72
73demo =  dict(scale = 1.0,
74            i_zero = 70.0,
75            radius_gyration = 75.0,
76            background = 0.0)
77
78# these unit test values taken from SasView 3.1.2
79tests =  [
80    [{'scale': 1.0, 'i_zero': 70.0, 'radius_gyration': 75.0, 'background': 0.0},
81     [0.0106939, 0.469418], [57.1241, 0.112859]],
82    ]
Note: See TracBrowser for help on using the repository browser.