Changeset 8f04da4 in sasmodels for sasmodels/models/squarewell.py
- Timestamp:
- Aug 2, 2017 12: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/squarewell.py
r3330bb4 r8f04da4 91 91 double S,C,SL,CL; 92 92 x= q; 93 93 94 94 req = radius_effective; 95 95 phis = volfraction; 96 96 edibkb = welldepth; 97 97 lambda = wellwidth; 98 98 99 99 sigma = req*2.; 100 100 eta = phis; … … 110 110 beta = -(eta/3.0) * ( 18. + 20.*eta - 12.*eta2 + eta4 )/etam14; 111 111 gamm = 0.5*eta*( sk + eta3*(eta-4.) )/etam14; 112 112 113 113 // calculate the structure factor 114 114 115 115 sk = x*sigma; 116 116 sk2 = sk*sk; … … 125 125 ck = -24.0*eta*( t1 + t2 + t3 + t4 )/sk3/sk3; 126 126 struc = 1./(1.-ck); 127 127 128 128 return(struc); 129 129 """ … … 132 132 # VR defaults to 1.0 133 133 134 def random(): 135 import numpy as np 136 pars = dict( 137 scale=1, background=0, 138 radius_effective=10**np.random.uniform(1, 4.7), 139 volfraction=np.random.uniform(0.00001, 0.08), 140 welldepth=np.random.uniform(0, 1.5), 141 wellwidth=np.random.uniform(1, 1.2), 142 ) 143 return pars 144 134 145 demo = dict(radius_effective=50, volfraction=0.04, welldepth=1.5, 135 146 wellwidth=1.2, radius_effective_pd=0, radius_effective_pd_n=0) 136 147 # 137 148 tests = [ 138 [{'scale': 1.0, 'background' : 0.0, 'radius_effective' : 50.0, 139 'volfraction' : 0.04,'welldepth' : 1.5, 'wellwidth' : 1.2, 140 'radius_effective_pd' : 0}, 141 [0.001], [0.97665742]], 149 [{'scale': 1.0, 'background': 0.0, 'radius_effective': 50.0, 150 'volfraction': 0.04,'welldepth': 1.5, 'wellwidth': 1.2, 151 'radius_effective_pd': 0}, [0.001], [0.97665742]], 142 152 ] 143 153 # ADDED by: converting from sasview RKH ON: 16Mar2016
Note: See TracChangeset
for help on using the changeset viewer.