source: sasmodels/sasmodels/models/mass_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.3 KB
Line 
1double form_volume(double radius);
2
3double Iq(double q,
4          double fractal_dim_mass,
5          double fractal_dim_surf,
6          double rg_cluster,
7          double primary_rg);
8
9static double _mass_surface_fractal_kernel(double q,
10          double fractal_dim_mass,
11          double fractal_dim_surf,
12          double rg_cluster,
13          double primary_rg)
14{
15     //computation
16    double tot_dim = 6.0 - fractal_dim_surf - fractal_dim_mass;
17    fractal_dim_mass /= 2.0;
18    tot_dim /= 2.0;
19
20    double rc_norm = rg_cluster * rg_cluster / (3.0 * fractal_dim_mass);
21    double rp_norm = primary_rg * primary_rg / (3.0 * tot_dim);
22
23    //x for P
24    double x_val1 = 1.0 +  q * q * rc_norm;
25    double x_val2 = 1.0 +  q * q * rp_norm;
26
27    double inv_form = pow(x_val1, fractal_dim_mass) * pow(x_val2, tot_dim);
28
29    //another singular
30    if (inv_form == 0.0) return 0.0;
31
32    double form_factor = 1.0;
33    form_factor /= inv_form;
34
35    return (form_factor);
36}
37double form_volume(double radius){
38
39    return 1.333333333333333*M_PI*radius*radius*radius;
40}
41
42double Iq(double q,
43          double fractal_dim_mass,
44          double fractal_dim_surf,
45          double rg_cluster,
46          double primary_rg)
47{
48    return _mass_surface_fractal_kernel(q,
49            fractal_dim_mass,
50            fractal_dim_surf,
51            rg_cluster,
52            primary_rg);
53}
Note: See TracBrowser for help on using the repository browser.