vibe coding an orbital mechanics simulation to try out claude code
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

1.6 KiB

Test Verification Guide

Quick reference for testing orbital mechanics using configs/test_simple.txt.

Test Command

make
./orbit_sim configs/test_simple.txt --headless --readable --days 365

Test Bodies

  • Sun: Origin (0, 0, 0)
  • Earth: 1.0 AU, circular orbit (e=0), period ~365 days
  • Mars: 1.5 AU, circular orbit (e=0), period ~687 days
  • Comet: 2.5 AU semi-major axis, eccentric orbit (e=0.7), period ~1444 days
    • Starts at perihelion (0.75 AU)
    • Aphelion at 4.25 AU

All orbit counter-clockwise (viewed from +Z).

Expected Behavior

Circular orbits (Earth, Mars):

  • Distance from Sun remains constant
  • Velocity magnitude remains constant
    • Earth: ~29.8 km/s
    • Mars: ~24.3 km/s
  • Return to starting position after full period

Eccentric orbit (Comet):

  • Distance varies: 0.75 AU (perihelion) to 4.25 AU (aphelion)
  • Velocity varies: faster at perihelion, slower at aphelion
  • Period ~1444 days

Quick Tests

# Earth full orbit
./orbit_sim configs/test_simple.txt --headless --readable --days 365

# Mars full orbit
./orbit_sim configs/test_simple.txt --headless --readable --days 687

# Comet full orbit (eccentric)
./orbit_sim configs/test_simple.txt --headless --readable --days 1444

Acceptable Tolerances

Due to Euler integration with dt=60s:

  • Distance variation: ±0.001 AU
  • Velocity variation: ±0.1 km/s
  • Position after full orbit: Within 0.01 AU of start

Output Flags

  • --headless: Terminal output only (no GUI)
  • --readable: Human-friendly units (AU, km/s) instead of SI (m, m/s)
  • --days N: Simulation duration in days