Code covered by the BSD License
-
CalcEA(M,ecc,tol)
Orbit eccentric anomaly, Kepler's equation keplers equation
-
Groundtrack(Kepler,GMSTo,Tf,f...
Orbit groundtrack plot Latitude longitude lat long
-
Hohmann(R_init,R_fin,U)
Orbit Hohmann transfer
-
JD(yr,day)
Julian Date
-
KeplerCOE(Ro,Vo,dT,U,tol)
Orbit Kepler position velocity
-
NodeChange(dO,inc,Vinit)
Node change right ascension of the ascending node RAAN raan orbit
-
R1(x)
Rotation matrix direction cosine matrix
-
R2(x)
Rotation matrix direction cosine matrix
-
R3(x)
Rotation matrix direction cosine matrix
-
RVtoLatLong(ECEF)
orbit radius velocity latitude longitude ECEF
-
TwoBody(t,X,U)
Two body Orbit gravity
-
dInc(V,dI,fpa)
Inclination change orbit gravity
-
dVdI(R_init,R_fin,Inc,U,Tol)
Inclination change velocity change orbit hohmann transfer
-
ecef2eci(ECEF, GST, V_ECEF)
Orbit ECEF ECI Coordinate conversion
-
eci2ecef(ECI, GST, V_ECI)
Orbit ECEF ECI Coordinate conversion
-
elorb(R,V,U,tol)
Kepler orbital elements ECI Position orbit conversion
-
nuFromM(M,ecc,tol)
Kepler Orbit Anomaly true mean
-
nuFromTp(Tp,ecc,n,tol)
Kepler Orbit Anomaly true time periapse perigee
-
plotorb(ECEF, V_ECEF, mu, Rbo...
Orbit gravity plot orbit spherical
-
randv(a,ecc,inc,Omega,w,nu,U)
Kepler orbital elements ECI Position orbit conversion
-
topo(ECEF, lat, long, h, Rp)
Orbit range elevation azimuth position ground station site latitude longitude
-
zeroTo360(x,unit)
Angle reduce reduction degrees radians
-
Constants.m
-
View all files
from
Orbital Mechanics Library
by Richard Rieber
A compilation of all of the functions I wrote for my orbital mechanics class
|
| CalcEA(M,ecc,tol)
|
% Orbit eccentric anomaly, Kepler's equation keplers equation
% Richard Rieber
% 1/23/2005
% rrieber@gmail.com
%
% Revision 8/21/07: Fixed typo in line 38 if statement
% Added H1 line for lookfor functionality
%
% function E = CalcEA(M,ecc,tol)
%
% Purpose: Solves for eccentric anomaly, E, from a given mean anomaly, M,
% and eccentricty, ecc. Performs a simple Newton-Raphson iteration
%
% Inputs: o M - Mean anomaly in radians.
% o ecc - Eccentricity of the orbit.
% o tol - a tolerance at which to terminate iterations; Default
% is 10^-8 radians. [OPTIONAL]
%
% Outputs: o E - The eccentric anomaly in radians.
%
% E = CalcEA(M,ecc) uses default tolerances
%
% E = CalcEA(M,ecc,tol) will use a user specified tolerance, tol
%
function E = CalcEA(M,ecc,tol)
%Checking for user inputed tolerance
if nargin == 2
%using default value
tol = 10^-8;
elseif nargin > 3
error('Too many inputs. See help CalcEA')
elseif nargin < 2
error('Too few inputs. See help CalcEA')
end
if (M > -pi && M < 0) || M > pi
E = M - ecc;
else
E = M + ecc;
end
Etemp = E + (M - E + ecc*sin(E))/(1-ecc*cos(E));
Etemp2 = E;
while abs(Etemp - Etemp2) > tol
Etemp = Etemp2;
Etemp2 = Etemp + (M - Etemp + ecc*sin(Etemp))/(1-ecc*cos(Etemp));
end
E = Etemp2;
|
|
Contact us at files@mathworks.com