Changeset d529d93 in sasmodels for sasmodels/models/hardsphere.py


Ignore:
Timestamp:
Mar 17, 2016 8:16:55 AM (8 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:
3a45c2c, 0784c18
Parents:
c5dadbb
Message:

updated docs for several S(Q)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/models/hardsphere.py

    r8e45182 rd529d93  
    33spherical particles interacting through hard sphere (excluded volume) 
    44interactions. 
     5May be a reasonable approximation for other shapes of particles that  
     6freely rotate, and for moderately polydisperse systems. Though strictly  
     7the maths needs to be modified (no \Beta(Q) correction yet in sasview). 
    58 
    6 The calculation uses the Percus-Yevick closure where the interparticle 
     9radius_effective is the effective hard sphere radius. 
     10volfraction is the volume fraction occupied by the spheres. 
     11 
     12In sasview the effective radius may be calculated from the parameters 
     13used in the form factor $P(q)$ that this $S(q)$ is combined with. 
     14 
     15For numerical stability the computation uses a Taylor series expansion  
     16at very small $qR$, there may be a very minor glitch at the transition point 
     17in some circumstances. 
     18 
     19The S(Q) uses the Percus-Yevick closure where the interparticle 
    720potential is 
    821 
     
    4457        systems. Though strictly the maths needs to be modified - 
    4558    which sasview does not do yet. 
    46     effect_radius is the hard sphere radius 
     59    radius_effective is the hard sphere radius 
    4760    volfraction is the volume fraction occupied by the spheres. 
    4861""" 
     
    5164 
    5265#             ["name", "units", default, [lower, upper], "type","description"], 
    53 parameters = [["effect_radius", "Ang", 50.0, [0, inf], "volume", 
     66parameters = [["radius_effective", "Ang", 50.0, [0, inf], "volume", 
    5467               "effective radius of hard sphere"], 
    5568              ["volfraction", "", 0.2, [0, 0.74], "", 
     
    6679      double D,A,B,G,X,X2,X4,S,C,FF,HARDSPH; 
    6780 
    68       if(fabs(effect_radius) < 1.E-12) { 
     81      if(fabs(radius_effective) < 1.E-12) { 
    6982               HARDSPH=1.0; 
    7083               return(HARDSPH); 
     
    7588      A= (1.+2.*volfraction)*D; 
    7689      A *=A; 
    77       X=fabs(q*effect_radius*2.0); 
     90      X=fabs(q*radius_effective*2.0); 
    7891 
    7992      if(X < 5.E-06) { 
     
    138151# VR defaults to 1.0 
    139152 
    140 demo = dict(effect_radius=200, volfraction=0.2, effect_radius_pd=0.1, effect_radius_pd_n=40) 
     153demo = dict(radius_effective=200, volfraction=0.2, radius_effective_pd=0.1, radius_effective_pd_n=40) 
    141154oldname = 'HardsphereStructure' 
    142 oldpars = dict() 
     155oldpars = dict(radius_effective="effect_radius",radius_effective_pd="effect_radius_pd",radius_effective_pd_n="effect_radius_pd_n") 
    143156# Q=0.001 is in the Taylor series, low Q part, so add Q=0.1, assuming double precision sasview is correct 
    144157tests = [ 
    145         [ {'scale': 1.0, 'background' : 0.0, 'effect_radius' : 50.0, 'volfraction' : 0.2, 
    146            'effect_radius_pd' : 0}, [0.001,0.1], [0.209128,0.930587]] 
     158        [ {'scale': 1.0, 'background' : 0.0, 'radius_effective' : 50.0, 'volfraction' : 0.2, 
     159           'radius_effective_pd' : 0}, [0.001,0.1], [0.209128,0.930587]] 
    147160        ] 
    148  
     161# ADDED by: RKH  ON: 16Mar2016  using equations from FISH as better than orig sasview, see notes above. Added Taylor expansions at small Q,  
Note: See TracChangeset for help on using the changeset viewer.