source: sasmodels/sasmodels/models/mono_gauss_coil.py @ b297ba9

core_shell_microgelsmagnetic_modelticket-1257-vesicle-productticket_1156ticket_1265_superballticket_822_more_unit_tests
Last change on this file since b297ba9 was b297ba9, checked in by Paul Kienzle <pkienzle@…>, 5 years ago

lint

  • Property mode set to 100644
File size: 2.8 KB
RevLine 
[3330bb4]1#mono_gauss_coil model
2#conversion of DebyeModel.py
3#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).
10
11To describe the scattering from *polydisperse* polymer chains see the
12:ref:`poly-gauss-coil` model.
13
14Definition
15----------
16
17.. math::
18
19     I(q) = \text{scale} \cdot I_0 \cdot P(q) + \text{background}
20
21where
22
23.. math::
24
25     I_0 &= \phi_\text{poly} \cdot V
[ca04add]26            \cdot (\rho_\text{poly} - \rho_\text{solv})^2 \\
27     P(q) &= 2 [\exp(-Z) + Z - 1] / Z^2 \\
28     Z &= (q R_g)^2 \\
[3330bb4]29     V &= M / (N_A \delta)
30
31Here, $\phi_\text{poly}$ is the volume fraction of polymer, $V$ is the
32volume of a polymer coil, *M* is the molecular weight of the polymer,
33$N_A$ is Avogadro's Number, $\delta$ is the bulk density of the polymer,
34$\rho_\text{poly}$ is the sld of the polymer, $\rho\text{solv}$ is the
35sld of the solvent, and $R_g$ is the radius of gyration of the polymer coil.
36
37The 2D scattering intensity is calculated in the same way as the 1D,
38but where the *q* vector is redefined as
39
40.. math::
41
42    q = \sqrt{q_x^2 + q_y^2}
43
44References
45----------
46
47P Debye, *J. Phys. Colloid. Chem.*, 51 (1947) 18.
48
49R J Roe, *Methods of X-Ray and Neutron Scattering in Polymer Science*,
50Oxford University Press, New York (2000).
51
52http://www.ncnr.nist.gov/staff/hammouda/distance_learning/chapter_28.pdf
53"""
54
[2d81cfe]55import numpy as np
[d277229]56from numpy import inf
[3330bb4]57
58name = "mono_gauss_coil"
59title = "Scattering from monodisperse polymer coils"
60
61description = """
[404ebbd]62    Evaluates the scattering from
[3330bb4]63    monodisperse polymer chains.
64    """
65category = "shape-independent"
66
67# pylint: disable=bad-whitespace, line-too-long
68#   ["name", "units", default, [lower, upper], "type", "description"],
69parameters = [
70    ["i_zero", "1/cm", 70.0, [0.0, inf], "", "Intensity at q=0"],
[d277229]71    ["rg", "Ang", 75.0, [0.0, inf], "volume", "Radius of gyration"],
[3330bb4]72    ]
[ee60aa7]73# pylint: enable=bad-whitespace, line-too-long
[3330bb4]74
[d277229]75source = ["mono_gauss_coil.c"]
76have_Fq = False
[c5f7aa9]77effective_radius_type = ["R_g", "2R_g", "3R_g", "sqrt(5/3)*R_g"]
[3330bb4]78
79
[404ebbd]80def random():
[b297ba9]81    """Return a random parameter set for the model."""
[404ebbd]82    rg = 10**np.random.uniform(0, 4)
83    #rg = 1e3
84    pars = dict(
85        #scale=1, background=0,
86        i_zero=1e7, # i_zero is a simple scale
87        rg=rg,
88    )
89    return pars
90
[3330bb4]91demo = dict(scale=1.0, i_zero=70.0, rg=75.0, background=0.0)
92
93# these unit test values taken from SasView 3.1.2
94tests = [
95    [{'scale': 1.0, 'i_zero': 70.0, 'rg': 75.0, 'background': 0.0},
96     [0.0106939, 0.469418], [57.1241, 0.112859]],
97    ]
Note: See TracBrowser for help on using the repository browser.