use of org.orekit.propagation.semianalytical.dsst.utilities.AuxiliaryElements in project Orekit by CS-SI.
the class DSSTThirdBody method updateShortPeriodTerms.
/**
* {@inheritDoc}
*/
@Override
public void updateShortPeriodTerms(final SpacecraftState... meanStates) throws OrekitException {
final Slot slot = shortPeriods.createSlot(meanStates);
for (final SpacecraftState meanState : meanStates) {
initializeStep(new AuxiliaryElements(meanState.getOrbit(), I));
// a / R3 up to power maxAR3Pow
final double aoR3 = a / R3;
aoR3Pow[0] = 1.;
for (int i = 1; i <= maxAR3Pow; i++) {
aoR3Pow[i] = aoR3 * aoR3Pow[i - 1];
}
// Qns coefficients
Qns = CoefficientsFactory.computeQns(gamma, maxAR3Pow, FastMath.max(maxEccPow, maxEccPowShort));
final GeneratingFunctionCoefficients gfCoefs = new GeneratingFunctionCoefficients(maxAR3Pow, MAX_ECCPOWER_SP, maxAR3Pow + 1);
// Compute additional quantities
// 2 * a / An
final double ax2oAn = -m2aoA / meanMotion;
// B / An
final double BoAn = BoA / meanMotion;
// 1 / ABn
final double ooABn = ooAB / meanMotion;
// C / 2ABn
final double Co2ABn = -mCo2AB / meanMotion;
// B / (A * (1 + B) * n)
final double BoABpon = BoABpo / meanMotion;
// -3 / n²a² = -3 / nA
final double m3onA = -3 / (A * meanMotion);
// Compute the C<sub>i</sub><sup>j</sup> and S<sub>i</sub><sup>j</sup> coefficients.
for (int j = 1; j < slot.cij.length; j++) {
// First compute the C<sub>i</sub><sup>j</sup> coefficients
final double[] currentCij = new double[6];
// Compute the cross derivatives operator :
final double SAlphaGammaCj = alpha * gfCoefs.getdSdgammaCj(j) - gamma * gfCoefs.getdSdalphaCj(j);
final double SAlphaBetaCj = alpha * gfCoefs.getdSdbetaCj(j) - beta * gfCoefs.getdSdalphaCj(j);
final double SBetaGammaCj = beta * gfCoefs.getdSdgammaCj(j) - gamma * gfCoefs.getdSdbetaCj(j);
final double ShkCj = h * gfCoefs.getdSdkCj(j) - k * gfCoefs.getdSdhCj(j);
final double pSagmIqSbgoABnCj = (p * SAlphaGammaCj - I * q * SBetaGammaCj) * ooABn;
final double ShkmSabmdSdlCj = ShkCj - SAlphaBetaCj - gfCoefs.getdSdlambdaCj(j);
currentCij[0] = ax2oAn * gfCoefs.getdSdlambdaCj(j);
currentCij[1] = -(BoAn * gfCoefs.getdSdhCj(j) + h * pSagmIqSbgoABnCj + k * BoABpon * gfCoefs.getdSdlambdaCj(j));
currentCij[2] = BoAn * gfCoefs.getdSdkCj(j) + k * pSagmIqSbgoABnCj - h * BoABpon * gfCoefs.getdSdlambdaCj(j);
currentCij[3] = Co2ABn * (q * ShkmSabmdSdlCj - I * SAlphaGammaCj);
currentCij[4] = Co2ABn * (p * ShkmSabmdSdlCj - SBetaGammaCj);
currentCij[5] = -ax2oAn * gfCoefs.getdSdaCj(j) + BoABpon * (h * gfCoefs.getdSdhCj(j) + k * gfCoefs.getdSdkCj(j)) + pSagmIqSbgoABnCj + m3onA * gfCoefs.getSCj(j);
// add the computed coefficients to the interpolators
slot.cij[j].addGridPoint(meanState.getDate(), currentCij);
// Compute the S<sub>i</sub><sup>j</sup> coefficients
final double[] currentSij = new double[6];
// Compute the cross derivatives operator :
final double SAlphaGammaSj = alpha * gfCoefs.getdSdgammaSj(j) - gamma * gfCoefs.getdSdalphaSj(j);
final double SAlphaBetaSj = alpha * gfCoefs.getdSdbetaSj(j) - beta * gfCoefs.getdSdalphaSj(j);
final double SBetaGammaSj = beta * gfCoefs.getdSdgammaSj(j) - gamma * gfCoefs.getdSdbetaSj(j);
final double ShkSj = h * gfCoefs.getdSdkSj(j) - k * gfCoefs.getdSdhSj(j);
final double pSagmIqSbgoABnSj = (p * SAlphaGammaSj - I * q * SBetaGammaSj) * ooABn;
final double ShkmSabmdSdlSj = ShkSj - SAlphaBetaSj - gfCoefs.getdSdlambdaSj(j);
currentSij[0] = ax2oAn * gfCoefs.getdSdlambdaSj(j);
currentSij[1] = -(BoAn * gfCoefs.getdSdhSj(j) + h * pSagmIqSbgoABnSj + k * BoABpon * gfCoefs.getdSdlambdaSj(j));
currentSij[2] = BoAn * gfCoefs.getdSdkSj(j) + k * pSagmIqSbgoABnSj - h * BoABpon * gfCoefs.getdSdlambdaSj(j);
currentSij[3] = Co2ABn * (q * ShkmSabmdSdlSj - I * SAlphaGammaSj);
currentSij[4] = Co2ABn * (p * ShkmSabmdSdlSj - SBetaGammaSj);
currentSij[5] = -ax2oAn * gfCoefs.getdSdaSj(j) + BoABpon * (h * gfCoefs.getdSdhSj(j) + k * gfCoefs.getdSdkSj(j)) + pSagmIqSbgoABnSj + m3onA * gfCoefs.getSSj(j);
// add the computed coefficients to the interpolators
slot.sij[j].addGridPoint(meanState.getDate(), currentSij);
if (j == 1) {
// Compute the C⁰ coefficients using Danielson 2.5.2-15a.
final double[] value = new double[6];
for (int i = 0; i < 6; ++i) {
value[i] = currentCij[i] * k / 2. + currentSij[i] * h / 2.;
}
slot.cij[0].addGridPoint(meanState.getDate(), value);
}
}
}
}
use of org.orekit.propagation.semianalytical.dsst.utilities.AuxiliaryElements in project Orekit by CS-SI.
the class DSSTZonal method updateShortPeriodTerms.
/**
* {@inheritDoc}
*/
@Override
public void updateShortPeriodTerms(final SpacecraftState... meanStates) throws OrekitException {
final Slot slot = zonalSPCoefs.createSlot(meanStates);
for (final SpacecraftState meanState : meanStates) {
initializeStep(new AuxiliaryElements(meanState.getOrbit(), I));
// h * k.
this.hk = h * k;
// k² - h².
this.k2mh2 = k * k - h * h;
// (k² - h²) / 2.
this.k2mh2o2 = k2mh2 / 2.;
// 1 / (n² * a²) = 1 / (n * A)
this.oon2a2 = 1 / (A * meanMotion);
// 1 / (n² * a) = a / (n * A)
this.oon2a = a * oon2a2;
// χ³ / (n² * a)
this.x3on2a = XXX * oon2a;
// χ / (n² * a²)
this.xon2a2 = X * oon2a2;
// (C * χ) / ( 2 * n² * a² )
this.cxo2n2a2 = xon2a2 * C / 2;
// (χ²) / (n² * a² * (χ + 1 ) )
this.x2on2a2xp1 = xon2a2 * X / (X + 1);
// B * B
this.BB = B * B;
// Compute rhoj and sigmaj
final double[][] rhoSigma = computeRhoSigmaCoefficients(meanState.getDate(), slot);
// Compute Di
computeDiCoefficients(meanState.getDate(), slot);
// generate the Cij and Sij coefficients
final FourierCjSjCoefficients cjsj = new FourierCjSjCoefficients(meanState.getDate(), maxDegreeShortPeriodics, maxEccPowShortPeriodics, maxFrequencyShortPeriodics);
computeCijSijCoefficients(meanState.getDate(), slot, cjsj, rhoSigma);
}
}
Aggregations