Changeset b7529e2 in sasmodels
- Timestamp:
- Feb 24, 2016 9:43:51 AM (9 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:
- 103ea45
- Parents:
- 8b9adb5
- Location:
- sasmodels/models
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
sasmodels/models/multi_shell.c
rc9f885e rb7529e2 1 double form_volume(void);2 3 1 double Iq(double q, 4 2 double core_radius, … … 18 16 19 17 static 20 double F_func(double qr) {21 double sc;22 23 if (qr > 0.1){24 double sn, cn;25 SINCOS(qr, sn, cn);26 sc = (3.0*(sn - qr*cn)/(qr*qr*qr));27 } else{28 // herbie.uwplse.org/demo low-q solution for the above.29 sc = 1.0 + 0.0035714285714285718*(qr*qr*qr*qr) - 0.1*qr*qr;30 }31 32 return sc;33 }34 static35 18 double multi_shell_kernel(double q, 36 19 double core_radius, … … 42 25 { 43 26 //calculate with a loop, two shells at a time 44 45 46 27 int ii=0; 28 double fval=0.0; 29 double voli = 0.0; 47 30 const double sldi = core_sld-shell_sld; 48 31 49 50 32 do { 33 double ri = core_radius + (double)ii*(s_thickness + w_thickness); 51 34 52 35 // layer 1 53 54 fval += voli*sldi*F_func(ri*q);36 voli = 4.0*M_PI/3.0*ri*ri*ri; 37 fval += voli*sldi*sph_j1c(ri*q); 55 38 56 39 ri += s_thickness; 57 40 58 41 // layer 2 59 60 fval -= voli*sldi*F_func(ri*q);42 voli = 4.0*M_PI/3.0*ri*ri*ri; 43 fval -= voli*sldi*sph_j1c(ri*q); 61 44 62 45 //do 2 layers at a time 63 46 ii+=1; 64 47 65 48 } while(ii<=n_pairs-1); //change to make 0 < n_pairs < 2 correspond to … … 68 51 fval *= 1.0e-4*fval/voli; 69 52 70 return(fval); 71 } 72 73 double form_volume(void){ 74 return NAN; 53 return(fval); 75 54 } 76 55 -
sasmodels/models/multi_shell.py
rc9f885e rb7529e2 67 67 # pylint: enable=bad-whitespace, line-too-long 68 68 69 source = ["multi_shell.c"] 69 source = ["lib/sph_j1c.c", "multi_shell.c"] 70 71 polydispersity = ["core_radius", "n_pairs"] 70 72 71 73 demo = dict(scale=1, background=0,
Note: See TracChangeset
for help on using the changeset viewer.