source: sasmodels/sasmodels/models/lib/cylkernel.c @ ff7119b

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

docu update

  • Property mode set to 100644
File size: 796 bytes
Line 
1// Compute the form factor for a cylinder
2//     F^2(q) sin a
3// given
4//     F(q) = sin(Q L/2 cos a)/(Q L/2 cos a) * 2 J1(Q R sin a) / (Q R sin a)
5// q is the q-value for the calculation (1/A)
6// radius is the radius of the cylinder (A)
7// halflength is the HALF-LENGTH of the cylinder = L/2 (A)
8real CylKernel(real q, real radius, real halflength, real theta);
9real CylKernel(real q, real radius, real halflength, real theta)
10{
11    real sn, cn;
12    SINCOS(theta, sn, cn);
13    const real besarg = q*radius*sn;
14    const real siarg = q*halflength*cn;
15    // lim_{x->0} J1(x)/x = 1/2,  lim_{x->0} sin(x)/x = 1
16    const real bj = (besarg == REAL(0.0) ? REAL(0.5) : J1(besarg)/besarg);
17    const real si = (siarg == REAL(0.0) ? REAL(1.0) : sin(siarg)/siarg);
18    return REAL(4.0)*sn*bj*bj*si*si;
19}
Note: See TracBrowser for help on using the repository browser.