double form_volume(double thick_core, double thick_layer, double radius, double n_stacking); double Iq(double q, double thick_core, double thick_layer, double radius, double n_stacking, double sigma_dnn, double core_sld, double layer_sld, double solvent_sld); static double _kernel(double qq, double radius, double core_sld, double layer_sld, double solvent_sld, double halfheight, double thick_layer, double zi, double sigma_dnn, double d, double n_stacking) { // qq is the q-value for the calculation (1/A) // radius is the core radius of the cylinder (A) // *_sld are the respective SLD's // halfheight is the *Half* CORE-LENGTH of the cylinder = L (A) // zi is the dummy variable for the integration (x in Feigin's notation) const double besarg1 = qq*radius*sin(zi); const double besarg2 = qq*radius*sin(zi); const double sinarg1 = qq*halfheight*cos(zi); const double sinarg2 = qq*(halfheight+thick_layer)*cos(zi); const double be1 = sas_J1c(besarg1); const double be2 = sas_J1c(besarg2); const double si1 = sin(sinarg1)/sinarg1; const double si2 = sin(sinarg2)/sinarg2; const double dr1 = (core_sld-solvent_sld); const double dr2 = (layer_sld-solvent_sld); const double area = M_PI*radius*radius; const double totald=2.0*(thick_layer+halfheight); const double t1 = area*(2.0*halfheight)*dr1*(si1)*(be1); const double t2 = area*dr2*(totald*si2-2.0*halfheight*si1)*(be2); double retval =((t1+t2)*(t1+t2))*sin(zi); // loop for the structure facture S(q) double sqq=0.0; for(int kk=1;kk