Professional Documents
Culture Documents
%r_ECEF
[3 x N]
Position
Vector in
%
ECEF
coordinate
%
frame of
reference
%
%v_ECEF
[3 x N]
Velocity
vector in
%
ECEF
coordinate
%
frame of
reference
%
%a_ECEF
[3 x N]
Acceleration Vector
%
in ECEF
coordinate
%
frame of
reference
%
% References:
%------------%Orbital Mechanics with Numerit,
http://www.cdeagle.com/omnum/pdf/csystems.pdf
%
%
% Function Dependencies:
%-----------------% JD2GMST
%----------------------------------------------------------------%
% Programed by Darin Koblick 07-05-2010
%
% Modified on 03/01/2012 to add acceleration vector support
%
%----------------------------------------------------------------%
function [r_ECEF v_ECEF a_ECEF] = ECItoECEF(JD,r_ECI,v_ECI,a_ECI)
%Enforce JD to be [N x 1]
JD = JD(:);
%Calculate the Greenwich Apparent Sideral Time (THETA)
%See http://www.cdeagle.com/omnum/pdf/csystems.pdf equation 27
THETA = JD2GAST(JD);
%Average inertial rotation rate of the earth radians per second
omega_e = 7.29211585275553e-005;
%Assemble the transformation matricies to go from ECI to ECEF
%See http://www.cdeagle.com/omnum/pdf/csystems.pdf equation 26
r_ECEF = squeeze(MultiDimMatrixMultiply(T3D(THETA),r_ECI));
v_ECEF = squeeze(MultiDimMatrixMultiply(T3D(THETA),v_ECI) + ...
MultiDimMatrixMultiply(Tdot3D(THETA,omega_e),r_ECI));
a_ECEF = squeeze(MultiDimMatrixMultiply(T3D(THETA),a_ECI) + ...
2.*MultiDimMatrixMultiply(Tdot3D(THETA,omega_e),v_ECI) + ...
MultiDimMatrixMultiply(Tddot3D(THETA,omega_e),r_ECI));
%----------------------------- End
Code-----------------------------------%
function C = MultiDimMatrixMultiply(A,B)
C = sum(bsxfun(@times,A,repmat(permute(B',[3 2 1]),[size(A,2) 1
1])),2);
function T = T3D(THETA)
T = zeros([3 3 length(THETA)]);
T(1,1,:) = cosd(THETA);
T(1,2,:) = sind(THETA);
T(2,1,:) = -T(1,2,:);
T(2,2,:) = T(1,1,:);
T(3,3,:) = ones(size(THETA));
function Tdot = Tdot3D(THETA,omega_e)
Tdot = zeros([3 3 length(THETA)]);
Tdot(1,1,:) = -omega_e.*sind(THETA);
Tdot(1,2,:) = omega_e.*cosd(THETA);
Tdot(2,1,:) = -Tdot(1,2,:);
Tdot(2,2,:) = Tdot(1,1,:);
function Tddot = Tddot3D(THETA,omega_e)
Tddot = zeros([3 3 length(THETA)]);
Tddot(1,1,:) = -(omega_e.^2).*cosd(THETA);
Tddot(1,2,:) = -(omega_e.^2).*sind(THETA);
Tddot(2,1,:) = -Tddot(1,2,:);
Tddot(2,2,:) = Tddot(1,1,:);
JD2GAST
Langkah pertama input tanggal konversikan waktu dalam julian date
(vektor) menjadi GAST (Greenwich Apparent Sidereal Time) dengan
memasukan data Julian date dalam bentuk vektor dan hasil output
berupa GAST dari derajat 0-360.
%----------------------------- Begin Function
----------------------------%Purpose:
%-------%Convert a specified Julian Date Vector to Greenwhich Apparent
Sidereal Time.
%
%Inputs:
%------%JD
[N x M x L]
Julian Date
Vector
%
%
%Outputs:
%-------%GAST
[N x M x L]
Greenwich
Apparent Sidereal
%
Time in
degrees from
%
0-360
%
%References:
%----------%Approximate Sidereal Time,
%http://www.usno.navy.mil/USNO/astronomical-applications/...
%astronomical-information-center/approx-sider-time
%
%Universal Sidereal Times, The Astronomical Almanac For The Year
2004
%
%Programed by:
%------------%Darin Koblick 07-17-2010
%Darin Koblick 05-28-2012 Updated Mean obliquity of the ecliptic
terms
%------------------------------------------------------------------------Pertama-tama masukan data tanggal dalam julian date (JD)
JD = juliandate (year,month,date,hour,minute,second)
dEPSILON = dEPSILON.*(1/3600);
%(GAST) Greenwhich apparent sidereal time expression in degrees
% see http://www.cdeagle.com/ccnum/pdf/demogast.pdf equation 1
Setelah kita mencari unsur-unsur yang ada dalam rumus GAST,
masukan semua hasil perhitungan kedalam rumus GAST untuk
menenmukan jumlah GAST dalam derajat.
GAST = mod(THETAm + dPSI.*cosd(EPSILONm+dEPSILON),360);
JD2GMST
%----------------------------- Begin Function
----------------------------%Purpose:
%-------%Convert a specified Julian Date Vector to Greenwhich Mean
Sidereal Time.
%
%Inputs:
%------%JD
[N x M x L]
Julian Date
Vector
%
%
%Outputs:
%-------%GMST
[N x M x L]
Greenwich
Mean Sidereal
%
Time in
degrees from
%
0-360
%
%References:
%-----------