Changeset 3c97ff0 in sasmodels for sasmodels/models/barbell.c
- Timestamp:
- Jan 6, 2016 7:23:47 PM (8 years ago)
- Branches:
- master, core_shell_microgels, costrafo411, magnetic_model, release_v0.94, release_v0.95, ticket-1257-vesicle-product, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
- Children:
- 3f832f9
- Parents:
- 74667d3
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sasmodels/models/barbell.c
rc138211 r3c97ff0 1 1 double form_volume(double bell_radius, double radius, double length); 2 double Iq(double q, double sld, double solvent_sld, double bell_radius, double radius, double length); 2 double Iq(double q, double sld, double solvent_sld, 3 double bell_radius, double radius, double length); 3 4 double Iqxy(double qx, double qy, double sld, double solvent_sld, 4 double bell_radius, double radius, double length, double theta, double phi); 5 double bell_radius, double radius, double length, 6 double theta, double phi); 5 7 6 8 //barbell kernel - same as dumbell 7 9 double _bell_kernel(double q, double h, double bell_radius, 8 double length, double sin_alpha, double cos_alpha);10 double length, double sin_alpha, double cos_alpha); 9 11 double _bell_kernel(double q, double h, double bell_radius, 10 double length, double sin_alpha, double cos_alpha)12 double length, double sin_alpha, double cos_alpha) 11 13 { 12 14 const double upper = 1.0; … … 16 18 for (int i = 0; i < 76; i++){ 17 19 const double t = 0.5*(Gauss76Z[i]*(upper-lower)+upper+lower); 18 const double arg1 = q*cos_alpha*(bell_radius*t+h+length*0.5); 19 const double arg2 = q*bell_radius*sin_alpha*sqrt(1.0-t*t); 20 20 const double arg1 = q*cos_alpha*(bell_radius*t+h+length*0.5); 21 const double arg2 = q*bell_radius*sin_alpha*sqrt(1.0-t*t); 21 22 const double be = (arg2 == 0.0 ? 0.5 :J1(arg2)/arg2); 22 23 const double Fq = cos(arg1)*(1.0-t*t)*be; 24 25 total += Gauss76Wt[i] * Fq; 23 const double Fq = cos(arg1)*(1.0-t*t)*be; 24 total += Gauss76Wt[i] * Fq; 26 25 } 27 26 const double integral = 0.5*(upper-lower)*total; … … 44 43 45 44 double Iq(double q, double sld, 46 double solvent_sld,47 double bell_radius,48 double radius,49 double length)45 double solvent_sld, 46 double bell_radius, 47 double radius, 48 double length) 50 49 { 51 50 double sn, cn; // slots to hold sincos function output … … 84 83 85 84 double Iqxy(double qx, double qy, 86 double sld,87 double solvent_sld,88 double bell_radius,89 double radius,90 double length,91 double theta,92 double phi)85 double sld, 86 double solvent_sld, 87 double bell_radius, 88 double radius, 89 double length, 90 double theta, 91 double phi) 93 92 { 94 93 double sn, cn; // slots to hold sincos function output
Note: See TracChangeset
for help on using the changeset viewer.