[2a0b2b1] | 1 | static double |
---|
| 2 | form_volume(double radius_polar, double radius_equatorial) |
---|
[ce27e21] | 3 | { |
---|
[a807206] | 4 | return M_4PI_3*radius_polar*radius_equatorial*radius_equatorial; |
---|
[ce27e21] | 5 | } |
---|
| 6 | |
---|
[2a0b2b1] | 7 | static double |
---|
| 8 | Iq(double q, |
---|
[994d77f] | 9 | double sld, |
---|
[a807206] | 10 | double sld_solvent, |
---|
| 11 | double radius_polar, |
---|
| 12 | double radius_equatorial) |
---|
[ce27e21] | 13 | { |
---|
[3b571ae] | 14 | // Using ratio v = Rp/Re, we can implement the form given in Guinier (1955) |
---|
| 15 | // i(h) = int_0^pi/2 Phi^2(h a sqrt(cos^2 + v^2 sin^2) cos dT |
---|
| 16 | // = int_0^pi/2 Phi^2(h a sqrt((1-sin^2) + v^2 sin^2) cos dT |
---|
| 17 | // = int_0^pi/2 Phi^2(h a sqrt(1 + sin^2(v^2-1)) cos dT |
---|
| 18 | // u-substitution of |
---|
| 19 | // u = sin, du = cos dT |
---|
| 20 | // i(h) = int_0^1 Phi^2(h a sqrt(1 + u^2(v^2-1)) du |
---|
| 21 | const double v_square_minus_one = square(radius_polar/radius_equatorial) - 1.0; |
---|
| 22 | |
---|
[50e1e40] | 23 | // translate a point in [-1,1] to a point in [0, 1] |
---|
[3b571ae] | 24 | // const double u = Gauss76Z[i]*(upper-lower)/2 + (upper+lower)/2; |
---|
[50e1e40] | 25 | const double zm = 0.5; |
---|
| 26 | const double zb = 0.5; |
---|
[994d77f] | 27 | double total = 0.0; |
---|
[ce27e21] | 28 | for (int i=0;i<76;i++) { |
---|
[3b571ae] | 29 | const double u = Gauss76Z[i]*zm + zb; |
---|
| 30 | const double r = radius_equatorial*sqrt(1.0 + u*u*v_square_minus_one); |
---|
| 31 | const double f = sas_3j1x_x(q*r); |
---|
| 32 | total += Gauss76Wt[i] * f * f; |
---|
[ce27e21] | 33 | } |
---|
[50e1e40] | 34 | // translate dx in [-1,1] to dx in [lower,upper] |
---|
| 35 | const double form = total*zm; |
---|
[a807206] | 36 | const double s = (sld - sld_solvent) * form_volume(radius_polar, radius_equatorial); |
---|
[50e1e40] | 37 | return 1.0e-4 * s * s * form; |
---|
[ce27e21] | 38 | } |
---|
| 39 | |
---|
[2a0b2b1] | 40 | static double |
---|
[becded3] | 41 | Iqxy(double qab, double qc, |
---|
[994d77f] | 42 | double sld, |
---|
[a807206] | 43 | double sld_solvent, |
---|
| 44 | double radius_polar, |
---|
[becded3] | 45 | double radius_equatorial) |
---|
[ce27e21] | 46 | { |
---|
[2a0b2b1] | 47 | const double qr = sqrt(square(radius_equatorial*qab) + square(radius_polar*qc)); |
---|
| 48 | const double f = sas_3j1x_x(qr); |
---|
[a807206] | 49 | const double s = (sld - sld_solvent) * form_volume(radius_polar, radius_equatorial); |
---|
[ce27e21] | 50 | |
---|
[3b571ae] | 51 | return 1.0e-4 * square(f * s); |
---|
[ce27e21] | 52 | } |
---|