# source:sasmodels/sasmodels/models/triaxial_ellipsoid.c@68dd6a9

core_shell_microgelscostrafo411magnetic_modelticket-1257-vesicle-productticket_1156ticket_1265_superballticket_822_more_unit_tests
Last change on this file since 68dd6a9 was 68dd6a9, checked in by Paul Kienzle <pkienzle@…>, 3 years ago

triaxial ellipsoid: adjust to new asymmetric orientation definition; reimplement 1D model from Finnigan and Jacobs, 1971. Refs #890.

• Property mode set to `100644`
File size: 2.8 KB
Line
2double Iq(double q, double sld, double sld_solvent,
4double Iqxy(double qx, double qy, double sld, double sld_solvent,
6
8
9
11{
13}
14
15double Iq(double q,
16    double sld,
17    double sld_solvent,
21{
24    // translate a point in [-1,1] to a point in [0, pi/2]
25    const double zm = M_PI_4;
26    const double zb = M_PI_4;
27    double outer = 0.0;
28    for (int i=0;i<76;i++) {
29        //const double u = Gauss76Z[i]*(upper-lower)/2 + (upper + lower)/2;
30        const double phi = Gauss76Z[i]*zm + zb;
31        const double pa_sinsq_phi = pa*square(sin(phi));
32
33        double inner = 0.0;
34        const double um = 0.5;
35        const double ub = 0.5;
36        for (int j=0;j<76;j++) {
37            // translate a point in [-1,1] to a point in [0, 1]
38            const double usq = square(Gauss76Z[j]*um + ub);
39            const double r = radius_equat_major*sqrt(pa_sinsq_phi*(1.0-usq) + 1.0 + pc*usq);
40            const double fq = sas_3j1x_x(q*r);
41            inner += Gauss76Wt[j] * fq * fq;
42        }
43        outer += Gauss76Wt[i] * inner;  // correcting for dx later
44    }
45    // translate integration ranges from [-1,1] to [lower,upper] and normalize by 4 pi
46    const double fqsq = outer/4.0;  // = outer*um*zm*8.0/(4.0*M_PI);
48    return 1.0e-4 * s * s * fqsq;
49}
50
51double Iqxy(double qx, double qy,
52    double sld,
53    double sld_solvent,
57    double theta,
58    double phi,
59    double psi)
60{
61    double q, xhat, yhat, zhat;
62    ORIENT_ASYMMETRIC(qx, qy, theta, phi, psi, q, xhat, yhat, zhat);
63
64    const double r = sqrt(square(radius_equat_minor*xhat)