/** * Scattering intensity for dispersed CCylinderModel * * WARNING: THIS FILE WAS GENERATED BY IGORGENERATOR.PY * DO NOT MODIFY THIS FILE, MODIFY cylinder.h * AND RE-RUN THE GENERATOR SCRIPT * * This code was written as part of the DANSE project * http://danse.us/trac/sans/ * * Copyright 2007: University of Tennessee, for the DANSE project */ #include "cylinder.h" #include #include "libCylinder.h" #include "libSphere.h" #include "c_disperser.h" /** * Function to evaluate 2D scattering function * * @param dp: parameters of the function * @param q: q-value * @param phi: angle of the q-vector in the plane of the detector, relative to q_x * @return: function value */ double oriented_cylinder_2D(double pars[], double q, double phi) { CylinderParameters danse_pars; // List of default parameters: // pars[0]: scale = 1.0 // pars[1]: radius = 20.0 A // pars[2]: length = 400.0 A // pars[3]: contrast = 3e-06 A-2 // pars[4]: background = 0.0 cm-1 // pars[5]: cyl_theta = 1.0 rad // pars[6]: cyl_phi = 1.0 rad danse_pars.scale = pars[0]; danse_pars.radius = pars[1]; danse_pars.length = pars[2]; danse_pars.contrast = pars[3]; danse_pars.background = pars[4]; danse_pars.cyl_theta = pars[5]; danse_pars.cyl_phi = pars[6]; return cylinder_analytical_2D(&danse_pars, q, phi); } /** * Function to evaluate dispersed 2D scattering function * * @param dp: parameters of the function * @param q: q-value * @param phi: angle of the q-vector in the plane of the detector, relative to q_x * @return: function value * // List of default parameters: // pars[0]: scale = 1.0 // pars[1]: radius = 20.0 A // pars[2]: length = 400.0 A // pars[3]: contrast = 3e-06 A-2 // pars[4]: background = 0.0 cm-1 // pars[5]: cyl_theta = 1.0 rad // pars[6]: cyl_phi = 1.0 rad // pars[7]: dispersion of radius // pars[8]: dispersion of cyl_theta // pars[9]: dispersion of cyl_phi // pars[10]: number of points in dispersion curve */ double disperse_cylinder_analytical_2D(double dp[], double q, double phi) { int paramList[3]; double sigmaList[3]; int npts; int i; double pars[11]; // radius paramList[0] = 1; // cyl_theta paramList[1] = 5; // cyl_phi paramList[2] = 6; sigmaList[0] = dp[7]; sigmaList[1] = dp[8]; sigmaList[2] = dp[9]; npts = (int)(floor(dp[10])); // Internal copy of parameters for(i=0; i<11; i++ ) { pars[i] = dp[i]; } return c_disperser( &oriented_cylinder_2D, pars, 3, paramList, sigmaList, npts, q, phi ); }