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

core_shell_microgelscostrafo411magnetic_modelrelease_v0.94release_v0.95ticket-1257-vesicle-productticket_1156ticket_1265_superballticket_822_more_unit_tests
Last change on this file since d507c3a was 9c461c7, checked in by piotr, 8 years ago
  1. Code review from PK: renamed J1c to sph_j1c
  2. Fixed mass_fractal
  • Property mode set to 100644
File size: 1.5 KB
Line 
1double form_volume(double radius);
2
3double Iq(double q,
4          double radius,
5          double surface_dim,
6          double cutoff_length);
7
8double Iqxy(double qx, double qy,
9            double radius,
10            double surface_dim,
11            double cutoff_length);
12
13static double _surface_fractal_kernel(double q,
14    double radius,
15    double surface_dim,
16    double cutoff_length)
17{
18    double pq, sq, mmo, result;
19
20    //Replaced the original formula with Taylor expansion near zero.
21    //pq = pow((3.0*(sin(q*radius) - q*radius*cos(q*radius))/pow((q*radius),3)),2);
22
23    pq = sph_j1c(q*radius);
24    pq = pq*pq;
25
26    //calculate S(q)
27    mmo = 5.0 - surface_dim;
28    sq  = exp(lanczos_gamma(mmo))*sin(-(mmo)*atan(q*cutoff_length));
29    sq *= pow(cutoff_length, mmo);
30    sq /= pow((1.0 + (q*cutoff_length)*(q*cutoff_length)),(mmo/2.0));
31    sq /= q;
32
33    //combine and return
34    result = pq * sq;
35
36    return result;
37}
38double form_volume(double radius){
39
40    return 1.333333333333333*M_PI*radius*radius*radius;
41}
42
43double Iq(double q,
44    double radius,
45    double surface_dim,
46    double cutoff_length
47    )
48{
49    return _surface_fractal_kernel(q, radius, surface_dim, cutoff_length);
50}
51
52// Iqxy is never called since no orientation or magnetic parameters.
53double Iqxy(double qx, double qy,
54    double radius,
55    double surface_dim,
56    double cutoff_length)
57{
58    double q = sqrt(qx*qx + qy*qy);
59    return _surface_fractal_kernel(q, radius, surface_dim, cutoff_length);
60}
61
Note: See TracBrowser for help on using the repository browser.