1 | double form_volume(double radius, double thickness, double length); |
---|
2 | double Iq(double q, double radius, double thickness, double length, double sld, |
---|
3 | double solvent_sld); |
---|
4 | double Iqxy(double qx, double qy, double radius, double thickness, double length, double sld, |
---|
5 | double solvent_sld, double theta, double phi); |
---|
6 | |
---|
7 | //#define INVALID(v) (v.radius_core >= v.radius) |
---|
8 | |
---|
9 | // From Igor library |
---|
10 | static double |
---|
11 | _hollow_cylinder_scaling(double integrand, double delrho, double volume) |
---|
12 | { |
---|
13 | return 1.0e-4 * square(volume * delrho) * integrand; |
---|
14 | } |
---|
15 | |
---|
16 | |
---|
17 | static double |
---|
18 | _hollow_cylinder_kernel(double q, |
---|
19 | double radius, double thickness, double length, double sin_val, double cos_val) |
---|
20 | { |
---|
21 | const double qs = q*sin_val; |
---|
22 | const double lam1 = sas_2J1x_x((radius+thickness)*qs); |
---|
23 | const double lam2 = sas_2J1x_x(radius*qs); |
---|
24 | const double gamma_sq = square(radius/(radius+thickness)); |
---|
25 | //Note: lim_{thickness -> 0} psi = sas_J0(radius*qs) |
---|
26 | //Note: lim_{radius -> 0} psi = sas_2J1x_x(thickness*qs) |
---|
27 | const double psi = (lam1 - gamma_sq*lam2)/(1.0 - gamma_sq); //SRK 10/19/00 |
---|
28 | const double t2 = sas_sinx_x(0.5*q*length*cos_val); |
---|
29 | return psi*t2; |
---|
30 | } |
---|
31 | |
---|
32 | double |
---|
33 | form_volume(double radius, double thickness, double length) |
---|
34 | { |
---|
35 | double v_shell = M_PI*length*(square(radius+thickness) - radius*radius); |
---|
36 | return v_shell; |
---|
37 | } |
---|
38 | |
---|
39 | |
---|
40 | double |
---|
41 | Iq(double q, double radius, double thickness, double length, |
---|
42 | double sld, double solvent_sld) |
---|
43 | { |
---|
44 | const double lower = 0.0; |
---|
45 | const double upper = 1.0; //limits of numerical integral |
---|
46 | |
---|
47 | double summ = 0.0; //initialize intergral |
---|
48 | for (int i=0;i<76;i++) { |
---|
49 | const double cos_val = 0.5*( Gauss76Z[i] * (upper-lower) + lower + upper ); |
---|
50 | const double sin_val = sqrt(1.0 - cos_val*cos_val); |
---|
51 | const double inter = _hollow_cylinder_kernel(q, radius, thickness, length, |
---|
52 | sin_val, cos_val); |
---|
53 | summ += Gauss76Wt[i] * inter * inter; |
---|
54 | } |
---|
55 | |
---|
56 | const double Aq = 0.5*summ*(upper-lower); |
---|
57 | const double volume = form_volume(radius, thickness, length); |
---|
58 | return _hollow_cylinder_scaling(Aq, solvent_sld - sld, volume); |
---|
59 | } |
---|
60 | |
---|
61 | double |
---|
62 | Iqxy(double qx, double qy, |
---|
63 | double radius, double thickness, double length, |
---|
64 | double sld, double solvent_sld, double theta, double phi) |
---|
65 | { |
---|
66 | double q, sin_alpha, cos_alpha; |
---|
67 | ORIENT_SYMMETRIC(qx, qy, theta, phi, q, sin_alpha, cos_alpha); |
---|
68 | const double Aq = _hollow_cylinder_kernel(q, radius, thickness, length, |
---|
69 | sin_alpha, cos_alpha); |
---|
70 | |
---|
71 | const double vol = form_volume(radius, thickness, length); |
---|
72 | return _hollow_cylinder_scaling(Aq*Aq, solvent_sld-sld, vol); |
---|
73 | } |
---|
74 | |
---|