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