Changeset 8f04da4 in sasmodels for sasmodels/models/hardsphere.py
- Timestamp:
- Aug 2, 2017 2:53:56 AM (7 years ago)
- Branches:
- master, core_shell_microgels, costrafo411, magnetic_model, ticket-1257-vesicle-product, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
- Children:
- bd21b12
- Parents:
- 1511c37c
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sasmodels/models/hardsphere.py
r40a87fa r8f04da4 75 75 Iq = r""" 76 76 double D,A,B,G,X,X2,X4,S,C,FF,HARDSPH; 77 // these are c compiler instructions, can also put normal code inside the "if else" structure 77 // these are c compiler instructions, can also put normal code inside the "if else" structure 78 78 #if FLOAT_SIZE > 4 79 79 // double precision orig had 0.2, don't call the variable cutoff as PAK already has one called that! Must use UPPERCASE name please. … … 82 82 #else 83 83 // 0.1 bad, 0.2 OK, 0.3 good, 0.4 better, 0.8 no good 84 #define CUTOFFHS 0.4 84 #define CUTOFFHS 0.4 85 85 #endif 86 86 … … 110 110 if(X < CUTOFFHS) { 111 111 // RKH Feb 2016, use Taylor series expansion for small X 112 // else no obvious way to rearrange the equations to avoid needing a very high number of significant figures. 113 // Series expansion found using Mathematica software. Numerical test in .xls showed terms to X^2 are sufficient 114 // for 5 or 6 significant figures, but I put the X^4 one in anyway 112 // else no obvious way to rearrange the equations to avoid needing a very high number of significant figures. 113 // Series expansion found using Mathematica software. Numerical test in .xls showed terms to X^2 are sufficient 114 // for 5 or 6 significant figures, but I put the X^4 one in anyway 115 115 //FF = 8*A +6*B + 4*G - (0.8*A +2.0*B/3.0 +0.5*G)*X2 +(A/35. +B/40. +G/50.)*X4; 116 116 // refactoring the polynomial makes it very slightly faster (0.5 not 0.6 msec) … … 153 153 """ 154 154 155 def random(): 156 import numpy as np 157 pars = dict( 158 scale=1, background=0, 159 radius_effective=10**np.random.uniform(1, 4), 160 volfraction=10**np.random.uniform(-2, 0), # high volume fraction 161 ) 162 return pars 163 155 164 # ER defaults to 0.0 156 165 # VR defaults to 1.0
Note: See TracChangeset
for help on using the changeset viewer.