An interactive simulation of an Intercontinental Ballistic Missile (ICBM) launch, focusing on the missile’s inertial trajectory under the influence of gravity. This project offers a great foundation for building advanced missile simulations, and contributions are welcome to extend its features!
- Inertial Phase Simulation: The missile follows an inertial path after launch, with no active thrust. Gravity is the only force acting on the missile in this basic version of the simulation.
- Realistic Earth Model: The Earth is modeled accurately, including curvature and altitude-based gravitational forces.
- Real-time Visualization: The missile's flight path is visualized in real time, showing how gravity influences its trajectory.
This project was bootstrapped with Create React App.
-
Clone the repository:
git clone https://github.com/dimitarbez/ICBMSimulator.git
-
Navigate into the project directory:
cd ICBMSimulator
-
Install dependencies:
npm install
-
Run the app:
npm start
The app will be running at http://localhost:3000.
Within the project directory, you can run:
Runs the app in development mode with hot reloading. Lint errors and warnings will appear in the console.
Builds the app for production. The production build will be optimized for the best performance.
Launches the test runner in interactive watch mode.
The current simulation models the missile's motion using:
- Initial Velocity: The missile is launched with a user-defined velocity.
- Gravity: Gravity is the only force acting on the missile, decreasing with altitude according to the inverse-square law.
- No Thrust Phase: After launch, the missile follows a purely inertial trajectory.
- Earth's Radius:
6,371,000 meters
- Earth's Mass:
5.972 × 10^24 kg
- Gravitational Constant (G):
6.67430 × 10^-11 m³/kg/s²
- Adjust Launch Parameters: Use the control panel to set the launch angle (in degrees) and initial velocity (in m/s).
- Start Simulation: Click the "Start" button to launch the missile and visualize the trajectory.
- Pause/Reset: You can pause the simulation or reset it to try different initial conditions.
- Visualization: The missile’s current position is displayed, and its trajectory is drawn in real-time.
- Feature: Implement air drag to simulate how air resistance slows the missile down as it passes through the atmosphere.
- Improvement: Introduce altitude-dependent air density using the barometric formula to make drag realistic at different altitudes:
where:
rho(h) = rho_0 * e^(-h / H)
rho_0
is sea-level air density (1.225 kg/m³).h
is the altitude.H
is the scale height (about 8,500 meters).
- Feature: Add wind dynamics to simulate lateral forces on the missile.
- Improvement: You can create a wind model that varies with altitude and direction, adding complexity to the missile’s flight path.
- Feature: Many ICBMs have multiple stages. You could implement a system where different stages are jettisoned, reducing the missile's mass and adjusting its velocity accordingly.
- Improvement: Allow the missile to change thrust or lose weight dynamically during flight.
- Feature: Add a thrust phase before the inertial phase to simulate missile engines providing an initial boost.
- Improvement: Use realistic thrust forces and durations for the boost phase before the missile switches to inertial motion.
- Feature: Detect when the missile impacts the ground or reaches a target, and simulate the effect of the impact.
- Improvement: Introduce an "explosion" or event-trigger when the missile reaches its destination.
- Feature: Improve the visualization of the missile's path, adding 3D effects or better indicators of altitude, velocity, and acceleration.
- Improvement: Use WebGL or other libraries to create advanced 3D visualizations of the Earth's curvature and the missile's trajectory.
- Feature: Incorporate more advanced physics models such as the Coriolis effect, which impacts long-range trajectories.
- Improvement: Include atmospheric scattering, heat generation during reentry, or other effects that enhance the realism of the simulation.
To better understand the physics involved in missile flight, consider exploring the following topics:
- Orbital mechanics and the physics of space travel
- Air density models and drag force calculations
- The physics behind real-world missile launches and their trajectories
Contributions are warmly welcomed! If you’re interested in adding features, fixing bugs, or improving the simulation, feel free to:
- Fork the repository.
- Create a feature branch:
git checkout -b feature/my-feature
. - Commit your changes:
git commit -m 'Add a cool feature'
. - Push to the branch:
git push origin feature/my-feature
. - Open a Pull Request.
Your contributions will help improve this project for everyone!