cosmo/analyze_problem.py

65 lines
2.1 KiB
Python

#!/usr/bin/env python3
"""Analyze the size calculation problem"""
import json
print("=" * 80)
print("SIZE CALCULATION ANALYSIS")
print("=" * 80)
configs = {
"planet": {"ratio": 0.00008},
"dwarf_planet": {"ratio": 0.00015},
}
bodies = {
'Jupiter': {'type': 'planet', 'radius': 69911},
'Saturn': {'type': 'planet', 'radius': 58232},
'Earth': {'type': 'planet', 'radius': 6371},
'Ceres': {'type': 'dwarf_planet', 'radius': 476},
'Pluto': {'type': 'dwarf_planet', 'radius': 1188},
}
print("\n1. CALCULATED DISPLAY SIZES:")
print("-" * 80)
for name, body in bodies.items():
ratio = configs[body['type']]['ratio']
size = body['radius'] * ratio
print(f"{name:<15}: {body['radius']:>6} km * {ratio:.6f} = {size:.4f}")
print("\n2. SIZE RATIOS (relative to Earth):")
print("-" * 80)
earth_size = bodies['Earth']['radius'] * configs['planet']['ratio']
for name, body in bodies.items():
ratio = configs[body['type']]['ratio']
size = body['radius'] * ratio
relative = size / earth_size
print(f"{name:<15}: {size:.4f} / {earth_size:.4f} = {relative:.2f}x Earth")
print("\n" + "=" * 80)
print("⚠️ PROBLEM IDENTIFIED:")
print("=" * 80)
print("Planet ratio: 0.00008")
print("Dwarf planet ratio: 0.00015 (1.875x larger!)")
print()
print("This means dwarf planets are artificially ENLARGED by 1.875x")
print("relative to regular planets!")
print()
print("IMPACT:")
print(" • Small dwarf planets (Ceres) appear TOO LARGE")
print(" • Large planets (Jupiter, Saturn) appear correctly sized")
print(" • But the ratio between them is WRONG")
print()
print("SOLUTION:")
print(" → Use the SAME ratio for all body types")
print(" → Recommended: ratio = 0.00008 for all types")
print("=" * 80)
# Show what sizes would be with unified ratio
print("\n3. SIZES WITH UNIFIED RATIO (0.00008):")
print("-" * 80)
unified_ratio = 0.00008
for name, body in bodies.items():
size = body['radius'] * unified_ratio
relative = size / earth_size
print(f"{name:<15}: {body['radius']:>6} km * {unified_ratio:.6f} = {size:.4f} ({relative:.2f}x Earth)")