← All examples
35

Canonical Grid model

Aerospace starter - Orbital transfer and propellant

Outward coplanar Hohmann transfer with an explicit km/s to m/s rocket-equation boundary.

Scale
Small
Source
aerospace-orbital-transfer.grid
Length
48 lines
Collection
Advanced language
Level
Intermediate
Runtime
Portable
Version
1.0.0
aerospace-orbital-transfer.grid
Get Grid
MODEL "Aerospace starter - Orbital transfer and propellant"
DESCRIPTION "Outward coplanar Hohmann transfer with an explicit km/s to m/s rocket-equation boundary."
VERSION "1.0.0"
TAGS "aerospace", "starter", "orbits"

strict

# Circular two-body orbits; bounds describe this teaching case.
input Altitude_km = 400
  VALIDATE BETWEEN 160 AND 35000 MESSAGE "Use 160 to 35000 km; this starter transfers outward to radius 42164 km."
input SpecificImpulse_s = 320
  VALIDATE BETWEEN 100 AND 1000 MESSAGE "Use 100 to 1000 seconds for this idealized chemical propulsion example."
input DryMass_kg = 1000
  VALIDATE BETWEEN 1 AND 1000000 MESSAGE "Use a positive dry mass from 1 to 1,000,000 kg."
EarthRadius_km = 6378.137
Mu_km3_s2 = 398600.4418
TargetRadius_km = 42164
Gravity_m_s2 = 9.80665

# Working numerical units: kilometers and seconds until the explicit boundary.
InitialRadius_km = EarthRadius_km + Altitude_km
TransferAxis_km = (InitialRadius_km + TargetRadius_km) / 2
CircularSpeed_km_s = SQRT(Mu_km3_s2 / InitialRadius_km)
DepartureBurn_km_s = CircularSpeed_km_s * (SQRT(2 * TargetRadius_km / (InitialRadius_km + TargetRadius_km)) - 1)
ArrivalBurn_km_s = SQRT(Mu_km3_s2 / TargetRadius_km) * (1 - SQRT(2 * InitialRadius_km / (InitialRadius_km + TargetRadius_km)))

## Total delta-v: sum of two ideal impulsive burns, in km/s.
output TotalDeltaV_km_s = DepartureBurn_km_s + ArrivalBurn_km_s
output TransferTime_h = PI() * SQRT(TransferAxis_km^3 / Mu_km3_s2) / 3600
DeltaV_m_s = CONVERT(TotalDeltaV_km_s, "km/s", "m/s")
# The rocket equation uses m/s in both numerator and effective exhaust velocity.
EffectiveExhaust_m_s = SpecificImpulse_s * Gravity_m_s2
output WetDryMassRatio = EXP(DeltaV_m_s / EffectiveExhaust_m_s)
## Ideal propellant only; no residuals, reserves, gravity loss, or engine mass model.
output Propellant_kg = DryMass_kg * (WetDryMassRatio - 1)
output Assumptions = "Coplanar, circular endpoint orbits; two-body Earth gravity; instantaneous burns; fixed Isp; no plane change, finite-burn loss, perturbations, reserves, or staging. Units in names are working conventions, not a proof for arbitrary external values."
output ScenarioGuide = "Save Baseline in I/O at 400 km. Set Altitude_km to 800: TotalDeltaV_km_s changes 3.853957053 to 3.706172704. Save Higher orbit, restore Baseline, then export .gridoc and reopen to retain source and scenarios."

A1 = "Total delta-v (km/s)"
B1 = TotalDeltaV_km_s
A2 = "Transfer duration (h)"
B2 = TransferTime_h
A3 = "Wet/dry mass ratio"
B3 = WetDryMassRatio
A4 = "Propellant (kg)"
B4 = Propellant_kg

END MODEL