use of org.orekit.utils.TimeStampedPVCoordinates in project Orekit by CS-SI.
the class EquinoctialOrbit method initPVCoordinates.
/**
* {@inheritDoc}
*/
protected TimeStampedPVCoordinates initPVCoordinates() {
// position and velocity
computePVWithoutA();
// acceleration
final double r2 = partialPV.getPosition().getNormSq();
final Vector3D keplerianAcceleration = new Vector3D(-getMu() / (r2 * FastMath.sqrt(r2)), partialPV.getPosition());
final Vector3D acceleration = hasDerivatives() ? keplerianAcceleration.add(nonKeplerianAcceleration()) : keplerianAcceleration;
return new TimeStampedPVCoordinates(getDate(), partialPV.getPosition(), partialPV.getVelocity(), acceleration);
}
use of org.orekit.utils.TimeStampedPVCoordinates in project Orekit by CS-SI.
the class EquinoctialOrbit method shiftedBy.
/**
* {@inheritDoc}
*/
public EquinoctialOrbit shiftedBy(final double dt) {
// use Keplerian-only motion
final EquinoctialOrbit keplerianShifted = new EquinoctialOrbit(a, ex, ey, hx, hy, getLM() + getKeplerianMeanMotion() * dt, PositionAngle.MEAN, getFrame(), getDate().shiftedBy(dt), getMu());
if (hasDerivatives()) {
// extract non-Keplerian acceleration from first time derivatives
final Vector3D nonKeplerianAcceleration = nonKeplerianAcceleration();
// add quadratic effect of non-Keplerian acceleration to Keplerian-only shift
keplerianShifted.computePVWithoutA();
final Vector3D fixedP = new Vector3D(1, keplerianShifted.partialPV.getPosition(), 0.5 * dt * dt, nonKeplerianAcceleration);
final double fixedR2 = fixedP.getNormSq();
final double fixedR = FastMath.sqrt(fixedR2);
final Vector3D fixedV = new Vector3D(1, keplerianShifted.partialPV.getVelocity(), dt, nonKeplerianAcceleration);
final Vector3D fixedA = new Vector3D(-getMu() / (fixedR2 * fixedR), keplerianShifted.partialPV.getPosition(), 1, nonKeplerianAcceleration);
// build a new orbit, taking non-Keplerian acceleration into account
return new EquinoctialOrbit(new TimeStampedPVCoordinates(keplerianShifted.getDate(), fixedP, fixedV, fixedA), keplerianShifted.getFrame(), keplerianShifted.getMu());
} else {
// Keplerian-only motion is all we can do
return keplerianShifted;
}
}
use of org.orekit.utils.TimeStampedPVCoordinates in project Orekit by CS-SI.
the class KeplerianOrbit method shiftedBy.
/**
* {@inheritDoc}
*/
public KeplerianOrbit shiftedBy(final double dt) {
// use Keplerian-only motion
final KeplerianOrbit keplerianShifted = new KeplerianOrbit(a, e, i, pa, raan, getMeanAnomaly() + getKeplerianMeanMotion() * dt, PositionAngle.MEAN, getFrame(), getDate().shiftedBy(dt), getMu());
if (hasDerivatives()) {
// extract non-Keplerian acceleration from first time derivatives
final Vector3D nonKeplerianAcceleration = nonKeplerianAcceleration();
// add quadratic effect of non-Keplerian acceleration to Keplerian-only shift
keplerianShifted.computePVWithoutA();
final Vector3D fixedP = new Vector3D(1, keplerianShifted.partialPV.getPosition(), 0.5 * dt * dt, nonKeplerianAcceleration);
final double fixedR2 = fixedP.getNormSq();
final double fixedR = FastMath.sqrt(fixedR2);
final Vector3D fixedV = new Vector3D(1, keplerianShifted.partialPV.getVelocity(), dt, nonKeplerianAcceleration);
final Vector3D fixedA = new Vector3D(-getMu() / (fixedR2 * fixedR), keplerianShifted.partialPV.getPosition(), 1, nonKeplerianAcceleration);
// build a new orbit, taking non-Keplerian acceleration into account
return new KeplerianOrbit(new TimeStampedPVCoordinates(keplerianShifted.getDate(), fixedP, fixedV, fixedA), keplerianShifted.getFrame(), keplerianShifted.getMu());
} else {
// Keplerian-only motion is all we can do
return keplerianShifted;
}
}
use of org.orekit.utils.TimeStampedPVCoordinates in project Orekit by CS-SI.
the class CircularOrbit method initPVCoordinates.
/**
* {@inheritDoc}
*/
protected TimeStampedPVCoordinates initPVCoordinates() {
// position and velocity
computePVWithoutA();
// acceleration
final double r2 = partialPV.getPosition().getNormSq();
final Vector3D keplerianAcceleration = new Vector3D(-getMu() / (r2 * FastMath.sqrt(r2)), partialPV.getPosition());
final Vector3D acceleration = hasDerivatives() ? keplerianAcceleration.add(nonKeplerianAcceleration()) : keplerianAcceleration;
return new TimeStampedPVCoordinates(getDate(), partialPV.getPosition(), partialPV.getVelocity(), acceleration);
}
use of org.orekit.utils.TimeStampedPVCoordinates in project Orekit by CS-SI.
the class CircularOrbit method shiftedBy.
/**
* {@inheritDoc}
*/
public CircularOrbit shiftedBy(final double dt) {
// use Keplerian-only motion
final CircularOrbit keplerianShifted = new CircularOrbit(a, ex, ey, i, raan, getAlphaM() + getKeplerianMeanMotion() * dt, PositionAngle.MEAN, getFrame(), getDate().shiftedBy(dt), getMu());
if (hasDerivatives()) {
// extract non-Keplerian acceleration from first time derivatives
final Vector3D nonKeplerianAcceleration = nonKeplerianAcceleration();
// add quadratic effect of non-Keplerian acceleration to Keplerian-only shift
keplerianShifted.computePVWithoutA();
final Vector3D fixedP = new Vector3D(1, keplerianShifted.partialPV.getPosition(), 0.5 * dt * dt, nonKeplerianAcceleration);
final double fixedR2 = fixedP.getNormSq();
final double fixedR = FastMath.sqrt(fixedR2);
final Vector3D fixedV = new Vector3D(1, keplerianShifted.partialPV.getVelocity(), dt, nonKeplerianAcceleration);
final Vector3D fixedA = new Vector3D(-getMu() / (fixedR2 * fixedR), keplerianShifted.partialPV.getPosition(), 1, nonKeplerianAcceleration);
// build a new orbit, taking non-Keplerian acceleration into account
return new CircularOrbit(new TimeStampedPVCoordinates(keplerianShifted.getDate(), fixedP, fixedV, fixedA), keplerianShifted.getFrame(), keplerianShifted.getMu());
} else {
// Keplerian-only motion is all we can do
return keplerianShifted;
}
}
Aggregations