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