[81dd619] | 1 | |
---|
[2a0b2b1] | 2 | // Converted from Igor function gfn4, using the same pattern as ellipsoid |
---|
| 3 | // for evaluating the parts of the integral. |
---|
| 4 | // FUNCTION gfn4: CONTAINS F(Q,A,B,MU)**2 AS GIVEN |
---|
| 5 | // BY (53) & (58-59) IN CHEN AND |
---|
| 6 | // KOTLARCHYK REFERENCE |
---|
| 7 | // |
---|
| 8 | // <OBLATE ELLIPSOID> |
---|
| 9 | static double |
---|
| 10 | _cs_ellipsoid_kernel(double qab, double qc, |
---|
| 11 | double equat_core, double polar_core, |
---|
| 12 | double equat_shell, double polar_shell, |
---|
| 13 | double sld_core_shell, double sld_shell_solvent) |
---|
| 14 | { |
---|
| 15 | const double qr_core = sqrt(square(equat_core*qab) + square(polar_core*qc)); |
---|
| 16 | const double si_core = sas_3j1x_x(qr_core); |
---|
| 17 | const double volume_core = M_4PI_3*equat_core*equat_core*polar_core; |
---|
| 18 | const double fq_core = si_core*volume_core*sld_core_shell; |
---|
[81dd619] | 19 | |
---|
[2a0b2b1] | 20 | const double qr_shell = sqrt(square(equat_shell*qab) + square(polar_shell*qc)); |
---|
| 21 | const double si_shell = sas_3j1x_x(qr_shell); |
---|
| 22 | const double volume_shell = M_4PI_3*equat_shell*equat_shell*polar_shell; |
---|
| 23 | const double fq_shell = si_shell*volume_shell*sld_shell_solvent; |
---|
[81dd619] | 24 | |
---|
[2a0b2b1] | 25 | return fq_core + fq_shell; |
---|
| 26 | } |
---|
[81dd619] | 27 | |
---|
[2a0b2b1] | 28 | static double |
---|
| 29 | form_volume(double radius_equat_core, |
---|
| 30 | double x_core, |
---|
| 31 | double thick_shell, |
---|
| 32 | double x_polar_shell) |
---|
[81dd619] | 33 | { |
---|
[5031ca3] | 34 | const double equat_shell = radius_equat_core + thick_shell; |
---|
| 35 | const double polar_shell = radius_equat_core*x_core + thick_shell*x_polar_shell; |
---|
[5bddd89] | 36 | double vol = M_4PI_3*equat_shell*equat_shell*polar_shell; |
---|
[81dd619] | 37 | return vol; |
---|
| 38 | } |
---|
| 39 | |
---|
[71b751d] | 40 | static void |
---|
| 41 | Fq(double q, |
---|
| 42 | double *F1, |
---|
| 43 | double *F2, |
---|
[2a0b2b1] | 44 | double radius_equat_core, |
---|
| 45 | double x_core, |
---|
| 46 | double thick_shell, |
---|
| 47 | double x_polar_shell, |
---|
| 48 | double core_sld, |
---|
| 49 | double shell_sld, |
---|
| 50 | double solvent_sld) |
---|
[81dd619] | 51 | { |
---|
[2a0b2b1] | 52 | const double sld_core_shell = core_sld - shell_sld; |
---|
| 53 | const double sld_shell_solvent = shell_sld - solvent_sld; |
---|
[5031ca3] | 54 | |
---|
| 55 | const double polar_core = radius_equat_core*x_core; |
---|
| 56 | const double equat_shell = radius_equat_core + thick_shell; |
---|
| 57 | const double polar_shell = radius_equat_core*x_core + thick_shell*x_polar_shell; |
---|
[81dd619] | 58 | |
---|
[2a0b2b1] | 59 | // translate from [-1, 1] => [0, 1] |
---|
| 60 | const double m = 0.5; |
---|
| 61 | const double b = 0.5; |
---|
[71b751d] | 62 | double total_F1 = 0.0; //initialize intergral |
---|
| 63 | double total_F2 = 0.0; //initialize intergral |
---|
[74768cb] | 64 | for(int i=0;i<GAUSS_N;i++) { |
---|
| 65 | const double cos_theta = GAUSS_Z[i]*m + b; |
---|
[2a0b2b1] | 66 | const double sin_theta = sqrt(1.0 - cos_theta*cos_theta); |
---|
| 67 | double fq = _cs_ellipsoid_kernel(q*sin_theta, q*cos_theta, |
---|
| 68 | radius_equat_core, polar_core, |
---|
| 69 | equat_shell, polar_shell, |
---|
| 70 | sld_core_shell, sld_shell_solvent); |
---|
[71b751d] | 71 | total_F1 += GAUSS_W[i] * fq; |
---|
| 72 | total_F2 += GAUSS_W[i] * fq * fq; |
---|
[e7678b2] | 73 | } |
---|
[71b751d] | 74 | total_F1 *= m; |
---|
| 75 | total_F2 *= m; |
---|
[81dd619] | 76 | |
---|
[0a3d9b2] | 77 | // convert to [cm-1] |
---|
[71b751d] | 78 | *F1 = 1.0e-2 * total_F1; |
---|
| 79 | *F2 = 1.0e-4 * total_F2; |
---|
[81dd619] | 80 | } |
---|
| 81 | |
---|
[71b751d] | 82 | |
---|
[81dd619] | 83 | static double |
---|
[108e70e] | 84 | Iqac(double qab, double qc, |
---|
[2a0b2b1] | 85 | double radius_equat_core, |
---|
| 86 | double x_core, |
---|
| 87 | double thick_shell, |
---|
| 88 | double x_polar_shell, |
---|
| 89 | double core_sld, |
---|
| 90 | double shell_sld, |
---|
[becded3] | 91 | double solvent_sld) |
---|
[81dd619] | 92 | { |
---|
[2a0b2b1] | 93 | const double sld_core_shell = core_sld - shell_sld; |
---|
| 94 | const double sld_shell_solvent = shell_sld - solvent_sld; |
---|
[81dd619] | 95 | |
---|
[5031ca3] | 96 | const double polar_core = radius_equat_core*x_core; |
---|
| 97 | const double equat_shell = radius_equat_core + thick_shell; |
---|
| 98 | const double polar_shell = radius_equat_core*x_core + thick_shell*x_polar_shell; |
---|
| 99 | |
---|
[2a0b2b1] | 100 | double fq = _cs_ellipsoid_kernel(qab, qc, |
---|
| 101 | radius_equat_core, polar_core, |
---|
| 102 | equat_shell, polar_shell, |
---|
| 103 | sld_core_shell, sld_shell_solvent); |
---|
[81dd619] | 104 | |
---|
| 105 | //convert to [cm-1] |
---|
[2a0b2b1] | 106 | return 1.0e-4 * fq * fq; |
---|
[81dd619] | 107 | } |
---|