assignment week 12 space mech

2
clear all; clc r_e=6371*1000; AU=149597871*1000; %m r1_ijk=1000*[0; -4464.696; -5102.507]; %m r2_ijk=1000*[0; 5740.323; 3189.068]; %m hour=12; minute=00; second=00; day=15; month=2; year=1995; theta=acosd((dot(r1_ijk,r2_ijk))/((norm(r1_ijk))*(norm(r2_ijk)))); theta1=acosd(r_e/norm(r1_ijk)); theta2=acosd((r_e/norm(r2_ijk))); % Checking Line of Sight for two satellites if (theta1+theta2)>theta disp '1. Satellites are in LOS' else disp '1. Satellites are not in LOS' end JD_0=367*year-floor((year+floor((month+9)/12))*7/4)+floor(275*month/9)... +day+1721013.5 ; T_UT1=(JD_0-2451545)/36525; T_TDB=T_UT1; M_s=357.5277233 + 35999.05034*T_TDB; lambda_M_s=280.4606184 + 36000.77005361*T_TDB; %CONVERTING lambda_M_m WITHIN (+/-)0-360 deg------------------------------- while abs(lambda_M_s)>360 if lambda_M_s>0 lambda_M_s=lambda_M_s-360; elseif lambda_M_s<0 lambda_M_s=lambda_M_s+360; end end %CONVERTING M_m WITHIN (+/-)0-360 deg-------------------------------------- while abs(M_s)>360 if M_s>0 M_s=M_s-360; elseif M_s<0 M_s=M_s+360; end end %-------------------------------------------------------------------------- lambda_ecliptic=lambda_M_s+1.914666471*sind(M_s)+0.019994643*sind(2*M_s); r_s=1.000140612-0.016708617*cosd(M_s)-0.000139589*cosd(2*M_s); e=23.439291-0.0130042*T_TDB; r_ss=AU*[r_s*cosd(lambda_ecliptic); r_s*cosd(e)*sind(lambda_ecliptic);... r_s*sind(e)*sind(lambda_ecliptic)]; EAS 3801 SPACE MECHANIC ASSIGNMENT WEEK 12 LECTURER : DR. SYARIL AZRAD MD. ALI NAME : ONG THIAM CHUN NO. MATRIC : 158347 Result: 1. Satellites are not in LOS. 2. Satellite 1 is in sun phase.

Upload: thiam-chun-ong

Post on 08-Feb-2016

18 views

Category:

Documents


0 download

DESCRIPTION

A solution to determine the location of satellite

TRANSCRIPT

Page 1: Assignment Week 12 Space Mech

clear all; clcr_e=6371*1000; AU=149597871*1000; %mr1_ijk=1000*[0; -4464.696; -5102.507]; %mr2_ijk=1000*[0; 5740.323; 3189.068]; %mhour=12; minute=00; second=00; day=15; month=2; year=1995;

theta=acosd((dot(r1_ijk,r2_ijk))/((norm(r1_ijk))*(norm(r2_ijk))));theta1=acosd(r_e/norm(r1_ijk));theta2=acosd((r_e/norm(r2_ijk))); % Checking Line of Sight for two satellites if (theta1+theta2)>theta disp '1. Satellites are in LOS'else disp '1. Satellites are not in LOS'end

JD_0=367*year-floor((year+floor((month+9)/12))*7/4)+floor(275*month/9)... +day+1721013.5 ; T_UT1=(JD_0-2451545)/36525;T_TDB=T_UT1;M_s=357.5277233 + 35999.05034*T_TDB;lambda_M_s=280.4606184 + 36000.77005361*T_TDB;

%CONVERTING lambda_M_m WITHIN (+/-)0-360 deg-------------------------------while abs(lambda_M_s)>360 if lambda_M_s>0 lambda_M_s=lambda_M_s-360; elseif lambda_M_s<0 lambda_M_s=lambda_M_s+360; endend%CONVERTING M_m WITHIN (+/-)0-360 deg--------------------------------------while abs(M_s)>360 if M_s>0 M_s=M_s-360; elseif M_s<0 M_s=M_s+360; endend%--------------------------------------------------------------------------lambda_ecliptic=lambda_M_s+1.914666471*sind(M_s)+0.019994643*sind(2*M_s);r_s=1.000140612-0.016708617*cosd(M_s)-0.000139589*cosd(2*M_s);e=23.439291-0.0130042*T_TDB;r_ss=AU*[r_s*cosd(lambda_ecliptic); r_s*cosd(e)*sind(lambda_ecliptic);... r_s*sind(e)*sind(lambda_ecliptic)]; theta_s=acosd((r_e/norm(r_ss)));theta_ss=acosd((dot(r1_ijk,r_ss))/((norm(r1_ijk))*(norm(r_ss)))); % Checking Line of Sight for Satellite 1 and Sunif (theta1+theta_s)> theta_ss disp '2. Satellite 1 is in sun phase.'else disp '2. Satellite 1 is in eclipse phase.'end

EAS 3801 SPACE MECHANIC ASSIGNMENT WEEK 12LECTURER : DR. SYARIL AZRAD MD. ALINAME : ONG THIAM CHUNNO. MATRIC : 158347

Result:

1. Satellites are not in LOS.2. Satellite 1 is in sun phase.