Package org.orekit.forces.gravity
Class J2OnlyPerturbation
java.lang.Object
org.orekit.forces.gravity.J2OnlyPerturbation
- All Implemented Interfaces:
ForceModel,EventDetectorsProvider,ParameterDriversProvider
J2-only force model.
This class models the oblateness part alone of the central body's potential (degree 2 and order 0),
whilst avoiding the computational overhead of generic NxM spherical harmonics.
This J2 coefficient has same magnitude and opposite sign than the so-called unnormalized C20 coefficient.
This class should not be used in combination of HolmesFeatherstoneAttractionModel,
otherwise the J2 term would be taken into account twice.
- Author:
- Romain Serra
-
Field Summary
Fields inherited from interface org.orekit.propagation.events.EventDetectorsProvider
DATATION_ACCURACY -
Constructor Summary
ConstructorsConstructorDescriptionJ2OnlyPerturbation(double mu, double rEq, double constantJ2, Frame frame) Constructor with constant J2.J2OnlyPerturbation(double mu, double rEq, TimeScalarFunction j2OverTime, Frame frame) Constructor withTimeScalarFunction.J2OnlyPerturbation(UnnormalizedSphericalHarmonicsProvider harmonicsProvider, Frame frame) Constructor with spherical harmonics provider. -
Method Summary
Modifier and TypeMethodDescription<T extends CalculusFieldElement<T>>
FieldVector3D<T> acceleration(FieldSpacecraftState<T> state, T[] parameters) Compute acceleration.acceleration(SpacecraftState state, double[] parameters) Compute acceleration.static <T extends CalculusFieldElement<T>>
FieldVector3D<T> computeAccelerationInJ2Frame(FieldVector3D<T> positionInJ2Frame, double mu, double rEq, T j2) Compute acceleration in J2 frame.static Vector3DcomputeAccelerationInJ2Frame(Vector3D positionInJ2Frame, double mu, double rEq, double j2) Compute acceleration in J2 frame.booleanCheck if force model depends on position only at a given, fixed date.getFrame()Getter for frame.doublegetJ2(AbsoluteDate date) Return J2 at requested date.<T extends CalculusFieldElement<T>>
TgetJ2(FieldAbsoluteDate<T> date) Return J2 at requested date (Field version).doublegetMu()Getter for mu.Get the drivers for parameters.doublegetrEq()Getter for equatorial radius.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.orekit.propagation.events.EventDetectorsProvider
getDateDetector, getEventDetectors, getFieldDateDetector, getFieldEventDetectorsMethods inherited from interface org.orekit.forces.ForceModel
addContribution, addContribution, dependsOnAttitudeRate, getEventDetectors, getFieldEventDetectors, getMassDerivative, getMassDerivative, init, initMethods inherited from interface org.orekit.utils.ParameterDriversProvider
getNbParametersDriversValue, getParameterDriver, getParameters, getParameters, getParameters, getParameters, getParametersAllValues, getParametersAllValues, isSupported
-
Constructor Details
-
J2OnlyPerturbation
Constructor withTimeScalarFunction. It is the user's responsibility to make sure the Field and double versions are consistent with each other.- Parameters:
mu- central body's gravitational constantrEq- central body's equatorial radiusj2OverTime- J2 coefficient as a function of time.frame- frame where J2 applies
-
J2OnlyPerturbation
Constructor with constant J2.- Parameters:
mu- central body gravitational constantrEq- central body's equatorial radiusconstantJ2- constant J2 coefficientframe- frame where J2 applies
-
J2OnlyPerturbation
Constructor with spherical harmonics provider.- Parameters:
harmonicsProvider- spherical harmonics provider of unnormalized coefficientsframe- frame where J2 applies
-
-
Method Details
-
getMu
public double getMu()Getter for mu.- Returns:
- mu
-
getrEq
public double getrEq()Getter for equatorial radius.- Returns:
- equatorial radius
-
getFrame
Getter for frame.- Returns:
- frame
-
getJ2
Return J2 at requested date.- Parameters:
date- epoch at which J2 coefficient should be retrieved- Returns:
- J2 coefficient
-
getJ2
Return J2 at requested date (Field version).- Type Parameters:
T- field- Parameters:
date- epoch at which J2 coefficient should be retrieved- Returns:
- J2 coefficient
-
dependsOnPositionOnly
public boolean dependsOnPositionOnly()Check if force model depends on position only at a given, fixed date.- Specified by:
dependsOnPositionOnlyin interfaceForceModel- Returns:
- true if force model depends on position only, false if it depends on mass or velocity, either directly or due to a dependency on attitude
-
acceleration
Compute acceleration.- Specified by:
accelerationin interfaceForceModel- Parameters:
state- current state information: date, kinematics, attitudeparameters- values of the force model parameters at state date, only 1 value for each parameterDriver- Returns:
- acceleration in same frame as state
-
computeAccelerationInJ2Frame
public static Vector3D computeAccelerationInJ2Frame(Vector3D positionInJ2Frame, double mu, double rEq, double j2) Compute acceleration in J2 frame.- Parameters:
positionInJ2Frame- position in J2 frame@mu- gravitational parameterrEq- equatorial radiusj2- J2 coefficient- Returns:
- acceleration in J2 frame
-
acceleration
public <T extends CalculusFieldElement<T>> FieldVector3D<T> acceleration(FieldSpacecraftState<T> state, T[] parameters) Compute acceleration.- Specified by:
accelerationin interfaceForceModel- Type Parameters:
T- type of the elements- Parameters:
state- current state information: date, kinematics, attitudeparameters- values of the force model parameters at state date, only 1 value for each parameterDriver- Returns:
- acceleration in same frame as state
-
computeAccelerationInJ2Frame
public static <T extends CalculusFieldElement<T>> FieldVector3D<T> computeAccelerationInJ2Frame(FieldVector3D<T> positionInJ2Frame, double mu, double rEq, T j2) Compute acceleration in J2 frame. Field version.- Type Parameters:
T- field type- Parameters:
positionInJ2Frame- position in J2 frame@mu- gravitational parameterrEq- equatorial radiusj2- J2 coefficient- Returns:
- acceleration in J2 frame
-
getParametersDrivers
Get the drivers for parameters.- Specified by:
getParametersDriversin interfaceParameterDriversProvider- Returns:
- drivers for parameters
-