Browse Source
Reduced redundancy across documentation files:
- Condensed implementation_plan.md (236→112 lines)
- Condensed test_verification.md (143→62 lines), updated for 4-body test
- Condensed config_assumptions.md (115→44 lines), focused on active issues
- Removed architecture duplication from CLAUDE.md
- Removed common commands from verbose_project_overview.md
- Added 'make test' target to Makefile
Each file now has a clear, distinct purpose with minimal overlap.
🤖 Generated with Claude Code
main
6 changed files with 132 additions and 410 deletions
@ -1,142 +1,61 @@
|
||||
# Test Case Verification Guide |
||||
# Test Verification Guide |
||||
|
||||
This document explains how to verify the orbital simulation using the `test_simple.txt` configuration. |
||||
Quick reference for testing orbital mechanics using `configs/test_simple.txt`. |
||||
|
||||
## Running the Test |
||||
## Test Command |
||||
|
||||
```bash |
||||
# Build the simulation |
||||
make |
||||
|
||||
# Run the simple test case with human-readable output |
||||
./orbit_sim configs/test_simple.txt --headless --readable --days 365 |
||||
``` |
||||
|
||||
## Test Configuration |
||||
|
||||
The `configs/test_simple.txt` file contains: |
||||
- **Sun**: At the origin (0, 0, 0), mass 1.989e30 kg |
||||
- **Earth**: Starts at 1.0 AU on the +X axis, mass 5.972e24 kg |
||||
- **Mars**: Starts at 1.5 AU on the +X axis, mass 6.39e23 kg |
||||
|
||||
Both planets orbit in circular paths in the XY plane (counter-clockwise when viewed from +Z). |
||||
|
||||
## Expected Orbital Periods |
||||
|
||||
Using Kepler's third law: T² ∝ a³ (where T is period, a is semi-major axis) |
||||
|
||||
- **Earth**: T = 365.25 days (by definition) |
||||
- **Mars**: T = 686.98 days (approximately 687 days) |
||||
|
||||
## Expected Velocities |
||||
|
||||
Circular orbit velocity: v = sqrt(G * M_sun / r) |
||||
|
||||
- **Earth**: v = 29.789 km/s |
||||
- **Mars**: v = 24.323 km/s |
||||
|
||||
## Verification Points |
||||
|
||||
### Initial State (Day 0) |
||||
``` |
||||
Earth: |
||||
Position: (1.0, 0.0, 0.0) AU |
||||
Velocity: (0.0, -29.789, 0.0) km/s |
||||
|
||||
Mars: |
||||
Position: (1.5, 0.0, 0.0) AU |
||||
Velocity: (0.0, -24.323, 0.0) km/s |
||||
``` |
||||
|
||||
### Quarter Orbit (Day ~91) |
||||
After approximately 1/4 of Earth's year: |
||||
## Test Bodies |
||||
|
||||
``` |
||||
Earth: |
||||
Expected Position: (~0.0, -1.0, 0.0) AU |
||||
Expected Velocity: (~-29.789, 0.0, 0.0) km/s |
||||
Distance: ~1.0 AU (circular orbit) |
||||
|
||||
Mars: |
||||
Expected Position: (~0.987, -1.129, 0.0) AU (only traveled ~57 degrees) |
||||
Distance: ~1.5 AU (circular orbit) |
||||
``` |
||||
|
||||
### Half Orbit (Day ~183) |
||||
After approximately 1/2 of Earth's year: |
||||
|
||||
``` |
||||
Earth: |
||||
Expected Position: (~-1.0, 0.0, 0.0) AU |
||||
Expected Velocity: (0.0, 29.789, 0.0) km/s |
||||
Distance: ~1.0 AU |
||||
|
||||
Mars: |
||||
Expected Position: (~0.72, -1.30, 0.0) AU (traveled ~114 degrees) |
||||
Distance: ~1.5 AU |
||||
``` |
||||
- **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 |
||||
|
||||
### Full Orbit (Day ~365) |
||||
After approximately 1 full Earth year: |
||||
All orbit counter-clockwise (viewed from +Z). |
||||
|
||||
``` |
||||
Earth: |
||||
Expected Position: (~1.0, 0.0, 0.0) AU (back to start) |
||||
Expected Velocity: (0.0, -29.789, 0.0) km/s |
||||
Distance: ~1.0 AU |
||||
|
||||
Mars: |
||||
Expected Position: (~-0.87, -1.23, 0.0) AU (traveled ~228 degrees) |
||||
Distance: ~1.5 AU |
||||
``` |
||||
## Expected Behavior |
||||
|
||||
## How to Verify |
||||
**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 |
||||
|
||||
1. **Check orbital stability**: The distance from the Sun should remain constant |
||||
- Earth should stay at ~1.0 AU |
||||
- Mars should stay at ~1.5 AU |
||||
**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 |
||||
|
||||
2. **Check velocity magnitude**: Speed should remain constant in circular orbits |
||||
- Earth: always ~29.789 km/s |
||||
- Mars: always ~24.323 km/s |
||||
|
||||
3. **Check orbital period**: Run for 365 days |
||||
- Earth should return to near its starting position |
||||
- Mars should complete about half its orbit (687 day period) |
||||
|
||||
4. **Check direction**: Both planets orbit counter-clockwise |
||||
- Starting at +X axis |
||||
- Moving in -Y direction |
||||
- Position angle increases over time |
||||
|
||||
## Quick Test Commands |
||||
## Quick Tests |
||||
|
||||
```bash |
||||
# Run for a quarter year (91 days) |
||||
./orbit_sim configs/test_simple.txt --headless --readable --days 91 |
||||
|
||||
# Run for a half year (183 days) |
||||
./orbit_sim configs/test_simple.txt --headless --readable --days 183 |
||||
|
||||
# Run for a full year (365 days) |
||||
# Earth full orbit |
||||
./orbit_sim configs/test_simple.txt --headless --readable --days 365 |
||||
|
||||
# Run for Mars' full orbit (687 days) |
||||
# 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 numerical integration with discrete time steps: |
||||
- Distance variation: ±0.001 AU (~150,000 km) is acceptable |
||||
- Velocity variation: ±0.1 km/s is acceptable |
||||
- Position after full orbit: Within 0.01 AU of starting position |
||||
|
||||
## Understanding the Output |
||||
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 |
||||
|
||||
The `--readable` flag converts output to human-friendly units: |
||||
- **Positions**: Shown in AU (Astronomical Units, ~150 million km) |
||||
- **Velocities**: Shown in km/s |
||||
- **Distances**: Shown in both AU and km |
||||
## Output Flags |
||||
|
||||
Without `--readable`, all values are in SI units (meters, m/s) with scientific notation. |
||||
- `--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 |
||||
|
||||
Loading…
Reference in new issue