source: sasmodels/sasmodels/models/HayterMSAsq.py @ d1fe925

gh-pages
Last change on this file since d1fe925 was d1fe925, checked in by ajj, 8 years ago

Creating gh_pages branch for docs

  • Property mode set to 100644
File size: 3.8 KB
Line 
1# Note: model title and parameter table are inserted automatically
2r"""
3This calculates the structure factor (the Fourier transform of the pair correlation function *g(r)*) for a system of
4charged, spheroidal objects in a dielectric medium. When combined with an appropriate form factor (such as sphere,
5core+shell, ellipsoid, etc), this allows for inclusion of the interparticle interference effects due to screened coulomb
6repulsion between charged particles.
7
8**This routine only works for charged particles**. If the charge is set to zero the routine will self-destruct!
9For non-charged particles use a hard sphere potential.
10
11The salt concentration is used to compute the ionic strength of the solution which in turn is used to compute the Debye
12screening length. At present there is no provision for entering the ionic strength directly nor for use of any
13multivalent salts. The counterions are also assumed to be monovalent.
14
15For 2D data: The 2D scattering intensity is calculated in the same way as 1D, where the *q* vector is defined as
16
17.. math::
18
19    Q = \sqrt{Q_x^2 + Q_y^2}
20
21==============  ========  =============
22Parameter name  Units     Default value
23==============  ========  =============
24effect_radius   |Ang|     20.8
25charge          *e*       19
26volfraction     None      0.2
27temperature     K         318
28salt conc       M         0
29dielectconst    None      71.1
30==============  ========  =============
31
32.. image:: img/HayterMSAsq_227.jpg
33
34*Figure. 1D plot using the default values (in linear scale).*
35
36REFERENCE
37
38J B Hayter and J Penfold, *Molecular Physics*, 42 (1981) 109-118
39
40J P Hansen and J B Hayter, *Molecular Physics*, 46 (1982) 651-656
41"""
42
43#  dp[0] = 2.0*effect_radius();
44#  dp[1] = fabs(charge());
45#  dp[2] = volfraction();
46#  dp[3] = temperature();
47#  dp[4] = saltconc();
48#  dp[5] = dielectconst();
49
50from numpy import inf
51
52source = ["HayterMSAsq_kernel.c"]
53
54name = "HayterMSAsq"
55title = "Hayter-Penfold MSA charged sphere interparticle S(Q) structure factor"
56description = """\
57    [Hayter-Penfold MSA charged sphere interparticle S(Q) structure factor]
58        Interparticle structure factor S(Q)for a charged hard spheres.
59        Routine takes absolute value of charge, use HardSphere if charge goes to zero.
60        In sasview the effective radius will be calculated from the
61        parameters used in P(Q).
62"""
63#             [ "name", "units", default, [lower, upper], "type", "description" ],
64parameters = [["effect_radius", "Ang", 20.75, [0, inf], "volume",
65               "effective radius of hard sphere"],
66              ["charge", "e", 19.0, [0, inf], "",
67               "charge on sphere (in electrons)"],
68              ["volfraction", "", 0.0192, [0, 0.74], "",
69               "volume fraction of spheres"],
70              ["temperature", "K", 318.16, [0, inf], "",
71               "temperature, in Kelvin, for Debye length calculation"],
72              ["saltconc", "M", 0.0, [-inf, inf], "",
73               "conc of salt, 1:1 electolyte, for Debye length"],
74              ["dielectconst", "", 71.08, [-inf, inf], "",
75               "dielectric constant of solvent (default water), for Debye length"],
76             ]
77
78# No volume normalization despite having a volume parameter
79# This should perhaps be volume normalized?
80form_volume = """
81    return 1.0;
82    """
83Iqxy = """
84    // never called since no orientation or magnetic parameters.
85    return Iq(sqrt(qx*qx+qy*qy), IQ_PARAMETERS);
86    """
87# ER defaults to 0.0
88# VR defaults to 1.0
89
90oldname = 'HayterMSAStructure'
91oldpars = dict()
92# default parameter set,  use  compare.sh -midQ -linear
93# note the calculation varies in different limiting cases so a wide range of parameters will be required for a thorough test!
94# odd that the default st has saltconc zero
95demo = dict(effect_radius = 20.75,charge=19.0,volfraction = 0.0192,temperature=318.16,saltconc=0.05,dielectconst=71.08,effect_radius_pd = 0.1,effect_radius_pd_n = 40)
96
Note: See TracBrowser for help on using the repository browser.