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

Correct formatting of equation for I(Q) in gel_fit model #541

Closed smk78 closed 1 year ago

smk78 commented 1 year ago

This PR addresses the typo reported in https://github.com/SasView/sasmodels/issues/538, and improves the overall formatting.

pkienzle commented 1 year ago

The equations now match the code but the variables are not tied to the parameter names.

I suggest using $\xi$ for correlation length instead of $a_1$ and $R_g$ instead of $a_2$, pulling the 1/3 into the Guinier term as is done in the first reference.

The first paragraph uses $a1$ and $a2$. If we don't change them to $\xi$ and $R_g$ then we should be $a_1$ and $a_2$ instead.

We should use \exp rather than exp in the Guinier term.

The use of I(0)_L and I(0)_G is unusual. The first ref uses I_L(0) and I_G(0).

I'm guessing the approximation sign is in the wrong place. It is written as $a_2^2 \approx R_g^2/3$, which suggests that one can model the system with an improved value of $a_2$, while I suspect it is the Guinier model itself that is the approximation, and that $I(Q) \approx I_L(Q, \xi, D) + I_G(Q, R_g) + B$.

FWIW, the first reference doesn't use the approximation sign.

I have no idea why OpenCL is throwing so many errors during the tests.

smk78 commented 1 year ago

Thanks @pkienzle , how is it now?