Changeset c036ddb in sasmodels for sasmodels/models
- Timestamp:
- Aug 7, 2018 10:45:45 PM (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:
- 7e923c2
- Parents:
- 7b0abf8
- Location:
- sasmodels/models
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
sasmodels/models/core_shell_sphere.py
rdc76240 rc036ddb 58 58 title = "Form factor for a monodisperse spherical particle with particle with a core-shell structure." 59 59 description = """ 60 F ^2(q) = 3/V_s [V_c (sld_core-sld_shell)(sin(q*radius)-q*radius*cos(q*radius))/(q*radius)^361 + V_s (sld_shell-sld_solvent)(sin(q*r_s)-q*r_s*cos(q*r_s))/(q*r_s)^3]60 F(q) = [V_c (sld_core-sld_shell) 3 (sin(q*radius)-q*radius*cos(q*radius))/(q*radius)^3 61 + V_s (sld_shell-sld_solvent) 3 (sin(q*r_s)-q*r_s*cos(q*r_s))/(q*r_s)^3] 62 62 63 63 V_s: Volume of the sphere shell -
sasmodels/models/ellipsoid.c
r01c8d9e rc036ddb 5 5 } 6 6 7 /* Fq overrides Iq 7 8 static double 8 9 Iq(double q, … … 20 21 // i(h) = int_0^1 Phi^2(h a sqrt(1 + u^2(v^2-1)) du 21 22 const double v_square_minus_one = square(radius_polar/radius_equatorial) - 1.0; 22 23 23 24 // translate a point in [-1,1] to a point in [0, 1] 24 25 // const double u = GAUSS_Z[i]*(upper-lower)/2 + (upper+lower)/2; … … 36 37 const double s = (sld - sld_solvent) * form_volume(radius_polar, radius_equatorial); 37 38 return 1.0e-4 * s * s * form; 38 } 39 } 40 */ 39 41 40 42 static void … … 72 74 const double form_avg = total_F1*zm; 73 75 const double s = (sld - sld_solvent) * form_volume(radius_polar, radius_equatorial); 76 *F1 = 1e-2 * s * form_avg; 74 77 *F2 = 1e-4 * s * s * form_squared_avg; 75 *F1 = 1e-2 * s * form_avg;76 78 } 77 78 79 80 81 82 79 83 80 static double -
sasmodels/models/ellipsoid.py
r2d81cfe rc036ddb 161 161 ] 162 162 163 163 164 source = ["lib/sas_3j1x_x.c", "lib/gauss76.c", "ellipsoid.c"] 165 166 have_Fq = True 164 167 165 168 def ER(radius_polar, radius_equatorial): -
sasmodels/models/sphere.c
r01c8d9e rc036ddb 4 4 } 5 5 6 // TODO: remove Iq when Iqxy can use Fq directly 6 7 static double Iq(double q, double sld, double sld_solvent, double radius) 7 8 { … … 11 12 static void Fq(double q, double *F1,double *F2, double sld, double solvent_sld, double radius) 12 13 { 13 const double fq = s phere_volume(radius) * sas_3j1x_x(q*radius);14 const double fq = sas_3j1x_x(q*radius); 14 15 const double contrast = (sld - solvent_sld); 15 const double form = 1e-2 *contrast* fq;16 *F1 = form;16 const double form = 1e-2 * contrast * sphere_volume(radius) * fq; 17 *F1 = form; 17 18 *F2 = form*form; 18 19 } -
sasmodels/models/sphere.py
r01c8d9e rc036ddb 67 67 ] 68 68 69 source = ["lib/sas_3j1x_x.c", "lib/sphere_form.c" , "sphere.c"]69 source = ["lib/sas_3j1x_x.c", "lib/sphere_form.c"] 70 70 71 c_code = """ 72 static double form_volume(double radius) 73 { 74 return sphere_volume(radius); 75 } 76 77 static void Fq(double q, double *F1,double *F2, double sld, double solvent_sld, double radius) 78 { 79 const double fq = sas_3j1x_x(q*radius); 80 const double contrast = (sld - solvent_sld); 81 const double form = 1e-2 * contrast * sphere_volume(radius) * fq; 82 *F1 = form; 83 *F2 = form*form; 84 } 85 """ 86 87 # TODO: figure this out by inspection 88 have_Fq = True 71 89 72 90 def ER(radius):
Note: See TracChangeset
for help on using the changeset viewer.