verify accuracy of fractal S(q) for small q#722
Conversation
|
The only change to GUI users here is the addition of the DOI for the reference to documentation which Should be accepted. The other changes are to lib files which as far as I know are not currently available through the GUI though in principle are available through scripting? Probably we just need a code review here? |
| const double t3 = pow(1.0 + 1.0/square(q*cor_length), -0.5*Dm1); | ||
| const double t1 = pow(cor_length/radius, fractal_dim) * sas_gamma(fractal_dim+1.); | ||
| const double t2 = sin((fractal_dim-1.)*atan(q*cor_length))/((fractal_dim-1)*q*cor_length); | ||
| const double t3 = pow(1. + square(q*cor_length), -0.5*(fractal_dim-1.)); |
There was a problem hiding this comment.
Regarding the transformation, I multiplied
I then rearranged
Limit as
Limit as
Limit as
Further check: Limit
The equations for the fractal S(q) model were complex enough that it was not immediately obvious how they would behave at small q.
This PR rearranges the equations to make the limiting cases much more apparent, and checks them against the original equations from Teixeira (1988) using 500 bit precision.
The numpy version of the equations was added to sasmodels.special so it will be available for pure python models.