-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathKaulaGeopotentialPerturbations.m
48 lines (47 loc) · 1.69 KB
/
KaulaGeopotentialPerturbations.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
%% Package: osculating2mean
% Author: Leonardo Pedroso
%% Function KaulaGeopotentialPerturbations
% Input: t_tdb: dynamic baricentric time since J2000 (s)
% mean OE: a, u (mean anomaly + arg perigee), ex, ey, i, longitude of asceding node
% degree: maximum degree of spherical harmonics geopotential model
% Output: dOE: da, de, di, dOmega, dw, dM (semi-major axis, excentricity,
% inclination, longitude of ascending node, argument of perigee, mean anomaly)
% Computation of the geopotential perturbations with a spherical harmonics
% geopotential model according to [1]
%% References
% [1] Kaula, W.M., 2013. Theory of satellite geodesy: applications of
% satellites to geodesy. Courier Corporation.
%% Implementation
function dOE = KaulaGeopotentialPerturbations(t_tdb,OEmean,degree)
%% Input variables
a = OEmean(1);
u = OEmean(2);
ex = OEmean(3);
ey = OEmean(4);
i = OEmean(5);
Omega = OEmean(6);
%% Compute mean anomaly, w, and e
w = atan2(ey,ex);
M = u-w;
if M>2*pi
M = M-floor(M/(2*pi))*2*pi;
elseif M<0
M = M+ceil(-M/(2*pi))*2*pi;
end
e = sqrt(ex^2+ey^2);
%% Convert t_tdb to mofified julian date
%t_tt = t_tdb; % terrestrial time since J2000 (s)
t_mjd = t_tdb/86400 + 51544.5; % julian date
%% Compute Kaula geopotential perturbations
% Form input to FORTRAN
input = [t_mjd;... % epoch (mjd)
a; ... % a (m)
M; ... % M (rad)
u; ... % u (rad)
e; ... % e
i; ... % i (rad)
Omega; ... % Omega (rad)
degree]; % Max degree
% Computation in FORTRAN mex
dOE = KaulaGeopotentialPerturbations_mex(input);
end