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 Instance Methods Concrete Methods Modifier and Type Method Description <T extends CalculusFieldElement<T>>
FieldVector3D<T>acceleration(FieldSpacecraftState<T> state, T[] parameters)Compute acceleration.Vector3Dacceleration(SpacecraftState state, double[] parameters)Compute acceleration.booleandependsOnPositionOnly()Check if force model depends on position only at a given, fixed date.FramegetFrame()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.List<ParameterDriver>getParametersDrivers()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, 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:
dependsOnPositionOnlyin 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:
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
-
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
-
getParametersDrivers
public List<ParameterDriver> getParametersDrivers()
Get the drivers for parameters.- Specified by:
getParametersDriversin interfaceParameterDriversProvider- Returns:
- drivers for parameters
-
-