Changeset 217590b in sasmodels for sasmodels/models/fractal_core_shell.c
- Timestamp:
- Oct 20, 2016 2:48:48 PM (7 years ago)
- Branches:
- master, core_shell_microgels, costrafo411, magnetic_model, ticket-1257-vesicle-product, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
- Children:
- 5c94f41
- Parents:
- 2b9e63f
- git-author:
- Paul Kienzle <pkienzle@…> (10/20/16 14:47:25)
- git-committer:
- Paul Kienzle <pkienzle@…> (10/20/16 14:48:48)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sasmodels/models/fractal_core_shell.c
r6d96b66 r217590b 1 double form_volume(double radius, double thickness); 2 3 double Iq(double q, 4 double radius, 5 double thickness, 6 double core_sld, 7 double shell_sld, 8 double solvent_sld, 9 double volfraction, 10 double fractal_dim, 11 double cor_length); 12 13 double form_volume(double radius, double thickness) 1 static double 2 form_volume(double radius, double thickness) 14 3 { 15 4 return M_4PI_3 * cube(radius + thickness); 16 5 } 17 6 18 double Iq(double q, 19 double radius, 20 double thickness, 21 double core_sld, 22 double shell_sld, 23 double solvent_sld, 24 double volfraction, 25 double fractal_dim, 26 double cor_length) { 27 28 7 static double 8 Iq(double q, 9 double radius, 10 double thickness, 11 double core_sld, 12 double shell_sld, 13 double solvent_sld, 14 double volfraction, 15 double fractal_dim, 16 double cor_length) 17 { 18 const double sq = fractal_sq(q, radius, fractal_dim, cor_length); 29 19 const double pq = core_shell_kernel(q, radius, thickness, 30 20 core_sld, shell_sld, solvent_sld); 31 32 33 //calculate S(q)34 double sq;35 if (q > 0. && fractal_dim > 1.) {36 // q>0, D>037 const double D = fractal_dim;38 const double Dm1 = fractal_dim - 1.0;39 const double t1 = D*sas_gamma(Dm1)*sin((Dm1)*atan(q*cor_length));40 const double t2 = pow(q*radius, -D);41 const double t3 = pow(1.0 + 1.0/square(q*cor_length), -0.5*Dm1);42 sq = 1.0 + t1 * t2 * t3;43 } else if (q > 0.) {44 // q>0, D=145 sq = 1.0 + atan(q*cor_length) / (q*radius);46 } else if (fractal_dim > 1.) {47 // q=0, D>148 const double D = fractal_dim;49 sq = 1.0 + pow(cor_length/radius, D)*sas_gamma(D+1.0);50 } else {51 // q=0, D=152 sq = 1.0 + cor_length/radius;53 }54 21 55 22 // Note: core_shell_kernel already performs the 1e-4 unit conversion
Note: See TracChangeset
for help on using the changeset viewer.