source: sasmodels/sasmodels/models/mono_gauss_coil.py @ 38d2c97

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

Conversion of DebyeModel?

  • Property mode set to 100644
File size: 3.0 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 poly_gauss_coil model.
11
12Definition
13----------
14
15     *I(q)* = *scale* x *P(q)* + *background*
16         
17where
18
19     *scale* = |phi|\ :sub:`poly` x *V* x (|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
31.. figure:: img/mono_gauss_coil_1d.jpg
32
33    1D plot using the default values.
34
35The 2D scattering intensity is calculated in the same way as the 1D, but where the *q* vector is redefined as
36
37.. image:: img/2d_q_vector.gif
38
39References
40----------
41
42P Debye, *J. Phys. Colloid. Chem.*, 51 (1947) 18.
43
44R J Roe, *Methods of X-Ray and Neutron Scattering in Polymer Science*, Oxford University Press, New York (2000).
45
46http://www.ncnr.nist.gov/staff/hammouda/distance_learning/chapter_28.pdf
47"""
48
49from numpy import inf, sqrt, exp
50
51name =  "mono_gauss_coil"
52title =  "Scattering from monodisperse polymer coils"
53
54description =  """
55    Evaluates the scattering from
56        monodisperse polymer chains.
57    """
58category =  "shape-independent"
59
60#             ["name", "units", default, [lower, upper], "type", "description"],
61parameters =  [["radius_gyration", "Ang", 50.0, [0.0, inf], "", "Radius of gyration"]]
62
63# NB: Scale and Background are implicit parameters on every model
64def Iq(q, radius_gyration):
65    # pylint: disable = missing-docstring
66    z = (x * radius_gyration) * (x * radius_gyration)
67    if x == 0:
68       inten = 1.0
69    else:
70       inten = 2.0 * (exp(-z) + z - 1.0 ) / (z * z)
71    return inten
72Iq.vectorized =  True  # Iq accepts an array of q values
73
74def Iqxy(qx, qy, *args):
75    # pylint: disable = missing-docstring
76    return Iq(sqrt(qx ** 2 + qy ** 2), *args)
77Iqxy.vectorized =  True # Iqxy accepts an array of qx, qy values
78
79demo =  dict(scale = 1.0,
80            radius_gyration = 50.0,
81            background = 0.0)
82
83oldname =  "DebyeModel"
84oldpars =  dict(scale = 'scale',
85               radius_gyration = 'rg',
86               background = 'background')
87
88tests =  [
89    [{'scale': 1.0, 'radius_gyration': 50.0, 'background': 0.0},
90     [0.0106939, 0.469418], [0.911141, 0.00362394]],
91    ]
Note: See TracBrowser for help on using the repository browser.