// NOTE that "length" here is the full height of the core! static double form_volume(double r_minor, double x_core, double thick_rim, double thick_face, double length) { return M_PI*(r_minor+thick_rim)*(r_minor*x_core+thick_rim)*(length+2.0*thick_face); } static double Iq(double q, double r_minor, double x_core, double thick_rim, double thick_face, double length, double sld_core, double sld_face, double sld_rim, double sld_solvent) { // core_shell_bicelle_elliptical, RKH Dec 2016, based on elliptical_cylinder and core_shell_bicelle // tested against limiting cases of cylinder, elliptical_cylinder, stacked_discs, and core_shell_bicelle const double halfheight = 0.5*length; const double r_major = r_minor * x_core; const double r2A = 0.5*(square(r_major) + square(r_minor)); const double r2B = 0.5*(square(r_major) - square(r_minor)); const double vol1 = M_PI*r_minor*r_major*(2.0*halfheight); const double vol2 = M_PI*(r_minor+thick_rim)*(r_major+thick_rim)*2.0*(halfheight+thick_face); const double vol3 = M_PI*r_minor*r_major*2.0*(halfheight+thick_face); const double dr1 = vol1*(sld_core-sld_face); const double dr2 = vol2*(sld_rim-sld_solvent); const double dr3 = vol3*(sld_face-sld_rim); //initialize integral double outer_sum = 0.0; for(int i=0;i