Skip to main content

Crate koenig_damico_planner

Crate koenig_damico_planner 

Source
Expand description

§koenig-damico-planner

Faithful Rust re-implementation of Koenig & D’Amico’s fuel-optimal impulsive control algorithm (IEEE TAC 2020; see the References below).

§Quick start

use koenig_damico_planner::{solve, Pseudostate, SolveParams, TimeGrid};
use koenig_damico_planner::dynamics::{AbsoluteOrbit, J2Roe};
use koenig_damico_planner::cost::Piecewise;
use std::f64::consts::TAU;

let a_c = 25_000e3; // chief semimajor axis [m], the I/O scale factor
let chief = AbsoluteOrbit::new(
    a_c, 0.7, 40f64.to_radians(), 358f64.to_radians(), 0.0, 180f64.to_radians(),
);
let dynamics = J2Roe::new(chief, 0.0, 117_990.0)?;     // validates the chief
let grid = TimeGrid::uniform(0.0, 117_990.0, 30.0)?;   // validates dt > 0, t_f > t_i
let cost = Piecewise::new(TAU / chief.mean_motion())?; // validates period > 0
let w = Pseudostate::from_row_slice(&[50.0, 5000.0, 100.0, 100.0, 0.0, 400.0]) / a_c;

let solution = solve(&dynamics, &cost, w, grid, &SolveParams::default())?;
println!("{} maneuvers, total dv = {:.4} mm/s",
    solution.maneuvers.len(), solution.total_dv * 1e3);

The concrete built-ins a caller instantiates live in the submodules: dynamics::{AbsoluteOrbit, J2Roe} (the only Dynamics implementor) and cost::{Piecewise, Norm2, FaceMax} (the CostModel / SublevelSet implementors). A runnable version of the above is examples/mdot.rs (cargo run --example mdot).

§Features

§References

Functions throughout the crate carry a Ref: comment citing the equation, table, algorithm, or figure they implement, using these short keys:

  • [KD20] A. W. Koenig and S. D’Amico, “Fast Algorithm for Fuel-Optimal Impulsive Control of Linear Systems with Time-Varying Cost,” IEEE Transactions on Automatic Control, 2020. DOI: 10.1109/TAC.2020.3027804 (arXiv:1804.06099).
  • [KGD17] A. W. Koenig, T. Guffanti, and S. D’Amico, “New State Transition Matrices for Spacecraft Relative Motion in Perturbed Orbits,” Journal of Guidance, Control, and Dynamics, 2017. DOI: 10.2514/1.G002409.
  • [CD18] M. Chernick and S. D’Amico, “Closed-Form Optimal Impulsive Control of Spacecraft Formations Using Reachable Set Theory,” AAS 18-308, 2018.
  • [H25] M. Hunter and S. D’Amico, “Fast Fuel-Optimal Constrained Impulsive Control with Application to Distributed Spacecraft,” Proc. IEEE Aerospace Conference, 2025.

Re-exports§

pub use algorithm::primer_history;
pub use algorithm::solve;
pub use algorithm::solve_from_initial_times;
pub use algorithm::PrimerHistory;
pub use dynamics::Dynamics;
pub use types::ErrorClass;
pub use types::InvalidInputKind;
pub use types::Maneuver;
pub use types::PlannerError;
pub use types::Solution;
pub use types::SolveParams;
pub use types::TimeGrid;
pub use cost::CostModel;
pub use cost::SublevelSet;
pub use types::Pseudostate;
pub use types::M;
pub use types::N;
pub use nalgebra;

Modules§

algorithm
Orchestration of the three-step algorithm (Init -> Refine -> Extract).
cost
Cost abstractions: the unit sublevel set of the cost at a time, and the time-varying selection of sublevel sets (eq. 49).
dynamics
Dynamics abstraction. The algorithm only ever needs Gamma(t) = Phi(t,t_f) B(t).
solver
Convex-solver wrappers around clarabel: the refinement SOCP (eq. 40, refine_socp), the direct min-fuel SOCP that the live extraction path runs (Algorithm 3, min_fuel_socp), and the legacy fixed-direction extraction QP (extract_qp), plus shared settings/status helpers.
types
Core value types: dimensions, pseudostate/maneuver, the uniform time grid, solver parameters, the solver result, the conic-row placeholder, and errors.