Changeset d529d93 in sasmodels for sasmodels/models/hardsphere.py
- Timestamp:
- Mar 17, 2016 8:16:55 AM (8 years ago)
- 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
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sasmodels/models/hardsphere.py
r8e45182 rd529d93 3 3 spherical particles interacting through hard sphere (excluded volume) 4 4 interactions. 5 May be a reasonable approximation for other shapes of particles that 6 freely rotate, and for moderately polydisperse systems. Though strictly 7 the maths needs to be modified (no \Beta(Q) correction yet in sasview). 5 8 6 The calculation uses the Percus-Yevick closure where the interparticle 9 radius_effective is the effective hard sphere radius. 10 volfraction is the volume fraction occupied by the spheres. 11 12 In sasview the effective radius may be calculated from the parameters 13 used in the form factor $P(q)$ that this $S(q)$ is combined with. 14 15 For numerical stability the computation uses a Taylor series expansion 16 at very small $qR$, there may be a very minor glitch at the transition point 17 in some circumstances. 18 19 The S(Q) uses the Percus-Yevick closure where the interparticle 7 20 potential is 8 21 … … 44 57 systems. Though strictly the maths needs to be modified - 45 58 which sasview does not do yet. 46 effect_radiusis the hard sphere radius59 radius_effective is the hard sphere radius 47 60 volfraction is the volume fraction occupied by the spheres. 48 61 """ … … 51 64 52 65 # ["name", "units", default, [lower, upper], "type","description"], 53 parameters = [[" effect_radius", "Ang", 50.0, [0, inf], "volume",66 parameters = [["radius_effective", "Ang", 50.0, [0, inf], "volume", 54 67 "effective radius of hard sphere"], 55 68 ["volfraction", "", 0.2, [0, 0.74], "", … … 66 79 double D,A,B,G,X,X2,X4,S,C,FF,HARDSPH; 67 80 68 if(fabs( effect_radius) < 1.E-12) {81 if(fabs(radius_effective) < 1.E-12) { 69 82 HARDSPH=1.0; 70 83 return(HARDSPH); … … 75 88 A= (1.+2.*volfraction)*D; 76 89 A *=A; 77 X=fabs(q* effect_radius*2.0);90 X=fabs(q*radius_effective*2.0); 78 91 79 92 if(X < 5.E-06) { … … 138 151 # VR defaults to 1.0 139 152 140 demo = dict( effect_radius=200, volfraction=0.2, effect_radius_pd=0.1, effect_radius_pd_n=40)153 demo = dict(radius_effective=200, volfraction=0.2, radius_effective_pd=0.1, radius_effective_pd_n=40) 141 154 oldname = 'HardsphereStructure' 142 oldpars = dict( )155 oldpars = dict(radius_effective="effect_radius",radius_effective_pd="effect_radius_pd",radius_effective_pd_n="effect_radius_pd_n") 143 156 # Q=0.001 is in the Taylor series, low Q part, so add Q=0.1, assuming double precision sasview is correct 144 157 tests = [ 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]] 147 160 ] 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.