Changeset 54954e1 in sasmodels


Ignore:
Timestamp:
Mar 17, 2016 9:58:53 AM (9 years ago)
Author:
richardh
Branches:
master, core_shell_microgels, costrafo411, magnetic_model, release_v0.94, release_v0.95, ticket-1257-vesicle-product, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
Children:
03e8a6e, 3a45c2c
Parents:
15bd6e7
Message:

renam volfrac in adsorbedlayer, sort some docs bugs

Location:
sasmodels/models
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/models/adsorbed_layer.py

    rcb97bff r54954e1  
    1717     I(q) = \text{scale} \cdot(\rho_\text{poly}-\rho_\text{solvent})^2    \left[\frac{6\pi\phi_\text{core}}{Q^2}\frac{\Gamma^2}{\delta_\text{poly}^2R_\text{core}} \exp(-Q^2\sigma^2)\right] + \text{background} 
    1818 
    19 where *scale* is a scale factor, |rho|\ :sub:`poly` is the sld of the polymer (or surfactant) layer, |rho|\ :sub:`solv` is the sld of the solvent/medium and cores, |phi|\ :sub:`core` is the volume fraction of the core paraticles, |delta|\ :sub:`poly` is the bulk density of the polymer, |biggamma| is the adsorbed amount, and |sigma| is the second moment of the thickness distribution. 
     19where *scale* is a scale factor, |rho|\ :sub:`poly` is the sld of the polymer (or surfactant) layer, |rho|\ :sub:`solv` is the sld of the solvent/medium and cores, |phi|\ :sub:`core` is the volume fraction of the core particles, |delta|\ :sub:`poly` is the bulk density of the polymer, |biggamma| is the adsorbed amount, and |sigma| is the second moment of the thickness distribution. 
    2020 
    2121Note that all parameters except the |sigma| are correlated so fitting more than one of these parameters will generally fail. Also note that unlike other shape models, no volume normalization is applied to this model (the calculation is exact). 
     
    4646              ["density_poly", "g/cm3", 0.7, [0.0, inf], "", "Polymer density"], 
    4747              ["radius", "Ang", 500.0, [0.0, inf], "", "Particle radius"], 
    48               ["vol_frac", "None", 0.14, [0.0, inf], "", "Particle vol fraction"], 
     48              ["volfraction", "None", 0.14, [0.0, inf], "", "Particle vol fraction"], 
    4949              ["polymer_sld", "1/Ang^2", 1.5e-06, [-inf, inf], "", "Polymer SLD"], 
    5050              ["solvent_sld", "1/Ang^2", 6.3e-06, [-inf, inf], "", "Solvent SLD"]] 
     
    5252# NB: Scale and Background are implicit parameters on every model 
    5353def Iq(q, second_moment, adsorbed_amount, density_poly, radius,  
    54         vol_frac, polymer_sld, solvent_sld): 
     54        volfraction, polymer_sld, solvent_sld): 
    5555    # pylint: disable = missing-docstring 
    5656    deltarhosqrd =  (polymer_sld - solvent_sld) * (polymer_sld - solvent_sld) 
    57     numerator =  6.0 * pi * vol_frac * (adsorbed_amount * adsorbed_amount) 
     57    numerator =  6.0 * pi * volfraction * (adsorbed_amount * adsorbed_amount) 
    5858    denominator =  (q * q) * (density_poly * density_poly) * radius 
    5959    eterm =  exp(-1.0 * (q * q) * (second_moment * second_moment)) 
     
    7373            density_poly = 0.7, 
    7474            radius = 500.0, 
    75             vol_frac = 0.14, 
     75            volfraction = 0.14, 
    7676            polymer_sld = 1.5e-06, 
    7777            solvent_sld = 6.3e-06, 
     
    8484               density_poly = 'density_poly', 
    8585               radius = 'radius_core', 
    86                vol_frac = 'volf_cores', 
     86               volfraction = 'volf_cores', 
    8787               polymer_sld = 'sld_poly', 
    8888               solvent_sld = 'sld_solv', 
     
    9191tests =  [ 
    9292    [{'scale': 1.0, 'second_moment': 23.0, 'adsorbed_amount': 1.9,  
    93      'density_poly': 0.7, 'radius': 500.0, 'vol_frac': 0.14,  
     93     'density_poly': 0.7, 'radius': 500.0, 'volfraction': 0.14,  
    9494     'polymer_sld': 1.5e-06, 'solvent_sld': 6.3e-06, 'background': 0.0}, 
    9595     [0.0106939, 0.469418], [73.741, 9.65391e-53]], 
  • sasmodels/models/hayter_msa.py

    rd529d93 r54954e1  
    5151#  dp[2] = volfraction(); 
    5252#  dp[3] = temperature(); 
    53 #  dp[4] = saltconc(); 
     53#  dp[4] = salt_concentration(); 
    5454#  dp[5] = dielectconst(); 
    5555 
     
    7676    ["volfraction",   "None",     0.0192, [0, 0.74],   "", "volume fraction of spheres"], 
    7777    ["temperature",   "K",  318.16,   [0, inf],    "", "temperature, in Kelvin, for Debye length calculation"], 
    78     ["saltconc",      "M",    0.0,    [-inf, inf], "", "conc of salt, moles/litre, 1:1 electolyte, for Debye length"], 
     78    ["salt_concentration",      "M",    0.0,    [-inf, inf], "", "conc of salt, moles/litre, 1:1 electolyte, for Debye length"], 
    7979    ["dielectconst",  "None",    71.08,   [-inf, inf], "", "dielectric constant (relative permittivity) of solvent, default water, for Debye length"] 
    8080    ] 
     
    9696oldname = 'HayterMSAStructure' 
    9797#oldpars = dict(effect_radius="radius_effective",effect_radius_pd="radius_effective_pd",effect_radius_pd_n="radius_effective_pd_n") 
    98 oldpars = dict(radius_effective="effect_radius",radius_effective_pd="effect_radius_pd",radius_effective_pd_n="effect_radius_pd_n") 
     98oldpars = dict(radius_effective="effect_radius",radius_effective_pd="effect_radius_pd",radius_effective_pd_n="effect_radius_pd_n",salt_concentration="saltconc") 
    9999#oldpars = dict( ) 
    100100# default parameter set,  use  compare.sh -midQ -linear 
    101101# note the calculation varies in different limiting cases so a wide range of 
    102102# parameters will be required for a thorough test! 
    103 # odd that the default st has saltconc zero 
     103# odd that the default st has salt_concentration zero 
    104104demo = dict(radius_effective=20.75, 
    105105            charge=19.0, 
    106106            volfraction=0.0192, 
    107107            temperature=318.16, 
    108             saltconc=0.05, 
     108            salt_concentration=0.05, 
    109109            dielectconst=71.08, 
    110110            radius_effective_pd=0.1, 
     
    120120      'volfraction': 0.0192, 
    121121      'temperature': 298.0, 
    122       'saltconc': 0, 
     122      'salt_concentration': 0, 
    123123      'dielectconst': 78.0, 
    124124      'radius_effective_pd': 0}, 
     
    130130      'volfraction': 0.0192, 
    131131      'temperature': 298.0, 
    132       'saltconc': 0.05, 
     132      'salt_concentration': 0.05, 
    133133      'dielectconst': 78.0, 
    134134      'radius_effective_pd': 0.1, 
  • sasmodels/models/stickyhardsphere.py

    r0784c18 r54954e1  
    8888    #   [ "name", "units", default, [lower, upper], "type", 
    8989    #     "description" ], 
    90     ["effect_radius", "Ang", 50.0, [0, inf], "volume", 
     90    ["radius_effective", "Ang", 50.0, [0, inf], "volume", 
    9191     "effective radius of hard sphere"], 
    9292    ["volfraction", "", 0.2, [0, 0.74], "", 
     
    113113    eta = volfraction/onemineps/onemineps/onemineps; 
    114114 
    115     sig = 2.0 * effect_radius; 
     115    sig = 2.0 * radius_effective; 
    116116    aa = sig/onemineps; 
    117117    etam1 = 1.0 - eta; 
     
    179179 
    180180oldname = 'StickyHSStructure' 
    181 oldpars = dict() 
    182 demo = dict(effect_radius=200, volfraction=0.2, perturb=0.05, 
    183             stickiness=0.2, effect_radius_pd=0.1, effect_radius_pd_n=40) 
     181oldpars = dict(radius_effective="effect_radius",radius_effective_pd="effect_radius_pd",radius_effective_pd_n="effect_radius_pd_n") 
     182demo = dict(radius_effective=200, volfraction=0.2, perturb=0.05, 
     183            stickiness=0.2, radius_effective_pd=0.1, radius_effective_pd_n=40) 
    184184# 
    185185tests = [ 
    186         [ {'scale': 1.0, 'background' : 0.0, 'effect_radius' : 50.0, 'perturb' : 0.05, 'stickiness' : 0.2, 'volfraction' : 0.1, 
    187            'effect_radius_pd' : 0}, [0.001, 0.003], [1.09718, 1.087830]] 
     186        [ {'scale': 1.0, 'background' : 0.0, 'radius_effective' : 50.0, 'perturb' : 0.05, 'stickiness' : 0.2, 'volfraction' : 0.1, 
     187           'radius_effective_pd' : 0}, [0.001, 0.003], [1.09718, 1.087830]] 
    188188        ] 
    189189 
Note: See TracChangeset for help on using the changeset viewer.