Determine the position, velocity, and orbit (in 3D) of satellite with given the initial vector (r0 &v0), using MATLAB
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.
Clone this repository to your local machine using the following command:
git clone https://github.com/your-username/orbital-mechanics-simulation.git
main.m
script to execute the simulation.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.
Semi-Major Axis:
Eccentric Anomaly:
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: A.Asgharpoor@ut.ac.ir