@ -1,11 +1,16 @@
# Configuration File Assumptions and Issues
# Configuration File Assumptions and Issues
## Recent Updates:
- ✅ **FIXED** : Eccentric orbit support added via eccentricity and semi_major_axis parameters
- ✅ **FIXED** : Binary star barycenter calculation
- ⚠️ **TODO** : Moon and Jupiter's moons positions still incorrect in solar_system.txt
## Key Assumptions Found:
## Key Assumptions Found:
### **1. Format Assumptions (from config_loader.cpp)**
### **1. Format Assumptions (from config_loader.cpp)**
- Line buffer limited to 256 characters (config_loader.cpp:30)
- Line buffer limited to 256 characters (config_loader.cpp:39 )
- Name limited to 64 characters (config_loader.cpp:31)
- Name limited to 64 characters (config_loader.cpp:40 )
- All 10 fields must be present: `name mass radius x y z parent_index r g b` (config_loader.cpp:19 )
- All 12 fields must be present: `name mass radius x y z parent_index r g b eccentricity semi_major_axis` (config_loader.cpp:16-20 )
- File format is space-delimited
- File format is space-delimited
### **2. Solar System Configuration Issues:**
### **2. Solar System Configuration Issues:**
@ -36,12 +41,15 @@ The moon positions appear to use **absolute coordinates** matching their orbital
**Problem 2: Planet positions**
**Problem 2: Planet positions**
- PlanetA1 is at `(3.5e11, 0, 0)` while StarA is at `(3.0e11, 0, 0)` - only 50 million km apart
- PlanetA1 is at `(3.5e11, 0, 0)` while StarA is at `(3.0e11, 0, 0)` - only 50 million km apart
- PlanetB1 is at `(-4.2e11, 0, 0)` while StarB is at `(-3.7e11, 0, 0)` - only 50 million km apart
- PlanetB1 is at `(-4.2e11, 0, 0)` while StarB is at `(-3.7e11, 0, 0)` - only 50 million km apart
- These seem reasonable as absolute positions, but the velocity calculation assumes circular orbits
- These seem reasonable as absolute positions (now supports both circular and eccentric orbits)
### **4. Velocity Calculation Assumptions (config_loader.cpp:63-118):**
### **4. Velocity Calculation Assumptions (config_loader.cpp:78-245):**
- All orbits are assumed to be **circular**
- ~~All orbits are assumed to be **circular**~~ - **FIXED** : Now supports both circular (e=0) and eccentric (e>0) orbits
- Orbits are calculated in the XY plane perpendicular to Z-axis (config_loader.cpp:92)
- Velocities calculated using **vis-viva equation** : `v = sqrt(G*M*(2/r - 1/a))`
- Root bodies (parent_index = -1) get zero velocity
- For circular orbits: e=0, a=orbital_radius
- For eccentric orbits: e>0, a=semi_major_axis
- Orbits are calculated in the XY plane perpendicular to Z-axis (config_loader.cpp:219-226)
- Root bodies (parent_index = -1) get zero velocity (or orbit barycenter if multiple roots)
- Velocities are calculated relative to parent, then parent's velocity is added
- Velocities are calculated relative to parent, then parent's velocity is added
### **5. Critical Assumption:**
### **5. Critical Assumption:**