source: sasmodels/sasmodels/models/fractal.c @ 4788822

core_shell_microgelscostrafo411magnetic_modelticket-1257-vesicle-productticket_1156ticket_1265_superballticket_822_more_unit_tests
Last change on this file since 4788822 was 4788822, checked in by butler, 3 years ago

added polydispersity back to fractal (as it used to be, as the
documentation implies and as core_shell_fractal already has). Also
formatted documentation according to current standard for references and
authorship/verification. Fixes #877

  • Property mode set to 100644
File size: 783 bytes
Line 
1#define INVALID(p) (p.fractal_dim < 0.0)
2
3 static double
4 form_volume(double radius)
5 {
6     return M_4PI_3 * cube(radius);
7 }
8
9static double
10Iq(double q,
11   double volfraction,
12   double radius,
13   double fractal_dim,
14   double cor_length,
15   double sld_block,
16   double sld_solvent)
17{
18    const double sq = fractal_sq(q, radius, fractal_dim, cor_length);
19
20    //calculate P(q) for the spherical subunits
21    const double pq = square(form_volume(radius) * (sld_block-sld_solvent)
22                      *sas_3j1x_x(q*radius));
23
24    // scale to units cm-1 sr-1 (assuming data on absolute scale)
25    //    convert I(1/A) to (1/cm)  => 1e8 * I(q)
26    //    convert rho^2 in 10^-6 1/A to 1/A  => 1e-12 * I(q)
27    //    combined: 1e-4 * I(q)
28
29    return 1.e-4 * volfraction * sq * pq;
30}
31
Note: See TracBrowser for help on using the repository browser.