This repository contains MATLAB code designed to simulate the orbital motion of a satellite around Earth. The simulation employs Keplerian orbital elements to calculate the satellite's position and velocity vectors over time. The primary objective of this code is to provide a visual representation and analysis of the satellite's trajectory in Earth-Centered Inertial (ECI) coordinates.
-
Download and install MATLAB on your system.
-
Clone this repository to your local machine using the following command:
git clone https://github.com/your-username/orbital-mechanics-simulation.git
- Open MATLAB and navigate to the cloned repository.
- Run the
main.m
script to execute the simulation. - Examine the generated plots to visualize the satellite's orbit.
The initial conditions of the satellite, such as position and velocity, are defined in Cartesian coordinates. These values are then converted into classical orbital elements using the rv_from_r0v0
and coe_from_rv
functions.
The satellite's orbit is visualized using MATLAB's plotting capabilities. The script generates a 3D plot of the satellite's trajectory in ECI coordinates, overlaid on a sphere representing Earth.
Coordinate transformations are applied to convert the satellite's position from perifocal coordinates to ECI coordinates. The matrices ( R_{z_{\Omega}} ), ( R_{x_i} ), and ( R_{z_{\omega}} ) are used for these transformations.
-
Orbital Elements Calculation:
-
Eccentric Anomaly Iteration:
-
Orbit Positions Calculation:
-
Coordinate Transformations:
The simulation also provides information such as the apogee and perigee of the satellite's orbit, as well as its final position and velocity vectors. Eccentricity, inclination, and other orbital elements are calculated and displayed.
The visual representation includes an illustration of the Earth's surface, the satellite's orbit trajectory, and key orbital parameters.
For any questions, feedback, or suggestions regarding this code, please contact:
Author: A. Asgharpoor
Email: [email protected]