Author: Abhimanyu Premachandran Nair
This project involves the mathematical modeling of the trajectory of an asteroid in the solar system, considering the gravitational interactions between the Sun, Earth, and Jupiter. The main objective is to determine whether the asteroid impacts the Earth during its journey.
The provided code performs the following steps:
- Loads necessary R packages for data visualization and analysis.
- Defines constants and initial conditions for the simulation.
- Performs backward integration to trace the trajectory of the asteroid from a pre-chosen radius (ra) towards an earlier time.
- Performs forward integration to trace the trajectory of the asteroid from ra towards a later time.
- Checks for impact between the asteroid and Earth during forward integration.
- Plots the trajectories of Earth and the asteroid.
- Runs simulations for different initial conditions and delta values.
- Introduces Jupiter to the system and repeats the integration and impact analysis.
To run the code:
- Ensure you have R and the necessary packages (ggplot2, gganimate) installed.
- Copy and paste the code into an R script or environment.
- Execute the code to visualize the trajectory and analyze impact scenarios.
The code generates plots and outputs indicating whether the asteroid impacts the Earth under different conditions and parameters.
This code is for educational purposes and simulation only. Results may vary depending on the model assumptions and parameters used.