Validation

Scattering expressions are complicated and its easy to make mistakes deriving or implementing them.

* Defined terms:

s->ValidateDefinedTerms();

checks that expressions have been implemented for all the amplitudes and phase factors that are defined.
An error will be generated if any term is missing.

* Mathematica validation:

s->ValidateFormFactorFile(map, "F.dat");
s->ValidateFormFactorAmplitudeFile("center",map, dir+"A_center2shell.dat");
s->ValidatePhaseFactorFile("center","surface",map, dir+"Pcenter_surface.dat");
:

To validate the scattering expressions, we have used Matematica to generate files with scattering
curves for specific parameters. ValidateXXFile is used to compare analytic expressions to content
of the files.

The Guinier expansions are also compared against the data generated by mathematica,
by comparing 1- sigma R^2 q^2/6 to the data generated by mathematica, where sigma R^2
expressions are hardcoded for the sub-unit. This comparison is only made where the second
order term is <0.01 of the first order term.

* Ginac Series expansion:

s->ValidateSymbolically();

GiNaC can also Taylor expand simple expressions, and thus check whether their expansions
have the correct first 3 terms: 1 coefficient, a  0q term, and the proper SMSD q^2/6 term.
However, this fails for all scattering expressions involving special functions, and it also
fails if simplifications are required to compare to the SMSD expressions. Thus we recommend
not using this except for the simplest cases.


