A library of functions for blazingly fast astrodynamic calculations.
Until the rains fall on Olympus Mons.
Note: Under active development, updating structure frequently.
cargo install donnager
or, alternatively, in your project's cargo.toml
file:
[dependencies]
donnager = "0.1.2"
cosmos
dynamics
propulsion
```Rust use donnager::constants as cst; use donnager::cosmos as cosm; use donnager::propulsion as prop; use donnager::dynamics as dynam;
use nalgebra as na; use na::Vector3;
// Config let earth: cosm::gravity::Body = cosm::gravity::Body { name: "Earth".tostring(), gravparam: cst::EARTHGRAVPARAM, eqradius: cst::EARTHRADIUSEQUATOR, rotationrate: cst::EARTHROTRATE, eccentricity: cst::EARTH_ECC };
let launchsite: cosm::space::SurfacePoint = cosm::space::SurfacePoint { name: "Cape Canaveral Launch Site".tostring(), body: earth.clone(), pos_lla: Vector3::new(28.396837, -80.605659, 0.0) };
let payloadeng: prop::engine::Engine = prop::engine::Engine{ name: "PayloadEngine".tostring(), enginetype: prop::engine::EngineType::Electric, isp: 500.0 };
let payload: dynam::vehicle::Vehicle = dynam::vehicle::Vehicle { name: "Satellite1".tostring(), mass: 5.0, engine: payload_eng };
let stage1eng: prop::engine::Engine = prop::engine::Engine{ name: "Hydrolox Dual Flow".tostring(), engine_type: prop::engine::EngineType::Chemical, isp: 300.0 };
let stage1: dynam::vehicle::Vehicle = dynam::vehicle::Vehicle { name: "Stage1".tostring(), mass: 250.0, engine: stage1eng };
let launchvehicle: dynam::vehicle::Multistage = dynam::vehicle::Multistage{ name: "Launcher7".tostring(), stages: [stage1, payload].to_vec() };
// Inputs let altitude: f64 = 408000.0; // LEO
// Calculation
let deltav: f64 = launchsite.calcdeltav(altitude);
let massfuel: Vec
// Results println!("\n{:.4} kg of fuel to get {} kg to {} m alt", massfuel[0], launchvehicle.stages[1].mass, altitude);
```
Ad astra, plus ultra