1 | double form_volume(double rpolar, double requatorial); |
---|
2 | double Iq(double q, double sld, double solvent_sld, double rpolar, double requatorial); |
---|
3 | double Iqxy(double qx, double qy, double sld, double solvent_sld, |
---|
4 | double rpolar, double requatorial, double theta, double phi); |
---|
5 | |
---|
6 | double _ellipsoid_kernel(double q, double rpolar, double requatorial, double cos_alpha); |
---|
7 | double _ellipsoid_kernel(double q, double rpolar, double requatorial, double cos_alpha) |
---|
8 | { |
---|
9 | double sn, cn; |
---|
10 | double ratio = rpolar/requatorial; |
---|
11 | const double u = q*requatorial*sqrt(1.0 |
---|
12 | + cos_alpha*cos_alpha*(ratio*ratio - 1.0)); |
---|
13 | SINCOS(u, sn, cn); |
---|
14 | //const double f = ( u==0.0 ? 1.0 : 3.0*(sn-u*cn)/(u*u*u) ); |
---|
15 | const double usq = u*u; |
---|
16 | const double f = (u < 1e-1) |
---|
17 | ? 1.0 + usq*(-3./30. + usq*(3./840. + usq*(-3./45360.)))// + qrsq*(3./3991680.)))) |
---|
18 | : 3.0*(sn/u - cn)/usq; |
---|
19 | return f*f; |
---|
20 | } |
---|
21 | |
---|
22 | double form_volume(double rpolar, double requatorial) |
---|
23 | { |
---|
24 | return 1.333333333333333*M_PI*rpolar*requatorial*requatorial; |
---|
25 | } |
---|
26 | |
---|
27 | double Iq(double q, |
---|
28 | double sld, |
---|
29 | double solvent_sld, |
---|
30 | double rpolar, |
---|
31 | double requatorial) |
---|
32 | { |
---|
33 | //const double lower = 0.0; |
---|
34 | //const double upper = 1.0; |
---|
35 | double total = 0.0; |
---|
36 | for (int i=0;i<76;i++) { |
---|
37 | //const double cos_alpha = (Gauss76Z[i]*(upper-lower) + upper + lower)/2; |
---|
38 | const double cos_alpha = 0.5*(Gauss76Z[i] + 1.0); |
---|
39 | total += Gauss76Wt[i] * _ellipsoid_kernel(q, rpolar, requatorial, cos_alpha); |
---|
40 | } |
---|
41 | //const double form = (upper-lower)/2*total; |
---|
42 | const double form = 0.5*total; |
---|
43 | const double s = (sld - solvent_sld) * form_volume(rpolar, requatorial); |
---|
44 | return 1.0e-4 * form * s * s; |
---|
45 | } |
---|
46 | |
---|
47 | double Iqxy(double qx, double qy, |
---|
48 | double sld, |
---|
49 | double solvent_sld, |
---|
50 | double rpolar, |
---|
51 | double requatorial, |
---|
52 | double theta, |
---|
53 | double phi) |
---|
54 | { |
---|
55 | double sn, cn; |
---|
56 | |
---|
57 | const double q = sqrt(qx*qx + qy*qy); |
---|
58 | SINCOS(theta*M_PI_180, sn, cn); |
---|
59 | const double cos_alpha = cn*cos(phi*M_PI_180)*(qx/q) + sn*(qy/q); |
---|
60 | const double form = _ellipsoid_kernel(q, rpolar, requatorial, cos_alpha); |
---|
61 | const double s = (sld - solvent_sld) * form_volume(rpolar, requatorial); |
---|
62 | |
---|
63 | return 1.0e-4 * form * s * s; |
---|
64 | } |
---|
65 | |
---|