Changes in sasmodels/models/core_shell_ellipsoid.c [5031ca3:2222134] in sasmodels
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sasmodels/models/core_shell_ellipsoid.c
r5031ca3 r2222134 1 1 double form_volume(double radius_equat_core, 2 double polar_core,3 double equat_shell,4 double polar_shell);2 double radius_polar_core, 3 double radius_equat_shell, 4 double radius_polar_shell); 5 5 double Iq(double q, 6 6 double radius_equat_core, 7 double x_core,8 double thick_shell,9 double x_polar_shell,10 double core_sld,11 double s hell_sld,12 double s olvent_sld);7 double radius_polar_core, 8 double radius_equat_shell, 9 double radius_polar_shell, 10 double sld_core, 11 double sld_shell, 12 double sld_solvent); 13 13 14 14 15 15 double Iqxy(double qx, double qy, 16 16 double radius_equat_core, 17 double x_core,18 double thick_shell,19 double x_polar_shell,20 double core_sld,21 double s hell_sld,22 double s olvent_sld,17 double radius_polar_core, 18 double radius_equat_shell, 19 double radius_polar_shell, 20 double sld_core, 21 double sld_shell, 22 double sld_solvent, 23 23 double theta, 24 24 double phi); … … 26 26 27 27 double form_volume(double radius_equat_core, 28 double x_core,29 double thick_shell,30 double x_polar_shell)28 double radius_polar_core, 29 double radius_equat_shell, 30 double radius_polar_shell) 31 31 { 32 const double equat_shell = radius_equat_core + thick_shell; 33 const double polar_shell = radius_equat_core*x_core + thick_shell*x_polar_shell; 34 double vol = 4.0*M_PI/3.0*equat_shell*equat_shell*polar_shell; 32 double vol = 4.0*M_PI/3.0*radius_equat_shell*radius_equat_shell*radius_polar_shell; 35 33 return vol; 36 34 } 37 35 38 36 static double 39 core_shell_ellipsoid_ xt_kernel(double q,37 core_shell_ellipsoid_kernel(double q, 40 38 double radius_equat_core, 41 double x_core,42 double thick_shell,43 double x_polar_shell,44 double core_sld,45 double s hell_sld,46 double s olvent_sld)39 double radius_polar_core, 40 double radius_equat_shell, 41 double radius_polar_shell, 42 double sld_core, 43 double sld_shell, 44 double sld_solvent) 47 45 { 46 47 //upper and lower integration limits 48 48 const double lolim = 0.0; 49 49 const double uplim = 1.0; … … 51 51 double summ = 0.0; //initialize intergral 52 52 53 const double delpc = core_sld - shell_sld; //core - shell 54 const double delps = shell_sld - solvent_sld; //shell - solvent 55 56 57 const double polar_core = radius_equat_core*x_core; 58 const double equat_shell = radius_equat_core + thick_shell; 59 const double polar_shell = radius_equat_core*x_core + thick_shell*x_polar_shell; 53 const double delpc = sld_core - sld_shell; //core - shell 54 const double delps = sld_shell - sld_solvent; //shell - solvent 60 55 61 56 for(int i=0;i<N_POINTS_76;i++) { … … 63 58 double yyy = Gauss76Wt[i] * gfn4(zi, 64 59 radius_equat_core, 65 polar_core,66 equat_shell,67 polar_shell,60 radius_polar_core, 61 radius_equat_shell, 62 radius_polar_shell, 68 63 delpc, 69 64 delps, … … 73 68 74 69 double answer = (uplim-lolim)/2.0*summ; 70 75 71 //convert to [cm-1] 76 72 answer *= 1.0e-4; … … 80 76 81 77 static double 82 core_shell_ellipsoid_ xt_kernel_2d(double q, double q_x, double q_y,78 core_shell_ellipsoid_kernel_2d(double q, double q_x, double q_y, 83 79 double radius_equat_core, 84 double x_core,85 double thick_shell,86 double x_polar_shell,87 double core_sld,88 double s hell_sld,89 double s olvent_sld,80 double radius_polar_core, 81 double radius_equat_shell, 82 double radius_polar_shell, 83 double sld_core, 84 double sld_shell, 85 double sld_solvent, 90 86 double theta, 91 87 double phi) … … 95 91 phi = phi * M_PI_180; 96 92 93 97 94 // ellipsoid orientation, the axis of the rotation is consistent with the ploar axis. 98 95 const double cyl_x = cos(theta) * cos(phi); 99 96 const double cyl_y = sin(theta); 100 97 101 const double sldcs = core_sld - shell_sld;102 const double sldss = s hell_sld- solvent_sld;98 const double sldcs = sld_core - sld_shell; 99 const double sldss = sld_shell- sld_solvent; 103 100 104 101 // Compute the angle btw vector q and the … … 106 103 const double cos_val = cyl_x*q_x + cyl_y*q_y; 107 104 108 const double polar_core = radius_equat_core*x_core; 109 const double equat_shell = radius_equat_core + thick_shell; 110 const double polar_shell = radius_equat_core*x_core + thick_shell*x_polar_shell; 111 112 // Call the IGOR library function to get the kernel: 113 // MUST use gfn4 not gf2 because of the def of params. 105 // Call the IGOR library function to get the kernel: MUST use gfn4 not gf2 because of the def of params. 114 106 double answer = gfn4(cos_val, 115 107 radius_equat_core, 116 polar_core,117 equat_shell,118 polar_shell,108 radius_polar_core, 109 radius_equat_shell, 110 radius_polar_shell, 119 111 sldcs, 120 112 sldss, … … 129 121 double Iq(double q, 130 122 double radius_equat_core, 131 double x_core,132 double thick_shell,133 double x_polar_shell,134 double core_sld,135 double s hell_sld,136 double s olvent_sld)123 double radius_polar_core, 124 double radius_equat_shell, 125 double radius_polar_shell, 126 double sld_core, 127 double sld_shell, 128 double sld_solvent) 137 129 { 138 double intensity = core_shell_ellipsoid_ xt_kernel(q,130 double intensity = core_shell_ellipsoid_kernel(q, 139 131 radius_equat_core, 140 x_core,141 thick_shell,142 x_polar_shell,143 core_sld,144 s hell_sld,145 s olvent_sld);132 radius_polar_core, 133 radius_equat_shell, 134 radius_polar_shell, 135 sld_core, 136 sld_shell, 137 sld_solvent); 146 138 147 139 return intensity; … … 151 143 double Iqxy(double qx, double qy, 152 144 double radius_equat_core, 153 double x_core,154 double thick_shell,155 double x_polar_shell,156 double core_sld,157 double s hell_sld,158 double s olvent_sld,145 double radius_polar_core, 146 double radius_equat_shell, 147 double radius_polar_shell, 148 double sld_core, 149 double sld_shell, 150 double sld_solvent, 159 151 double theta, 160 152 double phi) … … 162 154 double q; 163 155 q = sqrt(qx*qx+qy*qy); 164 double intensity = core_shell_ellipsoid_ xt_kernel_2d(q, qx/q, qy/q,156 double intensity = core_shell_ellipsoid_kernel_2d(q, qx/q, qy/q, 165 157 radius_equat_core, 166 x_core,167 thick_shell,168 x_polar_shell,169 core_sld,170 s hell_sld,171 s olvent_sld,158 radius_polar_core, 159 radius_equat_shell, 160 radius_polar_shell, 161 sld_core, 162 sld_shell, 163 sld_solvent, 172 164 theta, 173 165 phi);
Note: See TracChangeset
for help on using the changeset viewer.