Package org.orekit.forces.gravity
Class J2OnlyPerturbation
- java.lang.Object
-
- org.orekit.forces.gravity.J2OnlyPerturbation
-
- All Implemented Interfaces:
ForceModel
,EventDetectorsProvider
,ParameterDriversProvider
public class J2OnlyPerturbation extends Object implements ForceModel
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
Constructors Constructor Description J2OnlyPerturbation(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
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description <T extends CalculusFieldElement<T>>
FieldVector3D<T>acceleration(FieldSpacecraftState<T> state, T[] parameters)
Compute acceleration.Vector3D
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 Vector3D
computeAccelerationInJ2Frame(Vector3D positionInJ2Frame, double mu, double rEq, double j2)
Compute acceleration in J2 frame.boolean
dependsOnPositionOnly()
Check if force model depends on position only at a given, fixed date.Frame
getFrame()
Getter for frame.double
getJ2(AbsoluteDate date)
Return J2 at requested date.<T extends CalculusFieldElement<T>>
TgetJ2(FieldAbsoluteDate<T> date)
Return J2 at requested date (Field version).double
getMu()
Getter for mu.List<ParameterDriver>
getParametersDrivers()
Get the drivers for parameters.double
getrEq()
Getter for equatorial radius.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.orekit.propagation.events.EventDetectorsProvider
getEventDetectors, getFieldEventDetectors
-
Methods inherited from interface org.orekit.forces.ForceModel
addContribution, addContribution, dependsOnAttitudeRate, getEventDetectors, getFieldEventDetectors, init, init
-
Methods inherited from interface org.orekit.utils.ParameterDriversProvider
getNbParametersDriversValue, getParameterDriver, getParameters, getParameters, getParameters, getParameters, getParametersAllValues, getParametersAllValues, isSupported
-
-
-
-
Constructor Detail
-
J2OnlyPerturbation
public J2OnlyPerturbation(double mu, double rEq, TimeScalarFunction j2OverTime, Frame frame)
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
public J2OnlyPerturbation(double mu, double rEq, double constantJ2, Frame frame)
Constructor with constant J2.- Parameters:
mu
- central body gravitational constantrEq
- central body's equatorial radiusconstantJ2
- constant J2 coefficientframe
- frame where J2 applies
-
J2OnlyPerturbation
public J2OnlyPerturbation(UnnormalizedSphericalHarmonicsProvider harmonicsProvider, Frame frame)
Constructor with spherical harmonics provider.- Parameters:
harmonicsProvider
- spherical harmonics provider of unnormalized coefficientsframe
- frame where J2 applies
-
-
Method Detail
-
getMu
public double getMu()
Getter for mu.- Returns:
- mu
-
getrEq
public double getrEq()
Getter for equatorial radius.- Returns:
- equatorial radius
-
getFrame
public Frame getFrame()
Getter for frame.- Returns:
- frame
-
getJ2
public double getJ2(AbsoluteDate date)
Return J2 at requested date.- Parameters:
date
- epoch at which J2 coefficient should be retrieved- Returns:
- J2 coefficient
-
getJ2
public <T extends CalculusFieldElement<T>> T getJ2(FieldAbsoluteDate<T> date)
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:
dependsOnPositionOnly
in interfaceForceModel
- Returns:
- true if force model depends on position only, false if it depends on velocity, either directly or due to a dependency on attitude
-
acceleration
public Vector3D acceleration(SpacecraftState state, double[] parameters)
Compute acceleration.- Specified by:
acceleration
in 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:
acceleration
in 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
public List<ParameterDriver> getParametersDrivers()
Get the drivers for parameters.- Specified by:
getParametersDrivers
in interfaceParameterDriversProvider
- Returns:
- drivers for parameters
-
-