core_shell_microgelscostrafo411magnetic_modelticket-1257-vesicle-productticket_1156ticket_1265_superballticket_822_more_unit_tests
Last change on this file since 925ad6e was 925ad6e, checked in by wojciech, 6 years ago

sph_j1c translated to sas_3j1x_x

• Property mode set to `100644`
File size: 2.5 KB
Line
3double Iqxy(double qx, double qy, double sld, double sld_solvent,
5
8{
10    // Given the following under the radical:
11    //     1 + sin^2(T) (v^2 - 1)
12    // we can expand to match the form given in Guinier (1955)
13    //     = (1 - sin^2(T)) + v^2 sin^2(T) = cos^2(T) + sin^2(T)
14    // Instead of using pythagoras we could pass in sin and cos; this may be
15    // slightly better for 2D which has already computed it, but it introduces
16    // an extra sqrt and square for 1-D not required by the current form, so
17    // leave it as is.
18    const double r = radius_equatorial
19                     * sqrt(1.0 + sin_alpha*sin_alpha*(ratio*ratio - 1.0));
20    const double f = sas_3j1x_x(q*r);
21
22    return f*f;
23}
24
26{
28}
29
30double Iq(double q,
31    double sld,
32    double sld_solvent,
35{
36    // translate a point in [-1,1] to a point in [0, 1]
37    const double zm = 0.5;
38    const double zb = 0.5;
39    double total = 0.0;
40    for (int i=0;i<76;i++) {
41        //const double sin_alpha = (Gauss76Z[i]*(upper-lower) + upper + lower)/2;
42        const double sin_alpha = Gauss76Z[i]*zm + zb;
44    }
45    // translate dx in [-1,1] to dx in [lower,upper]
46    const double form = total*zm;
48    return 1.0e-4 * s * s * form;
49}
50
51double Iqxy(double qx, double qy,
52    double sld,
53    double sld_solvent,