69 auto nom = (lB + lD * (J * J + J + 1) + lH *
pow2(J * J + J + 1)) * (2 *
sqrt(J * J + J) / (2 * J + 1));
72 B * J * (J - 1) - D *
pow2(J * (J - 1)) + H *
pow3(J * (J - 1)) +
73 (gB + gD * J * (J - 1) + gH *
pow2(J * (J - 1))) * (J - 1) +
74 (lB + lD * J * (J - 1) + lH *
pow2(J * (J - 1))) *
75 (2. / 3. - 2 * J / (2 * J + 1)) -
76 (B * (J + 2) * (J + 1) - D *
pow2((J + 2) * (J + 1)) +
77 H *
pow3((J + 2) * (J + 1)) -
78 (gB + gD * (J + 2) * (J + 1) + gH *
pow2((J + 2) * (J + 1))) * (J + 2) +
79 (lB + lD * (J + 2) * (J + 1) + lH *
pow2((J + 2) * (J + 1))) *
80 (2. / 3. - 2 * (J + 1) / (2 * J + 1)));
82 auto phi = atan2(2 * nom, denom) / 2;
85 return (GS + GR) / (J * (J + 1)) - GR;
87 return (GS + GR) * (
pow2(cos(phi)) / J -
pow2(sin(phi)) / (J + 1)) +
88 2 * GLE * cos(2 * phi) / (2 * J + 1) - GR;
90 return (GS + GR) * (
pow2(sin(phi)) / J -
pow2(cos(phi)) / (J + 1)) -
91 2 * GLE * cos(2 * phi) / (2 * J + 1) - GR;
102 return gperp + (gperp + gpara) *
Numeric(k*k / (j*(j+1)));
106 if (qid.SpeciesName() ==
"O2") {
126 JU, NU, GS, GR, GLE, B, D, H, gB, gD, gH, lB, lD, lH);
130 JL, NL, GS, GR, GLE, B, D, H, gB, gD, gH, lB, lD, lH);
152 JU, NU, GS, GR, GLE, B, D, H, gB, gD, gH, lB, lD, lH);
156 JL, NL, GS, GR, GLE, B, D, H, gB, gD, gH, lB, lD, lH);
160 }
else if (qid.SpeciesName() ==
"CO") {
162 Numeric gperp = -0.2689 / Constant::mass_ratio_electrons_per_proton;
164 return Model({gperp, gperp});
166 }
else if (qid.SpeciesName() ==
"OCS") {
168 Numeric gperp = -.02889 / Constant::mass_ratio_electrons_per_proton;
169 Numeric gpara = 0 / Constant::mass_ratio_electrons_per_proton;
172 auto KU = qid.UpperQuantumNumber(QuantumNumberType::Ka);
174 auto KL = qid.LowerQuantumNumber(QuantumNumberType::Ka);
179 Numeric gperp = -.0285 / Constant::mass_ratio_electrons_per_proton;
180 Numeric gpara = -.061 / Constant::mass_ratio_electrons_per_proton;
183 auto KU = qid.UpperQuantumNumber(QuantumNumberType::Ka);
185 auto KL = qid.LowerQuantumNumber(QuantumNumberType::Ka);
190 }
else if (qid.SpeciesName() ==
"CO2") {
192 Numeric gperp = -.05508 / Constant::mass_ratio_electrons_per_proton;
193 Numeric gpara = 0 / Constant::mass_ratio_electrons_per_proton;
196 auto KU = qid.UpperQuantumNumber(QuantumNumberType::Ka);
198 auto KL = qid.LowerQuantumNumber(QuantumNumberType::Ka);
208 return Model({upperzero ? 0 : NAN, lowerzero ? 0 : NAN});
219 return Eigen::Vector3d(v, u,
w).normalized();
226 return Eigen::Vector3d(cos(a)*sin(z), sin(a)*sin(z), cos(z));
233 return Eigen::Vector3d(cos(a)*cos(z), sin(a)*cos(z), -sin(z));
246 output.
H = std::hypot(std::hypot(u, v),
w);
251 output.
dH_dv = nH[0];
252 output.
dH_du = nH[1];
253 output.
dH_dw = nH[2];
256 const Numeric cos_theta = n.dot(nH);
258 output.
theta = std::acos(cos_theta);
259 if (sin_theta not_eq 0) {
260 const Eigen::Vector3d dtheta = (nH * cos_theta - n) / (output.
H * sin_theta);
271 const Eigen::Vector3d inplane = nH - nH.dot(n) * n;
272 const Numeric y = ev.cross(inplane).dot(n);
274 output.
eta = std::atan2(
y,
x);
275 if (
x not_eq 0 or
y not_eq 0) {