source: sasmodels/sasmodels/models/mass_surface_fractal.c @ d86f0fc

core_shell_microgelsmagnetic_modelticket-1257-vesicle-productticket_1156ticket_1265_superballticket_822_more_unit_tests
Last change on this file since d86f0fc was 6d96b66, checked in by Paul Kienzle <pkienzle@…>, 7 years ago

fractal models: handle limits of q=0 and dim=1

  • Property mode set to 100644
File size: 579 bytes
Line 
1#define INVALID(p) (p.fractal_dim_mass + p.fractal_dim_surf > 6.)
2static double
3Iq(double q,
4          double fractal_dim_mass,
5          double fractal_dim_surf,
6          double rg_cluster,
7          double rg_primary)
8{
9     //computation
10    const double Dm = 0.5*fractal_dim_mass;
11    const double Dt = 0.5*(6.0 - (fractal_dim_mass + fractal_dim_surf));
12
13    const double t1 = Dm==0. ? 1.0 : pow(1.0 + square(q*rg_cluster)/(3.0*Dm), -Dm);
14    const double t2 = Dt==0. ? 1.0 : pow(1.0 + square(q*rg_primary)/(3.0*Dt), -Dt);
15    const double form = t1*t2;
16
17    return form;
18}
Note: See TracBrowser for help on using the repository browser.