source: sasmodels/sasmodels/models/gel_fit.c @ 6cefbc9

core_shell_microgelscostrafo411magnetic_modelrelease_v0.94release_v0.95ticket-1257-vesicle-productticket_1156ticket_1265_superballticket_822_more_unit_tests
Last change on this file since 6cefbc9 was 03cac08, checked in by Paul Kienzle <pkienzle@…>, 8 years ago

new generator produces code that compiles

  • Property mode set to 100644
File size: 750 bytes
Line 
1static double Iq(double q,
2          double guinier_scale,
3          double lorentzian_scale,
4          double gyration_radius,
5          double fractal_exp,
6          double cor_length)
7{
8    // Lorentzian Term
9    ////////////////////////double a(x[i]*x[i]*zeta*zeta);
10    double lorentzian_term = square(q*cor_length);
11    lorentzian_term = 1.0 + ((fractal_exp + 1.0)/3.0)*lorentzian_term;
12    lorentzian_term = pow(lorentzian_term, (fractal_exp/2.0) );
13
14    // Exponential Term
15    ////////////////////////double d(x[i]*x[i]*rg*rg);
16    double exp_term = square(q*gyration_radius);
17    exp_term = exp(-1.0*(exp_term/3.0));
18
19    // Scattering Law
20    double result = lorentzian_scale/lorentzian_term + guinier_scale*exp_term;
21    return result;
22}
Note: See TracBrowser for help on using the repository browser.