[aea2e2a] | 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 |
---|
[5bddd89] | 10 | static double |
---|
| 11 | _hollow_cylinder_scaling(double integrand, double delrho, double volume) |
---|
[aea2e2a] | 12 | { |
---|
[5bddd89] | 13 | return 1.0e-4 * square(volume * delrho * integrand); |
---|
[aea2e2a] | 14 | } |
---|
| 15 | |
---|
| 16 | |
---|
[5bddd89] | 17 | static double |
---|
| 18 | _hollow_cylinder_kernel(double q, |
---|
| 19 | double radius, double thickness, double length, double sin_val, double cos_val) |
---|
[aea2e2a] | 20 | { |
---|
[5bddd89] | 21 | const double qs = q*sin_val; |
---|
[aea2e2a] | 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 |
---|
[5bddd89] | 27 | const double t2 = sinc(0.5*q*length*cos_val); |
---|
| 28 | return psi*t2; |
---|
[aea2e2a] | 29 | } |
---|
| 30 | |
---|
[5bddd89] | 31 | double |
---|
| 32 | form_volume(double radius, double thickness, double length) |
---|
[aea2e2a] | 33 | { |
---|
| 34 | double v_shell = M_PI*length*((radius+thickness)*(radius+thickness)-radius*radius); |
---|
| 35 | return(v_shell); |
---|
| 36 | } |
---|
| 37 | |
---|
| 38 | |
---|
[5bddd89] | 39 | double |
---|
| 40 | Iq(double q, double radius, double thickness, double length, |
---|
[aea2e2a] | 41 | double sld, double solvent_sld) |
---|
| 42 | { |
---|
[5bddd89] | 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; |
---|
[aea2e2a] | 53 | } |
---|
| 54 | |
---|
[5bddd89] | 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 | } |
---|
[aea2e2a] | 59 | |
---|
[5bddd89] | 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); |
---|
[aea2e2a] | 72 | } |
---|
| 73 | |
---|
| 74 | |
---|