[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 | |
---|
| 40 | static double |
---|
[2a0b2b1] | 41 | Iq(double q, |
---|
| 42 | double radius_equat_core, |
---|
| 43 | double x_core, |
---|
| 44 | double thick_shell, |
---|
| 45 | double x_polar_shell, |
---|
| 46 | double core_sld, |
---|
| 47 | double shell_sld, |
---|
| 48 | double solvent_sld) |
---|
[81dd619] | 49 | { |
---|
[2a0b2b1] | 50 | const double sld_core_shell = core_sld - shell_sld; |
---|
| 51 | const double sld_shell_solvent = shell_sld - solvent_sld; |
---|
[5031ca3] | 52 | |
---|
| 53 | const double polar_core = radius_equat_core*x_core; |
---|
| 54 | const double equat_shell = radius_equat_core + thick_shell; |
---|
| 55 | const double polar_shell = radius_equat_core*x_core + thick_shell*x_polar_shell; |
---|
[81dd619] | 56 | |
---|
[2a0b2b1] | 57 | // translate from [-1, 1] => [0, 1] |
---|
| 58 | const double m = 0.5; |
---|
| 59 | const double b = 0.5; |
---|
| 60 | double total = 0.0; //initialize intergral |
---|
[0a3d9b2] | 61 | for(int i=0;i<76;i++) { |
---|
[2a0b2b1] | 62 | const double cos_theta = Gauss76Z[i]*m + b; |
---|
| 63 | const double sin_theta = sqrt(1.0 - cos_theta*cos_theta); |
---|
| 64 | double fq = _cs_ellipsoid_kernel(q*sin_theta, q*cos_theta, |
---|
| 65 | radius_equat_core, polar_core, |
---|
| 66 | equat_shell, polar_shell, |
---|
| 67 | sld_core_shell, sld_shell_solvent); |
---|
| 68 | total += Gauss76Wt[i] * fq * fq; |
---|
[e7678b2] | 69 | } |
---|
[2a0b2b1] | 70 | total *= m; |
---|
[81dd619] | 71 | |
---|
[0a3d9b2] | 72 | // convert to [cm-1] |
---|
[2a0b2b1] | 73 | return 1.0e-4 * total; |
---|
[81dd619] | 74 | } |
---|
| 75 | |
---|
| 76 | static double |
---|
[becded3] | 77 | Iqxy(double qab, double qc, |
---|
[2a0b2b1] | 78 | double radius_equat_core, |
---|
| 79 | double x_core, |
---|
| 80 | double thick_shell, |
---|
| 81 | double x_polar_shell, |
---|
| 82 | double core_sld, |
---|
| 83 | double shell_sld, |
---|
[becded3] | 84 | double solvent_sld) |
---|
[81dd619] | 85 | { |
---|
[2a0b2b1] | 86 | const double sld_core_shell = core_sld - shell_sld; |
---|
| 87 | const double sld_shell_solvent = shell_sld - solvent_sld; |
---|
[81dd619] | 88 | |
---|
[5031ca3] | 89 | const double polar_core = radius_equat_core*x_core; |
---|
| 90 | const double equat_shell = radius_equat_core + thick_shell; |
---|
| 91 | const double polar_shell = radius_equat_core*x_core + thick_shell*x_polar_shell; |
---|
| 92 | |
---|
[2a0b2b1] | 93 | double fq = _cs_ellipsoid_kernel(qab, qc, |
---|
| 94 | radius_equat_core, polar_core, |
---|
| 95 | equat_shell, polar_shell, |
---|
| 96 | sld_core_shell, sld_shell_solvent); |
---|
[81dd619] | 97 | |
---|
| 98 | //convert to [cm-1] |
---|
[2a0b2b1] | 99 | return 1.0e-4 * fq * fq; |
---|
[81dd619] | 100 | } |
---|