Changeset db1d9d5 in sasmodels for sasmodels/models/hayter_msa.py


Ignore:
Timestamp:
Mar 28, 2019 3:16:51 PM (5 years ago)
Author:
Paul Kienzle <pkienzle@…>
Branches:
master, ticket-1257-vesicle-product, ticket_1156, ticket_822_more_unit_tests
Children:
8795b6f
Parents:
a34b811
Message:

merge with master

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/models/hayter_msa.py

    r0507e09 rdb1d9d5  
    11# Note: model title and parameter table are inserted automatically 
    22r""" 
    3 This calculates the structure factor (the Fourier transform of the pair 
    4 correlation function $g(r)$) for a system of charged, spheroidal objects 
    5 in a dielectric medium. When combined with an appropriate form factor 
    6 (such as sphere, core+shell, ellipsoid, etc), this allows for inclusion 
    7 of the interparticle interference effects due to screened coulomb repulsion 
    8 between charged particles. 
     3Calculates the interparticle structure factor for a system of charged, 
     4spheroidal, objects in a dielectric medium [1,2]. When combined with an 
     5appropriate form factor $P(q)$, this allows for inclusion of the 
     6interparticle interference effects due to screened Coulombic 
     7repulsion between the charged particles. 
    98 
    10 **This routine only works for charged particles**. If the charge is set to 
    11 zero the routine may self-destruct! For non-charged particles use a hard 
    12 sphere potential. 
     9.. note:: 
     10 
     11   This routine only works for charged particles! If the charge is set 
     12   to zero the routine may self-destruct! For uncharged particles use 
     13   the :ref:`hardsphere` $S(q)$ instead. The upper limit for the charge 
     14   is limited to 200e to avoid numerical instabilities. 
     15 
     16.. note:: 
     17 
     18   Earlier versions of SasView did not incorporate the so-called 
     19   $\beta(q)$ ("beta") correction [3] for polydispersity and non-sphericity. 
     20   This is only available in SasView versions 4.2.2 and higher. 
    1321 
    1422The salt concentration is used to compute the ionic strength of the solution 
    15 which in turn is used to compute the Debye screening length. At present 
    16 there is no provision for entering the ionic strength directly nor for use 
    17 of any multivalent salts, though it should be possible to simulate the effect 
    18 of this by increasing the salt concentration. The counterions are also 
    19 assumed to be monovalent. 
     23which in turn is used to compute the Debye screening length. There is no 
     24provision for entering the ionic strength directly. **At present the 
     25counterions are assumed to be monovalent**, though it should be possible 
     26to simulate the effect of multivalent counterions by increasing the salt 
     27concentration. 
    2028 
    21 In sasview the effective radius may be calculated from the parameters 
     29Over the range 0 - 100 C the dielectric constant $\kappa$ of water may be 
     30approximated with a maximum deviation of 0.01 units by the empirical 
     31formula [4] 
     32 
     33.. math:: 
     34 
     35    \kappa = 87.740 - 0.40008 T + 9.398x10^{-4} T^2 - 1.410x10^{-6} T^3 
     36 
     37where $T$ is the temperature in celsius. 
     38 
     39In SasView the effective radius may be calculated from the parameters 
    2240used in the form factor $P(q)$ that this $S(q)$ is combined with. 
    2341 
     
    3856 
    3957.. [#] J B Hayter and J Penfold, *Molecular Physics*, 42 (1981) 109-118 
     58 
    4059.. [#] J P Hansen and J B Hayter, *Molecular Physics*, 46 (1982) 651-656 
     60 
     61.. [#] M Kotlarchyk and S-H Chen, *J. Chem. Phys.*, 79 (1983) 2461-2469 
     62 
     63.. [#] C G Malmberg and A A Maryott, *J. Res. Nat. Bureau Standards*, 56 (1956) 2641 
    4164 
    4265Source 
     
    5073---------------------------- 
    5174 
    52 * **Author:**  
    53 * **Last Modified by:**  
    54 * **Last Reviewed by:**  
     75* **Author:** 
     76* **Last Modified by:** 
     77* **Last Reviewed by:** Steve King **Date:** March 28, 2019 
    5578* **Source added by :** Steve King **Date:** March 25, 2019 
    5679""" 
     
    7497 
    7598name = "hayter_msa" 
    76 title = "Hayter-Penfold rescaled MSA, charged sphere, interparticle S(Q) structure factor" 
     99title = "Hayter-Penfold Rescaled Mean Spherical Approximation (RMSA) structure factor for charged spheres" 
    77100description = """\ 
    78101    [Hayter-Penfold RMSA charged sphere interparticle S(Q) structure factor] 
    79         Interparticle structure factor S(Q)for a charged hard spheres. 
    80         Routine takes absolute value of charge, use HardSphere if charge 
    81         goes to zero. 
    82         In sasview the effective radius and volume fraction may be calculated 
    83         from the parameters used in P(Q). 
     102        Interparticle structure factor S(Q) for charged hard spheres. 
     103    This routine only works for charged particles! For uncharged particles 
     104    use the hardsphere S(q) instead. The "beta(q)" correction is available 
     105    in versions 4.2.2 and higher. 
    84106""" 
    85107 
     
    87109# pylint: disable=bad-whitespace, line-too-long 
    88110#             [ "name", "units", default, [lower, upper], "type", "description" ], 
     111# 
     112# NOTE: SMK, 28Mar19 The upper limit for charge is set to 200 to avoid instabilities noted by PK in 
     113#       Ticket #1152. Also see the thread in Ticket 859. The docs above also note that charge=0 will 
     114#       cause problems, yet the default parameters allowed it! After discussions with PK I have 
     115#       changed it to (an arbitarily) small but non-zero value.  But I haven't changed the low limit 
     116#       in function random() below. 
     117# 
    89118parameters = [ 
    90119    ["radius_effective", "Ang", 20.75,   [0, inf],    "volume", "effective radius of charged sphere"], 
    91120    ["volfraction",   "None",     0.0192, [0, 0.74],   "", "volume fraction of spheres"], 
    92     ["charge",        "e",   19.0,    [0, 200],    "", "charge on sphere (in electrons)"], 
     121    ["charge",        "e",   19.0,    [0.000001, 200],    "", "charge on sphere (in electrons)"], 
    93122    ["temperature",   "K",  318.16,   [0, 450],    "", "temperature, in Kelvin, for Debye length calculation"], 
    94123    ["concentration_salt",      "M",    0.0,    [0, inf], "", "conc of salt, moles/litre, 1:1 electolyte, for Debye length"], 
    95     ["dielectconst",  "None",    71.08,   [-inf, inf], "", "dielectric constant (relative permittivity) of solvent, default water, for Debye length"] 
     124    ["dielectconst",  "None",    71.08,   [-inf, inf], "", "dielectric constant (relative permittivity) of solvent, kappa, default water, for Debye length"] 
    96125    ] 
    97126# pylint: enable=bad-whitespace, line-too-long 
Note: See TracChangeset for help on using the changeset viewer.