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_J1c((radius+thickness)*qs); |
---|
23 | const double lam2 = sas_J1c(radius*qs); |
---|
24 | const double gamma_sq = square(radius/(radius+thickness)); |
---|
25 | //Note: lim_{r -> r_c} psi = J0(radius_core*qs) |
---|
26 | const double psi = (lam1 - gamma_sq*lam2)/(1.0 - gamma_sq); //SRK 10/19/00 |
---|
27 | const double t2 = sinc(0.5*q*length*cos_val); |
---|
28 | return psi*t2; |
---|
29 | } |
---|
30 | |
---|
31 | double |
---|
32 | form_volume(double radius, double thickness, double length) |
---|
33 | { |
---|
34 | double v_shell = M_PI*length*((radius+thickness)*(radius+thickness)-radius*radius); |
---|
35 | return(v_shell); |
---|
36 | } |
---|
37 | |
---|
38 | |
---|
39 | double |
---|
40 | Iq(double q, double radius, double thickness, double length, |
---|
41 | double sld, double solvent_sld) |
---|
42 | { |
---|
43 | const double lower = 0.0; |
---|
44 | const double upper = 1.0; //limits of numerical integral |
---|
45 | |
---|
46 | double summ = 0.0; //initialize intergral |
---|
47 | for (int i=0;i<76;i++) { |
---|
48 | const double cos_val = 0.5*( Gauss76Z[i] * (upper-lower) + lower + upper ); |
---|
49 | const double sin_val = sqrt(1.0 - cos_val*cos_val); |
---|
50 | const double inter = _hollow_cylinder_kernel(q, radius, thickness, length, |
---|
51 | sin_val, cos_val); |
---|
52 | summ += Gauss76Wt[i] * inter; |
---|
53 | } |
---|
54 | |
---|
55 | const double Aq = 0.5*summ*(upper-lower); |
---|
56 | const double volume = form_volume(radius, thickness, length); |
---|
57 | return _hollow_cylinder_scaling(Aq, solvent_sld - sld, volume); |
---|
58 | } |
---|
59 | |
---|
60 | double |
---|
61 | Iqxy(double qx, double qy, |
---|
62 | double radius, double thickness, double length, |
---|
63 | double sld, double solvent_sld, double theta, double phi) |
---|
64 | { |
---|
65 | double q, sin_alpha, cos_alpha; |
---|
66 | ORIENT_SYMMETRIC(qx, qy, theta, phi, q, sin_alpha, cos_alpha); |
---|
67 | const double Aq = _hollow_cylinder_kernel(q, radius, thickness, length, |
---|
68 | sin_alpha, cos_alpha); |
---|
69 | |
---|
70 | const double vol = form_volume(radius, thickness, length); |
---|
71 | return _hollow_cylinder_scaling(Aq, solvent_sld-sld, vol); |
---|
72 | } |
---|
73 | |
---|
74 | |
---|