source: sasmodels/sasmodels/models/mass_fractal.c @ 3e8ea5d

core_shell_microgelscostrafo411magnetic_modelticket-1257-vesicle-productticket_1156ticket_1265_superballticket_822_more_unit_tests
Last change on this file since 3e8ea5d was 3a48772, checked in by Paul Kienzle <pkienzle@…>, 8 years ago

use predefined constants for fractions of pi

  • Property mode set to 100644
File size: 1.1 KB
Line 
1double form_volume(double radius);
2
3double Iq(double q,
4          double radius,
5          double fractal_dim_mass,
6          double cutoff_length);
7
8static double _mass_fractal_kernel(double q,
9          double radius,
10          double fractal_dim_mass,
11          double cutoff_length)
12{
13    // Actively check the argument.
14    if (fractal_dim_mass <= 1.0){
15       return 0.0;
16    }
17
18    //calculate P(q)
19    double pq = sph_j1c(q*radius);
20    pq = pq*pq;
21
22    //calculate S(q)
23    double mmo = fractal_dim_mass-1.0;
24    double sq = sas_gamma(mmo)*sin((mmo)*atan(q*cutoff_length));
25    sq *= pow(cutoff_length, mmo);
26    sq /= pow((1.0 + (q*cutoff_length)*(q*cutoff_length)),(mmo/2.0));
27    sq /= q;
28
29    //combine and return
30    double result = pq * sq;
31
32    return result;
33}
34double form_volume(double radius){
35
36    return M_4PI_3*radius*radius*radius;
37}
38
39double Iq(double q,
40          double radius,
41          double fractal_dim_mass,
42          double cutoff_length)
43{
44    return _mass_fractal_kernel(q,
45           radius,
46           fractal_dim_mass,
47           cutoff_length);
48}
Note: See TracBrowser for help on using the repository browser.