Changeset ff7119b in sasmodels for sasmodels/models/lib/cylkernel.c
- Timestamp:
- Aug 26, 2014 8:27:06 PM (10 years ago)
- Branches:
- master, core_shell_microgels, costrafo411, magnetic_model, release_v0.94, release_v0.95, ticket-1257-vesicle-product, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
- Children:
- 5d4777d
- Parents:
- a7684e5
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sasmodels/models/lib/cylkernel.c
r14de349 rff7119b 1 1 // Compute the form factor for a cylinder 2 // qq is the q-value for the calculation (1/A) 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) 3 6 // radius is the radius of the cylinder (A) 4 // h is the HALF-LENGTH of the cylinder = L/2 (A)5 real CylKernel(real q, real radius, real h , real theta);6 real CylKernel(real q, real radius, real h , real theta)7 // halflength is the HALF-LENGTH of the cylinder = L/2 (A) 8 real CylKernel(real q, real radius, real halflength, real theta); 9 real CylKernel(real q, real radius, real halflength, real theta) 7 10 { 8 11 real sn, cn; 9 12 SINCOS(theta, sn, cn); 10 13 const real besarg = q*radius*sn; 11 const real siarg = q*h *cn;14 const real siarg = q*halflength*cn; 12 15 // lim_{x->0} J1(x)/x = 1/2, lim_{x->0} sin(x)/x = 1 13 16 const real bj = (besarg == REAL(0.0) ? REAL(0.5) : J1(besarg)/besarg); 14 17 const real si = (siarg == REAL(0.0) ? REAL(1.0) : sin(siarg)/siarg); 15 return REAL(4.0)*s in(theta)*bj*bj*si*si;18 return REAL(4.0)*sn*bj*bj*si*si; 16 19 }
Note: See TracChangeset
for help on using the changeset viewer.