1 | //#define INVALID(v) (v.radius_core >= v.radius) |
---|
2 | |
---|
3 | static double |
---|
4 | _fq(double qab, double qc, |
---|
5 | double radius, double thickness, double length) |
---|
6 | { |
---|
7 | const double lam1 = sas_2J1x_x((radius+thickness)*qab); |
---|
8 | const double lam2 = sas_2J1x_x(radius*qab); |
---|
9 | const double gamma_sq = square(radius/(radius+thickness)); |
---|
10 | //Note: lim_{thickness -> 0} psi = sas_J0(radius*qab) |
---|
11 | //Note: lim_{radius -> 0} psi = sas_2J1x_x(thickness*qab) |
---|
12 | const double psi = (lam1 - gamma_sq*lam2)/(1.0 - gamma_sq); //SRK 10/19/00 |
---|
13 | const double t2 = sas_sinx_x(0.5*length*qc); |
---|
14 | return psi*t2; |
---|
15 | } |
---|
16 | |
---|
17 | static double |
---|
18 | form_volume(double radius, double thickness, double length) |
---|
19 | { |
---|
20 | double v_shell = M_PI*length*(square(radius+thickness) - radius*radius); |
---|
21 | return v_shell; |
---|
22 | } |
---|
23 | |
---|
24 | |
---|
25 | static void |
---|
26 | Fq(double q, double *F1, double *F2, double radius, double thickness, double length, |
---|
27 | double sld, double solvent_sld) |
---|
28 | { |
---|
29 | const double lower = 0.0; |
---|
30 | const double upper = 1.0; //limits of numerical integral |
---|
31 | |
---|
32 | double total_F1 = 0.0; //initialize intergral |
---|
33 | double total_F2 = 0.0; |
---|
34 | for (int i=0;i<GAUSS_N;i++) { |
---|
35 | const double cos_theta = 0.5*( GAUSS_Z[i] * (upper-lower) + lower + upper ); |
---|
36 | const double sin_theta = sqrt(1.0 - cos_theta*cos_theta); |
---|
37 | const double form = _fq(q*sin_theta, q*cos_theta, |
---|
38 | radius, thickness, length); |
---|
39 | total_F1 += GAUSS_W[i] * form; |
---|
40 | total_F2 += GAUSS_W[i] * form * form; |
---|
41 | } |
---|
42 | total_F1 *= 0.5*(upper-lower); |
---|
43 | total_F2 *= 0.5*(upper-lower); |
---|
44 | const double s = (sld - solvent_sld) * form_volume(radius, thickness, length); |
---|
45 | *F1 = 1e-2 * s * total_F1; |
---|
46 | *F2 = 1e-4 * s*s * total_F2; |
---|
47 | } |
---|
48 | |
---|
49 | |
---|
50 | static double |
---|
51 | Iqac(double qab, double qc, |
---|
52 | double radius, double thickness, double length, |
---|
53 | double sld, double solvent_sld) |
---|
54 | { |
---|
55 | const double form = _fq(qab, qc, radius, thickness, length); |
---|
56 | const double s = (sld - solvent_sld) * form_volume(radius, thickness, length); |
---|
57 | return 1.0e-4*square(s * form); |
---|
58 | } |
---|