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

core_shell_microgelscostrafo411magnetic_modelrelease_v0.94release_v0.95ticket-1257-vesicle-productticket_1156ticket_1265_superballticket_822_more_unit_tests
Last change on this file since bf227cd was bf227cd, checked in by smk78, 8 years ago

Improved

  • Property mode set to 100644
File size: 3.1 KB
Line 
1#mono_gauss_coil model
2#conversion of DebyeModel.py
3#converted by Steve King, Mar 2016
4
5
6
7r"""
8This 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 To describe the scattering from *monodisperse* 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.. image:: img/2d_q_vector.gif
34
35References
36----------
37
38P Debye, *J. Phys. Colloid. Chem.*, 51 (1947) 18.
39
40R J Roe, *Methods of X-Ray and Neutron Scattering in Polymer Science*, Oxford University Press, New York (2000).
41
42http://www.ncnr.nist.gov/staff/hammouda/distance_learning/chapter_28.pdf
43"""
44
45from numpy import inf, sqrt, exp
46
47name =  "mono_gauss_coil"
48title =  "Scattering from monodisperse polymer coils"
49
50description =  """
51    Evaluates the scattering from
52        monodisperse polymer chains.
53    """
54category =  "shape-independent"
55
56#             ["name", "units", default, [lower, upper], "type", "description"],
57parameters =  [["i_zero", "1/cm", 1.0, [-inf, inf], "", "Intensity at q=0"],
58               ["radius_gyration", "Ang", 50.0, [0.0, inf], "", "Radius of gyration"]]
59
60# NB: Scale and Background are implicit parameters on every model
61def Iq(q, radius_gyration):
62    # pylint: disable = missing-docstring
63    z = (x * radius_gyration) * (x * radius_gyration)
64    if x == 0:
65       inten = 1.0
66    else:
67       inten = i_zero * 2.0 * (exp(-z) + z - 1.0 ) / (z * z)
68    return inten
69Iq.vectorized =  True  # Iq accepts an array of q values
70
71def Iqxy(qx, qy, *args):
72    # pylint: disable = missing-docstring
73    return Iq(sqrt(qx ** 2 + qy ** 2), *args)
74Iqxy.vectorized =  True # Iqxy accepts an array of qx, qy values
75
76demo =  dict(scale = 1.0,
77            i_zero = 1.0,
78            radius_gyration = 50.0,
79            background = 0.0)
80
81oldname =  "DebyeModel"
82oldpars =  dict(scale = 'scale',
83               radius_gyration = 'rg',
84               background = 'background')
85
86tests =  [
87    [{'scale': 1.0, 'radius_gyration': 50.0, 'background': 0.0},
88     [0.0106939, 0.469418], [0.911141, 0.00362394]],
89    ]
Note: See TracBrowser for help on using the repository browser.