Changeset 0ad5703 in sasview for sansmodels/src
- Timestamp:
- Mar 24, 2011 2:11:05 PM (14 years ago)
- Branches:
- master, ESS_GUI, ESS_GUI_Docs, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_iss959, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc, costrafo411, magnetic_scatt, release-4.1.1, release-4.1.2, release-4.2.2, release_4.0.1, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
- Children:
- 389c991
- Parents:
- 50764a4
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sansmodels/src/sans/models/c_models/parameters.cpp
r59b9b675 r0ad5703 160 160 npts = 11; 161 161 width = 0.0; 162 nsigmas = 1. 0;162 nsigmas = 1.73205; 163 163 }; 164 164 … … 172 172 double rectangle_weight(double mean, double sigma, double x) { 173 173 double vary, expo_value; 174 double sig = fabs(sigma);175 if (x>= (mean- sig) && x<(mean+sig)){174 double wid = fabs(sigma) * sqrt(3.0); 175 if (x>= (mean-wid) && x<=(mean+wid)){ 176 176 return 1.0; 177 177 } … … 193 193 width = 0.0; 194 194 npts = 1; 195 nsigmas = 1. 0;195 nsigmas = 1.73205; 196 196 } 197 197 … … 228 228 229 229 LogNormalDispersion :: LogNormalDispersion() { 230 npts = 1 1;230 npts = 15; 231 231 width = 0.0; 232 nsigmas = 3.0;232 nsigmas = 4.0; 233 233 }; 234 234 … … 243 243 244 244 double sigma2 = pow(sigma, 2.0); 245 return 1.0/(x*sigma 2) * exp( -pow((log(x) -mean), 2.0) / (2.0*sigma2));245 return 1.0/(x*sigma) * exp( -pow((log(x) -log(mean)), 2.0) / (2.0*sigma2)); 246 246 247 247 } … … 259 259 width = 0.0; 260 260 npts = 1; 261 nsigmas = 3.0;261 nsigmas = 4.0; 262 262 } 263 263 … … 269 269 } else { 270 270 for(int i=0; i<npts; i++) { 271 // Note that the definition of sigma is different from Gaussian 271 272 if ((*par).has_min==false){ 272 // width = sigma for angles 273 // sig for angles 274 sig = width / value; 275 } 276 else{ 277 // by lognormal definition, PD is same as sigma 273 278 sig = width; 274 279 } 275 else{ 276 //width = polydispersity (=sigma/value) for length 277 sig = width * value; 278 } 280 279 281 // We cover n(nsigmas) times sigmas on each side of the mean 280 282 double val = value + sig * (2.0*nsigmas*double(i)/double(npts-1) - nsigmas);
Note: See TracChangeset
for help on using the changeset viewer.