Code covered by the BSD License
- atan3 (a, b)
four quadrant inverse tangent
- deltav_guess(oev1, alttar...initial guess for de-orbit delta-v vector and flight time
- deorbit_shoot(x)
objective function and EI equality constraints
- eci2fpc1(gast, reci, veci)
convert inertial state vector to flight path coordinates
- eci2orb1 (mu, r, v)
convert eci state vector to six classical orbital
- gast1 (jdate)
Greenwich apparent sidereal time
- gdate (jdate)
convert Julian date to Gregorian (calendar) date
- geodet1 (rmag, dec)
geodetic latitude and altitude
- j2eqm (t, y)
first order equations of orbital motion
- jd2str(jdate)
convert Julian date to string equivalent
- julian (month, day, year)
Julian date
- keycheck
pause and request user input
- oeprint1(mu, oev)
print six classical orbital elements
- orb2eci(mu, oev)
convert classical orbital elements to eci state vector
- readdata(filename)
NOTE: all angular elements are returned in radians
- svprint(r, v)
print position and velocity vectors and magnitudes
- tof1(mu, sma, ecc, tanom1...time of flight between two true anomalies
- twobody2 (mu, tau, ri, vi)solve the two body initial value problem
- ueci2angles(reci, veci, u...convect eci unit vector to rtn angles
- deorbit_snopt.m
-
View all files
from
A MATLAB Script for Optimal Single Impulse De-orbit from Earth Orbits
by David Eagle
optimal impulsive maneuver required to de-orbit a spacecraft in a circular or elliptical Earth orbit
|
| atan3 (a, b)
|
function y = atan3 (a, b)
% four quadrant inverse tangent
% input
% a = sine of angle
% b = cosine of angle
% output
% y = angle (radians; 0 =< c <= 2 * pi)
% Orbital Mechanics with MATLAB
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
epsilon = 0.0000000001;
pidiv2 = 0.5 * pi;
if (abs(a) < epsilon)
y = (1 - sign(b)) * pidiv2;
return;
else
c = (2 - sign(a)) * pidiv2;
end
if (abs(b) < epsilon)
y = c;
return;
else
y = c + sign(a) * sign(b) * (abs(atan(a / b)) - pidiv2);
end
|
|
Contact us