One implementation of an n-body orbit propagator that accounts for both drag and solar radiation pressure is the Cowell's method. This method is implemented in many astrodynamics libraries such as the NASA GMAT, and can be implemented in MATLAB using the following steps:
Define the initial conditions for the spacecraft (position, velocity, mass, etc.) and the gravitational elements of the central body (mu, J2, J3, etc.)
Define the coefficient of drag (Cd) and the coefficient of solar radiation pressure (Cr) based on the characteristics of the spacecraft.
Choose a numerical integrator for the propagation process (e.g., Runge-Kutta, Dormand-Prince, etc.) and set the integration step size.
During each integration step, calculate the acceleration of the spacecraft due to the central body's gravity, drag, and solar radiation pressure.
Update the position and velocity of the spacecraft based on the calculated acceleration, and update the mass of the spacecraft based on the fuel consumption.
Here's an example function that implements the Cowell's method:
main.m1652 chars55 lines
This function takes the following inputs:
tspan
: a vector containing the start and end times of the simulation and the desired step size (e.g., tspan = [0 86400 60]
for a simulation from time 0 to 86400 seconds with a step size of 60 seconds)
r0
: the initial position vector of the spacecraft
v0
: the initial velocity vector of the spacecraft
Cd
: the coefficient of aerodynamic drag of the spacecraft
Cr
: the coefficient of solar radiation pressure of the spacecraft
m0
: the initial mass of the spacecraft
mu
: the gravitational parameter of the central body
J2
, J3
: the zonal harmonics of the central body
step
: the integration step size (optional, defaults to 60 seconds)
And returns the following outputs:
t
: a vector containing the simulation times
r
: a matrix containing the position vectors of the spacecraft at each simulation time
v
: a matrix containing the velocity vectors of the spacecraft at each simulation time
Note that the function assumes that the spacecraft is in a circular orbit around the central body at the start of the simulation, and that the central body is not affected by drag or solar radiation pressure. If these assumptions do not hold, additional modifications to the function may be necessary.
gistlibby LogSnag