Changes in / [17bbadd:754e27b] in sasmodels
- Location:
- sasmodels/models
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
sasmodels/models/hardsphere.py
r97e6d3c r034e19a 35 35 from numpy import inf 36 36 37 name = "hardsphere _fish"38 title = "Hard sphere structure factor from FISH, with Percus-Yevick closure"37 name = "hardsphere" 38 title = "Hard sphere structure factor, with Percus-Yevick closure" 39 39 description = """\ 40 40 [Hard sphere structure factor, with Percus-Yevick closure] -
sasmodels/models/stickyhardsphere.py
r13ed84c r034e19a 122 122 //C SOLVE QUADRATIC FOR LAMBDA 123 123 //C 124 qa = eta/ 12.0;125 qb = -1.0*(stickiness + eta/etam1);124 qa = eta/6.0; 125 qb = stickiness + eta/etam1; 126 126 qc = (1.0 + eta/2.0)/etam1sq; 127 radic = qb*qb - 4.0*qa*qc;127 radic = qb*qb - 2.0*qa*qc; 128 128 if(radic<0) { 129 129 //if(x>0.01 && x<0.015) … … 133 133 } 134 134 //C KEEP THE SMALLER ROOT, THE LARGER ONE IS UNPHYSICAL 135 lam = (-1.0*qb-sqrt(radic))/(2.0*qa); 136 lam2 = (-1.0*qb+sqrt(radic))/(2.0*qa); 135 radic = sqrt(radic); 136 lam = (qb-radic)/qa; 137 lam2 = (qb+radic)/qa; 137 138 if(lam2<lam) { 138 139 lam = lam2; … … 186 187 tests = [ 187 188 [ {'scale': 1.0, 'background' : 0.0, 'effect_radius' : 50.0, 'perturb' : 0.05, 'stickiness' : 0.2, 'volfraction' : 0.1, 188 'effect_radius_pd' : 0}, [0.001 ], [1.09718]]189 'effect_radius_pd' : 0}, [0.001, 0.003], [1.09718, 1.087830]] 189 190 ] 190 191
Note: See TracChangeset
for help on using the changeset viewer.