Class LambertSolver


  • public class LambertSolver
    extends Object
    Lambert solver, assuming Keplerian motion.

    An orbit is determined from two position vectors.

    References: Battin, R.H., An Introduction to the Mathematics and Methods of Astrodynamics, AIAA Education, 1999. Lancaster, E.R. and Blanchard, R.C., A Unified Form of Lambert’s Theorem, Goddard Space Flight Center, 1968.

    Since:
    13.1
    Author:
    Joris Olympio, Romain Serra
    See Also:
    LambertBoundaryConditions, LambertBoundaryVelocities
    • Constructor Detail

      • LambertSolver

        public LambertSolver​(double mu)
        Creator.
        Parameters:
        mu - gravitational constant
    • Method Detail

      • solve

        public LambertBoundaryVelocities solve​(boolean posigrade,
                                               int nRev,
                                               LambertBoundaryConditions boundaryConditions)
        Solve for the corresponding velocity vectors given two position vectors and a duration.

        The logic for setting posigrade and nRev is that the sweep angle Δυ travelled by the object between t1 and t2 is 2π nRev +1 - α if posigrade is false and 2π nRev + α if posigrade is true, where α is the separation angle between p1 and p2, which is always computed between 0 and π (because in 3D without a normal reference, vector angles cannot go past π).

        This implies that posigrade should be set to true if p2 is located in the half orbit starting at p1 and it should be set to false if p2 is located in the half orbit ending at p1, regardless of the number of periods between t1 and t2, and nRev should be set accordingly.

        As an example, if t2 is less than half a period after t1, then posigrade should be true and nRev should be 0. If t2 is more than half a period after t1 but less than one period after t1, posigrade should be false and nRev should be 0.

        If solving fails completely, null is returned. If only the computation of terminal velocity fails, a partial pair of velocities is returned (with some NaNs).

        Parameters:
        posigrade - flag indicating the direction of motion
        nRev - number of revolutions
        boundaryConditions - Lambert problem boundary conditions
        Returns:
        boundary velocity vectors
      • solveNormalized2D

        public static Vector2D solveNormalized2D​(double r1,
                                                 double r2,
                                                 double dth,
                                                 double tau,
                                                 int mRev)
        Lambert's solver for the historical, planar problem. Assume mu=1.
        Parameters:
        r1 - radius 1
        r2 - radius 2
        dth - sweep angle
        tau - time of flight
        mRev - number of revs
        Returns:
        velocity at departure in (T, N) basis. Is Vector2D.NaN if solving fails
      • computeJacobian

        public RealMatrix computeJacobian​(boolean posigrade,
                                          int nRev,
                                          LambertBoundaryConditions boundaryConditions)
        Computes the Jacobian matrix of the Lambert solution. The rows represent the initial and terminal velocity vectors. The columns represent the parameters: initial time, initial position, terminal time, terminal velocity.

        Reference: Di Lizia, P., Armellin, R., Zazzera, F. B., and Berz, M. High Order Expansion of the Solution of Two-Point Boundary Value Problems using Differential Algebra: Applications to Spacecraft Dynamics.

        Parameters:
        posigrade - direction flag
        nRev - number of revolutions
        boundaryConditions - Lambert boundary conditions
        Returns:
        Jacobian matrix