source: sasmodels/sasmodels/models/surface_fractal.c @ a807206

core_shell_microgelscostrafo411magnetic_modelrelease_v0.94release_v0.95ticket-1257-vesicle-productticket_1156ticket_1265_superballticket_822_more_unit_tests
Last change on this file since a807206 was a807206, checked in by butler, 8 years ago

updating more parameter names addressing #649

  • Property mode set to 100644
File size: 1.1 KB
RevLine 
[da84551]1double form_volume(double radius);
2
[513efc5]3double Iq(double q,
4          double radius,
[a807206]5          double fractal_dim_surf,
[513efc5]6          double cutoff_length);
7
8static double _surface_fractal_kernel(double q,
[da84551]9    double radius,
[a807206]10    double fractal_dim_surf,
[da84551]11    double cutoff_length)
12{
13    double pq, sq, mmo, result;
14
[513efc5]15    //Replaced the original formula with Taylor expansion near zero.
16    //pq = pow((3.0*(sin(q*radius) - q*radius*cos(q*radius))/pow((q*radius),3)),2);
17
[9c461c7]18    pq = sph_j1c(q*radius);
[513efc5]19    pq = pq*pq;
[da84551]20
21    //calculate S(q)
[a807206]22    mmo = 5.0 - fractal_dim_surf;
[6794301]23    sq  = sas_gamma(mmo)*sin(-(mmo)*atan(q*cutoff_length));
[da84551]24    sq *= pow(cutoff_length, mmo);
25    sq /= pow((1.0 + (q*cutoff_length)*(q*cutoff_length)),(mmo/2.0));
26    sq /= q;
27
28    //combine and return
29    result = pq * sq;
30
31    return result;
32}
33double form_volume(double radius){
34
35    return 1.333333333333333*M_PI*radius*radius*radius;
36}
37
38double Iq(double q,
39    double radius,
[a807206]40    double fractal_dim_surf,
[da84551]41    double cutoff_length
42    )
43{
[a807206]44    return _surface_fractal_kernel(q, radius, fractal_dim_surf, cutoff_length);
[da84551]45}
Note: See TracBrowser for help on using the repository browser.