This document explains the scientific calculations and physics models used in Earth's Firewall. All calculations are based on real scientific principles and NASA research.
Formula: E = 0.5 × m × v²
Where:
- E: Kinetic energy (Joules)
- m: Asteroid mass (kg)
- v: Impact velocity (m/s)
Example:
- Mass: 1.2 × 10¹² kg
- Velocity: 15,200 m/s
- Energy: 0.5 × 1.2 × 10¹² × (15,200)² = 1.38 × 10²⁰ J
Formula: TNT = E / (4.184 × 10¹⁵)
Where:
- TNT: TNT equivalent (megatons)
- E: Kinetic energy (Joules)
- 4.184 × 10¹⁵: Joules per megaton TNT
Example:
- Energy: 1.38 × 10²⁰ J
- TNT: 1.38 × 10²⁰ / (4.184 × 10¹⁵) = 33 megatons
Formula: D = k × (E)^(1/3) × (sin(θ))^n
Where:
- D: Crater diameter (km)
- E: Impact energy (Joules)
- θ: Impact angle (degrees)
- k: Material constant (0.1 for Earth)
- n: Angle exponent (0.3)
Example:
- Energy: 1.38 × 10²⁰ J
- Angle: 45°
- Diameter: 0.1 × (1.38 × 10²⁰)^(1/3) × (sin(45°))^0.3 = 2.5 km
Formula: R_blast = 1.2 × (TNT)^(1/3)
Where:
- R_blast: Blast radius (km)
- TNT: TNT equivalent (megatons)
Example:
- TNT: 33 megatons
- Blast radius: 1.2 × (33)^(1/3) = 3.8 km
Formula: R_thermal = 3.0 × (TNT)^(1/3)
Where:
- R_thermal: Thermal radiation radius (km)
- TNT: TNT equivalent (megatons)
Example:
- TNT: 33 megatons
- Thermal radius: 3.0 × (33)^(1/3) = 9.5 km
Formula: R_seismic = 0.5 × (TNT)^(1/3)
Where:
- R_seismic: Seismic effects radius (km)
- TNT: TNT equivalent (megatons)
Example:
- TNT: 33 megatons
- Seismic radius: 0.5 × (33)^(1/3) = 1.6 km
Formula: M = E - e × sin(E)
Where:
- M: Mean anomaly (radians)
- E: Eccentric anomaly (radians)
- e: Eccentricity
Formula: r = a × (1 - e × cos(E))
Where:
- r: Distance from focus (km)
- a: Semi-major axis (km)
- e: Eccentricity
- E: Eccentric anomaly (radians)
Formula: ν = 2 × arctan(√((1 + e)/(1 - e)) × tan(E/2))
Where:
- ν: True anomaly (radians)
- e: Eccentricity
- E: Eccentric anomaly (radians)
Formula: Δv = (m_impactor × v_impactor) / m_asteroid
Where:
- Δv: Velocity change (m/s)
- m_impactor: Impactor mass (kg)
- v_impactor: Impactor velocity (m/s)
- m_asteroid: Asteroid mass (kg)
Example:
- Impactor mass: 1000 kg
- Impactor velocity: 12,000 m/s
- Asteroid mass: 1.2 × 10¹² kg
- Δv: (1000 × 12,000) / (1.2 × 10¹²) = 0.01 m/s
Formula: F = G × m_asteroid × m_tractor / r²
Where:
- F: Gravitational force (N)
- G: Gravitational constant (6.674 × 10⁻¹¹ m³/kg⋅s²)
- m_asteroid: Asteroid mass (kg)
- m_tractor: Tractor mass (kg)
- r: Distance (m)
Example:
- Asteroid mass: 1.2 × 10¹² kg
- Tractor mass: 10,000 kg
- Distance: 100 m
- Force: (6.674 × 10⁻¹¹ × 1.2 × 10¹² × 10,000) / (100)² = 0.08 N
Formula: Δv = (P × t × η) / (m_asteroid × c)
Where:
- Δv: Velocity change (m/s)
- P: Laser power (W)
- t: Exposure time (s)
- η: Efficiency (0.1-0.5)
- m_asteroid: Asteroid mass (kg)
- c: Speed of light (3 × 10⁸ m/s)
Example:
- Power: 1 × 10⁶ W
- Time: 3.15 × 10⁷ s (1 year)
- Efficiency: 0.3
- Asteroid mass: 1.2 × 10¹² kg
- Δv: (1 × 10⁶ × 3.15 × 10⁷ × 0.3) / (1.2 × 10¹² × 3 × 10⁸) = 0.026 m/s
- Earth Radius: 6,371 km
- Earth Mass: 5.972 × 10²⁴ kg
- Gravitational Constant: 6.674 × 10⁻¹¹ m³/kg⋅s²
- Earth's Orbital Velocity: 30 km/s
- Atmospheric Height: 100 km
- Air Density (Sea Level): 1.225 kg/m³
- Speed of Sound: 343 m/s
- Crust Density: 2,700 kg/m³
- Mantle Density: 3,300 kg/m³
- Core Density: 5,500 kg/m³
- Carbonaceous: 1,500-2,000 kg/m³
- Silicate: 2,000-3,000 kg/m³
- Metallic: 3,000-8,000 kg/m³
- Small: < 50 m diameter
- Medium: 50-500 m diameter
- Large: 500-1000 m diameter
- Massive: > 1000 m diameter
- Near-Earth: 5-30 km/s
- Main Belt: 15-25 km/s
- Cometary: 20-70 km/s
Impact Energy: E ∝ m × v²
- Mass: Linear relationship
- Velocity: Quadratic relationship
Crater Diameter: D ∝ E^(1/3)
- Energy: Cubic root relationship
- Size: Logarithmic growth
Blast Radius: R ∝ TNT^(1/3)
- TNT: Cubic root relationship
- Effects: Diminishing returns
Kepler's Equation Solver:
E_{n+1} = E_n - (E_n - e×sin(E_n) - M) / (1 - e×cos(E_n))
Runge-Kutta 4th Order:
k1 = f(t, y)
k2 = f(t + h/2, y + h×k1/2)
k3 = f(t + h/2, y + h×k2/2)
k4 = f(t + h, y + h×k3)
y_{n+1} = y_n + h×(k1 + 2×k2 + 2×k3 + k4)/6
Sphere-Sphere Intersection:
distance = √((x1-x2)² + (y1-y2)² + (z1-z2)²)
intersection = distance < (r1 + r2)
- Spherical Earth: Simplified geometry
- Uniform Density: Average material properties
- No Atmosphere: Simplified impact physics
- Point Mass: Gravitational interactions
- Impact Energy: ±10% for typical asteroids
- Crater Diameter: ±20% for complex geology
- Environmental Effects: ±30% for local conditions
- Orbital Mechanics: ±1% for short-term predictions
- Complex Geology: Simplified material properties
- Atmospheric Effects: Not included in basic model
- Fragmentation: Simplified breakup physics
- Long-term Evolution: Limited to short-term predictions
- Crater Scaling: Based on nuclear test data
- Impact Physics: Validated against laboratory experiments
- Orbital Mechanics: Compared to NASA trajectory data
- Tunguska Event: 1908 impact validation
- Chelyabinsk Meteor: 2013 atmospheric entry
- Chicxulub Impact: 66 million years ago
- NEO Database: Real asteroid properties
- Trajectory Predictions: JPL calculations
- Impact Risk: Sentry system data
- Melosh, H.J. (1989). "Impact Cratering: A Geologic Process"
- Collins, G.S. et al. (2005). "Earth Impact Effects Program"
- Harris, A.W. (2008). "What Spaceguard Did"
- Physics Engine:
backend/calculations/impact_physics.py - Orbital Mechanics:
backend/calculations/orbital_mechanics.py - Defense Strategies:
backend/calculations/mitigation.py - Game Engine:
backend/simulation/game_engine.py
- Caching: Pre-calculated trajectory data
- Vectorization: NumPy array operations
- Parallel Processing: Multi-threaded calculations
- Memory Management: Efficient data structures
- Unit Tests: Individual function validation
- Integration Tests: End-to-end simulation
- Performance Tests: Load and stress testing
- Accuracy Tests: Comparison with known results
- Physics: Kinetic energy, momentum, orbital mechanics
- Mathematics: Calculus, differential equations, numerical methods
- Engineering: Mission design, risk assessment, optimization
- Science: Planetary science, impact cratering, environmental effects
- Parameter Adjustment: See effects of changing variables
- Strategy Comparison: Compare different defense approaches
- Scenario Analysis: Explore various impact scenarios
- Real-time Feedback: Immediate physics calculations
- Advanced Physics: Atmospheric entry, fragmentation
- Real-time Data: Live NASA NEO updates
- Machine Learning: AI-powered strategy optimization
- Virtual Reality: Immersive 3D experience
- Latest Studies: Incorporate new research findings
- NASA Missions: Real mission data integration
- International Collaboration: Global defense strategies
- Public Engagement: Citizen science participation
- GitHub Issues: EarthsFirewall/EarthsFirewall
- Documentation: docs/
- API Reference: docs/API.md
- NASA Space Apps: spaceappschallenge.org
- Planetary Defense: nasa.gov/planetarydefense
- Asteroid Science: cneos.jpl.nasa.gov
Remember: This simulation is designed for education and entertainment. For real asteroid impact predictions, always consult official NASA sources and the scientific community.