Orbital Motion in MATLAB

MAE 202 coursework · Differential equations and plotting

For this Dynamics assignment, I used polar coordinates to write the equations of motion for an object moving around Earth. I converted them into a system of first-order differential equations, solved them with MATLAB’s ode45, and plotted the trajectory and the radial and tangential velocity components.

Equations of motion

The gravitational force acts toward Earth’s center. Using radial and tangential acceleration gives:

r̈ = rθ̇² − g(Rₑ/r)²
θ̈ = −2ṙθ̇/r

I used the state vector [r; vr; theta; vTheta] to write the four first-order equations:

dr/dt = vr
dvr/dt = vTheta²/r − g(RE/r)²
dtheta/dt = vTheta/r
dvTheta/dt = −vr × vTheta/r

MATLAB setup

My main script defines the physical parameters, initial conditions, and output times. It calls ode45 using a separate function, then uses x = r cos(theta) and y = r sin(theta) to plot the path. I ran one case at a time, changing the starting tangential velocity.

Each case starts at five Earth radii from the center, with zero radial velocity. The simulation covers 800,000 seconds, requesting output every 10 seconds. ode45 chooses its own internal integration steps. The model assumes motion in a plane around a stationary Earth, with no thrust or drag.

Trajectory and velocity plots

Each case below includes the trajectory and both velocity components, as requested in the assignment. The plots are the original coursework exports.