SasView / sasmodels

Package for calculation of small angle scattering models using OpenCL.
BSD 3-Clause "New" or "Revised" License
15 stars 27 forks source link

Error in documentation for gel_fit model #538

Closed smk78 closed 1 year ago

smk78 commented 1 year ago

User ZhouQ noticed the following about the gel_fit model:

From your manual, the scattered intensity is provided by image However, from Shibayama’s paper, the Lorentzian part is given by image Considering that when D = 2, the Lorentzian part will be reduced to the Ornstein-Zernicke equation, as you and Shibayama mentioned, I believe the bottom form is correct. But I am unsure whether it is a typo in the manual or an incorrect expression that may affect the fitting results (a bug?).

Examination of the source code shows:

     // Lorentzian Term
    ////////////////////////double a(x[i]*x[i]*zeta*zeta);
    double lorentzian_term = square(q*cor_length);
    lorentzian_term = 1.0 + ((fractal_dim + 1.0)/3.0)*lorentzian_term;
    lorentzian_term = pow(lorentzian_term, fractal_dim/2.0 );

which corresponds with the lower (Shibayama) expression so the formatting of the expression in the model doc string needs revising.