Changeset 71b751d in sasmodels for sasmodels/models/hollow_cylinder.c
- Timestamp:
- Aug 14, 2018 10:09:34 AM (6 years ago)
- Branches:
- master, core_shell_microgels, magnetic_model, ticket-1257-vesicle-product, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
- Children:
- 86aa992
- Parents:
- 2f8cbb9
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sasmodels/models/hollow_cylinder.c
r108e70e r71b751d 1 1 //#define INVALID(v) (v.radius_core >= v.radius) 2 3 // From Igor library4 static double5 _hollow_cylinder_scaling(double integrand, double delrho, double volume)6 {7 return 1.0e-4 * square(volume * delrho) * integrand;8 }9 2 10 3 static double … … 30 23 31 24 32 static double33 Iq(double q, double radius, double thickness, double length,25 static void 26 Fq(double q, double *F1, double *F2, double radius, double thickness, double length, 34 27 double sld, double solvent_sld) 35 28 { … … 37 30 const double upper = 1.0; //limits of numerical integral 38 31 39 double summ = 0.0; //initialize intergral 32 double total_F1 = 0.0; //initialize intergral 33 double total_F2 = 0.0; 40 34 for (int i=0;i<GAUSS_N;i++) { 41 35 const double cos_theta = 0.5*( GAUSS_Z[i] * (upper-lower) + lower + upper ); … … 43 37 const double form = _fq(q*sin_theta, q*cos_theta, 44 38 radius, thickness, length); 45 summ += GAUSS_W[i] * form * form; 39 total_F1 += GAUSS_W[i] * form; 40 total_F2 += GAUSS_W[i] * form * form; 46 41 } 42 total_F1 *= 0.5*(upper-lower); 43 total_F2 *= 0.5*(upper-lower); 44 const double s = (sld - solvent_sld) * form_volume(radius, thickness, length); 45 *F1 = 1e-2 * s * total_F1; 46 *F2 = 1e-4 * s*s * total_F2; 47 } 47 48 48 const double Aq = 0.5*summ*(upper-lower);49 const double volume = form_volume(radius, thickness, length);50 return _hollow_cylinder_scaling(Aq, solvent_sld - sld, volume);51 }52 49 53 50 static double … … 57 54 { 58 55 const double form = _fq(qab, qc, radius, thickness, length); 59 60 const double vol = form_volume(radius, thickness, length); 61 return _hollow_cylinder_scaling(form*form, solvent_sld-sld, vol); 56 const double s = (sld - solvent_sld) * form_volume(radius, thickness, length); 57 return 1.0e-4*square(s * form); 62 58 }
Note: See TracChangeset
for help on using the changeset viewer.