Class BatchLSEstimator


  • public class BatchLSEstimator
    extends Object
    Least squares estimator for orbit determination.
    Since:
    8.0
    Author:
    Luc Maisonobe
    • Constructor Detail

      • BatchLSEstimator

        public BatchLSEstimator​(org.hipparchus.optim.nonlinear.vector.leastsquares.LeastSquaresOptimizer optimizer,
                                NumericalPropagatorBuilder... propagatorBuilder)
        Simple constructor.

        If multiple propagator builders are set up, the orbits of several spacecrafts will be used simultaneously. This is useful if the propagators share some model or measurements parameters (typically pole motion, prime meridian correction or ground stations positions).

        Setting up multiple propagator builders is also useful when inter-satellite measurements are used, even if only one of the orbit is estimated and the other ones are fixed. This is typically used when very high accuracy GNSS measurements are needed and the navigation bulletins are not considered accurate enough and the navigation constellation must be propagated numerically.

        Parameters:
        optimizer - solver for least squares problem
        propagatorBuilder - builders to use for propagation
    • Method Detail

      • setObserver

        public void setObserver​(BatchLSObserver observer)
        Set an observer for iterations.
        Parameters:
        observer - observer to be notified at the end of each iteration
      • addMeasurement

        public void addMeasurement​(ObservedMeasurement<?> measurement)
        Add a measurement.
        Parameters:
        measurement - measurement to add
      • setMaxIterations

        public void setMaxIterations​(int maxIterations)
        Set the maximum number of iterations.

        The iterations correspond to the top level iterations of the least squares optimizer.

        Parameters:
        maxIterations - maxIterations maximum number of iterations
        See Also:
        setMaxEvaluations(int), getIterationsCount()
      • setMaxEvaluations

        public void setMaxEvaluations​(int maxEvaluations)
        Set the maximum number of model evaluations.

        The evaluations correspond to the orbit propagations and measurements estimations performed with a set of estimated parameters.

        For Gauss-Newton optimizer there is one evaluation at each iteration, so the maximum numbers may be set to the same value. For Levenberg-Marquardt optimizer, there can be several evaluations at some iterations (typically for the first couple of iterations), so the maximum number of evaluations may be set to a higher value than the maximum number of iterations.

        Parameters:
        maxEvaluations - maximum number of model evaluations
        See Also:
        setMaxIterations(int), getEvaluationsCount()
      • getOrbitalParametersDrivers

        public ParameterDriversList getOrbitalParametersDrivers​(boolean estimatedOnly)
        Get the orbital parameters supported by this estimator.

        If there are more than one propagator builder, then the names of the drivers have an index marker in square brackets appended to them in order to distinguish the various orbits. So for example with one builder generating Keplerian orbits the names would be simply "a", "e", "i"... but if there are several builders the names would be "a[0]", "e[0]", "i[0]"..."a[1]", "e[1]", "i[1]"...

        Parameters:
        estimatedOnly - if true, only estimated parameters are returned
        Returns:
        orbital parameters supported by this estimator
      • getPropagatorParametersDrivers

        public ParameterDriversList getPropagatorParametersDrivers​(boolean estimatedOnly)
        Get the propagator parameters supported by this estimator.
        Parameters:
        estimatedOnly - if true, only estimated parameters are returned
        Returns:
        propagator parameters supported by this estimator
      • getMeasurementsParametersDrivers

        public ParameterDriversList getMeasurementsParametersDrivers​(boolean estimatedOnly)
        Get the measurements parameters supported by this estimator (including measurements and modifiers).
        Parameters:
        estimatedOnly - if true, only estimated parameters are returned
        Returns:
        measurements parameters supported by this estimator
      • setParametersConvergenceThreshold

        public void setParametersConvergenceThreshold​(double parametersConvergenceThreshold)
        Set convergence threshold.

        The convergence used for estimation is based on the estimated parameters normalized values. Convergence is considered to have been reached when the difference between previous and current normalized value is less than the convergence threshold for all parameters. The same value is used for all parameters since they are normalized and hence dimensionless.

        Normalized values are computed as (current - reference)/scale, so convergence is reached when the following condition holds for all estimated parameters: |current[i] - previous[i]| <= threshold * scale[i]

        So the convergence threshold specified here can be considered as a multiplication factor applied to scale. Since for all parameters the scale is often small (typically about 1 m for orbital positions for example), then the threshold should not be too small. A value of 10⁻³ is often quite accurate.

        Parameters:
        parametersConvergenceThreshold - convergence threshold on normalized parameters (dimensionless, related to parameters scales)
        See Also:
        EvaluationRmsChecker
      • getOptimum

        public org.hipparchus.optim.nonlinear.vector.leastsquares.LeastSquaresOptimizer.Optimum getOptimum()
        Get the optimum found.

        The LeastSquaresOptimizer.Optimum object contains detailed elements (covariance matrix, estimated parameters standard deviation, weighted Jacobian, RMS, χ², residuals and more).

        Beware that the returned object is the raw view from the underlying mathematical library. At this ral level, parameters have normalized values whereas the space flight parameters have physical values with their units. So there are scaling factors to apply when using these elements.

        Returns:
        optimum found after last call to estimate()
      • getPhysicalCovariances

        public org.hipparchus.linear.RealMatrix getPhysicalCovariances​(double threshold)
        Get the covariances matrix in space flight dynamics physical units.

        This method retrieve the covariances from the [@link optimum and applies the scaling factors to it in order to convert it from raw normalized values back to physical values.

        Parameters:
        threshold - threshold to identify matrix singularity
        Returns:
        covariances matrix in space flight dynamics physical units
        Since:
        9.1
      • getIterationsCount

        public int getIterationsCount()
        Get the number of iterations used for last estimation.
        Returns:
        number of iterations used for last estimation
        See Also:
        setMaxIterations(int)
      • getEvaluationsCount

        public int getEvaluationsCount()
        Get the number of evaluations used for last estimation.
        Returns:
        number of evaluations used for last estimation
        See Also:
        setMaxEvaluations(int)