Class LambertDifferentialCorrector
- java.lang.Object
-
- org.orekit.control.heuristics.lambert.LambertDifferentialCorrector
-
public class LambertDifferentialCorrector extends Object
Class implementing a differential correction for extended (meaning under arbitrary dynamics) Lambert arc (fixed initial and terminal position vectors with fixed time). Given boundary conditions and a guess, applies Newton-Raphson algorithm to find the solution (initial and terminal velocity vectors) according to the propagator used. The latter must be compatible with resetting the initial state and computing state transition matrices. Note that propagation is not required to be forward in time.- Since:
- 13.1
- Author:
- Romain Serra
- See Also:
AbstractPropagator,LambertBoundaryConditions
-
-
Field Summary
Fields Modifier and Type Field Description static intDEFAULT_MAX_ITERDefault maximum number of iterations.static doubleDEFAULT_POSITION_TOLERANCEDefault value for convergence (on the position vector).
-
Constructor Summary
Constructors Constructor Description LambertDifferentialCorrector(LambertBoundaryConditions lambertBoundaryConditions)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected SpacecraftStatebuildInitialState(AbstractPropagator propagator, SpacecraftState templateState, Vector3D initialVelocity)Method creating an initial state.protected Vector3DcomputeNewtonCorrection(Vector3D positionDifference, RealMatrix cartesianStm)Method computing the Newton-Raphson correction.protected RealMatrixgetCartesianStm(SpacecraftState initialState, SpacecraftState terminalState)Computes the state transition matrix in Cartesian coordinates.intgetCurrentIter()Getter for the current iteration number.protected DecompositionSolvergetDecompositionSolver(RealMatrix matrix)Creates a linear system solver.doublegetInitialMass()Getter for the initial mass.LambertBoundaryConditionsgetLambertBoundaryConditions()Getter for the boundary conditions.protected MatricesHarvestergetMatricesHarvester()Protected getter for the state transition matrices harvester.intgetMaxIter()Getter for the maximum number of iterations.doublegetPositionTolerance()Getter for the position tolerance.StringgetStmName()Getter for the state transition matrix name.doublegetThresholdMatrixSolver()Getter for the threshold used in linear system solving.protected booleanhasConverged(Vector3D positionDifference)Checks convergence.protected voidinit(AbstractPropagator propagator, Vector3D guessInitialVelocity)Initialize propagator.protected LambertBoundaryVelocitiesiterate(AbstractPropagator propagator)Apply differential corrections until convergence (interrupted by maximum iterations count).protected voidsetCurrentIter(int currentIter)Protected setter for the current iteration number.voidsetInitialMass(double initialMass)Setter for the initial mass.voidsetMaxIter(int maxIter)Setter for the maximum number of iterations.voidsetPositionTolerance(double positionTolerance)Setter for the position tolerance.voidsetStmName(String stmName)Setter for the state transition matrix name.voidsetThresholdMatrixSolver(double thresholdMatrixSolver)Setter for the threshold used in linear system solving.LambertBoundaryVelocitiessolve(AbstractPropagator propagator, Vector3D guessInitialVelocity)Method applying differential correction on the guess (Newton-Raphson algorithm).
-
-
-
Field Detail
-
DEFAULT_POSITION_TOLERANCE
public static final double DEFAULT_POSITION_TOLERANCE
Default value for convergence (on the position vector).- See Also:
- Constant Field Values
-
DEFAULT_MAX_ITER
public static final int DEFAULT_MAX_ITER
Default maximum number of iterations.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
LambertDifferentialCorrector
public LambertDifferentialCorrector(LambertBoundaryConditions lambertBoundaryConditions)
Constructor.- Parameters:
lambertBoundaryConditions- boundary conditions
-
-
Method Detail
-
getLambertBoundaryConditions
public LambertBoundaryConditions getLambertBoundaryConditions()
Getter for the boundary conditions.- Returns:
- conditions
-
setInitialMass
public void setInitialMass(double initialMass)
Setter for the initial mass.- Parameters:
initialMass- initial mass
-
getInitialMass
public double getInitialMass()
Getter for the initial mass.- Returns:
- initial mass
-
getPositionTolerance
public double getPositionTolerance()
Getter for the position tolerance.- Returns:
- tolerance
-
setPositionTolerance
public void setPositionTolerance(double positionTolerance)
Setter for the position tolerance.- Parameters:
positionTolerance- tolerance
-
setThresholdMatrixSolver
public void setThresholdMatrixSolver(double thresholdMatrixSolver)
Setter for the threshold used in linear system solving.- Parameters:
thresholdMatrixSolver- threshold
-
getThresholdMatrixSolver
public double getThresholdMatrixSolver()
Getter for the threshold used in linear system solving.- Returns:
- threshold
-
setStmName
public void setStmName(String stmName)
Setter for the state transition matrix name.- Parameters:
stmName- name
-
getStmName
public String getStmName()
Getter for the state transition matrix name.- Returns:
- name
-
getMaxIter
public int getMaxIter()
Getter for the maximum number of iterations.- Returns:
- maximum iterations
-
setMaxIter
public void setMaxIter(int maxIter)
Setter for the maximum number of iterations.- Parameters:
maxIter- maximum iterations
-
setCurrentIter
protected void setCurrentIter(int currentIter)
Protected setter for the current iteration number.- Parameters:
currentIter- iteration number
-
getCurrentIter
public int getCurrentIter()
Getter for the current iteration number.- Returns:
- iteration number
-
getMatricesHarvester
protected MatricesHarvester getMatricesHarvester()
Protected getter for the state transition matrices harvester.- Returns:
- harvester
-
getDecompositionSolver
protected DecompositionSolver getDecompositionSolver(RealMatrix matrix)
Creates a linear system solver.- Parameters:
matrix- matrix involved in system- Returns:
- solver
-
solve
public LambertBoundaryVelocities solve(AbstractPropagator propagator, Vector3D guessInitialVelocity)
Method applying differential correction on the guess (Newton-Raphson algorithm).- Parameters:
propagator- propagator to be used for differential correctionsguessInitialVelocity- guess on the initial velocity vector- Returns:
- boundary velocities (null if not converged)
-
init
protected void init(AbstractPropagator propagator, Vector3D guessInitialVelocity)
Initialize propagator.- Parameters:
propagator- propagator to be used for differential correctionsguessInitialVelocity- guess on the initial velocity vector
-
iterate
protected LambertBoundaryVelocities iterate(AbstractPropagator propagator)
Apply differential corrections until convergence (interrupted by maximum iterations count).- Parameters:
propagator- propagator- Returns:
- boundary velocities (null if not converged)
-
buildInitialState
protected SpacecraftState buildInitialState(AbstractPropagator propagator, SpacecraftState templateState, Vector3D initialVelocity)
Method creating an initial state.- Parameters:
propagator- propagatortemplateState- template stateinitialVelocity- initial velocity to use- Returns:
- full propagation state for initialization
-
computeNewtonCorrection
protected Vector3D computeNewtonCorrection(Vector3D positionDifference, RealMatrix cartesianStm)
Method computing the Newton-Raphson correction.- Parameters:
positionDifference- position residualscartesianStm- Cartesian state transition matrix- Returns:
- correction
-
getCartesianStm
protected RealMatrix getCartesianStm(SpacecraftState initialState, SpacecraftState terminalState)
Computes the state transition matrix in Cartesian coordinates.- Parameters:
initialState- initial stateterminalState- terminal state- Returns:
- Cartesian STM
-
hasConverged
protected boolean hasConverged(Vector3D positionDifference)
Checks convergence.- Parameters:
positionDifference- position residuals- Returns:
- convergence flag
-
-