Professional Documents
Culture Documents
Final Project Orbital Mechanics Enrique Blanco
Final Project Orbital Mechanics Enrique Blanco
Final Project
AE 362 Orbital Mechanics
Answer:
DISTURBED
UNDISTURBED
UNDISTURBED
x 10
10
X
Y
Z
2
1
0
-1
-2
0
4
x 10
5
10
15
Time (hours)
20
-5
10
15
Time (hours)
20
25
Velocity (km/s)
Position R(km)
10
4
3
2
1
0
0
-10
0
25
Vx
VY
VZ
6
4
2
10
15
Time (hours)
20
25
0
0
10
15
Time (hours)
20
25
From the figures we can easily notice how the orbit changes its position inversely with respect to its velocity
and its periodicity respectively.
3
DISTURBED
x 10
10
X
Y
Z
2
1
0
-1
-2
0
x 10
10
15
Time (hours)
20
-5
10
15
Time (hours)
10
15
Time (hours)
20
25
Velocity (km/s)
Position R( km)
10
4
3
2
1
0
0
-10
0
25
Xdot
Ydot
Zdot
6
4
2
10
15
Time (hours)
20
25
0
0
20
From the graphics it is not really evident how the Earths oblateness influences the satellites mechanics
but if we look closely we can notice small changes in the position and velocity. Specially near the perigee.
25
3D ORBIT PLOT
4
x 10
Z (km)
Rz (km)
x 10
-1
4
-1
4
4
2
4
x 10
0
Ry (km)
-2
x 10
0
-2
2
x 10
Rx (km)
Y (km)
0
-2
-2
x 10
X (km)
This set of 3-d plots show that the orbit of the satellite is slightly modified in a periodic fashion due to the
Earths oblateness a little bit more graphically.
-15
x 10
1.5
Change in Eccentricity (Shape)
x 10
0.5
-0.5
-1
0
0
10
15
Time (hours)
20
25
-1.5
10
15
Time (hours)
20
25
-14
-14
x 10
x 10
-1
-2
1
0
-1
-2
-3
-4
-5
-3
0
10
15
Time (hours)
-15
x 10
20
-6
0
25
10
15
Time (hours)
20
25
1.5
1
0.5
0
-0.5
-1
-1.5
-2
10
15
Time (hours)
20
25
400
400
\\\\
350
350
300
300
250
200
150
250
200
150
100
100
50
50
10
15
Time (hours)
20
25
6
Time (hours)
10
12
200
6000
0
-200
Change in energy
-400
-600
-800
-1000
-1200
-1400
-1600
-1800
10
15
Time (hours)
20
25
hX
hY
hZ
4000
2000
0
-2000
-4000
-6000
-8000
-10000
-12000
10
15
Time (hours)
20
25
These two graphs show that the Energy and the angular momentum remain constant,
respectively.
Here we note that the ground tracks of the satellite are a periodic motion, not essentially
synchronized with the Earths rotation.
7
positionx(y)=rx;
positiony(y)=ry;
positionz(y)=rz;
velocityx(y)=vx;
velocityy(y)=vy;
velocityz(y)=vz;
rv=[rx ry rz];
vv=[vx vy vz];
r=norm(rv);
v=norm(vv);
vr = (dot(rv,vv))/r;
hv=cross(rv,vv);
h=norm(hv);
dhx=hvx-hv(1);
dhy=hvy-hv(2);
dhz=hvz-hv(3);
hvx=hv(1);
hvy=hv(2);
hvz=hv(3);
i= acos((hv(3))/h);
nv=cross([0 0 1],hv);
n=norm(nv);
omega= acos((nv(1))/n);
if nv(2)<0
omega=2*pi-omega;
end
ev=(1/miu)*((((v^2)-(miu/r)).*rv)-(r*vr.*vv));
e=norm(ev);
w=acos((dot(nv,ev))/(n*e));
if ev(3)<0
w=2*pi-w;
end
%a=((h^2)/miu)*(1/(1-e^2));
theta=acos((dot(ev,rv))/(r*e));
%if vr<0
%theta=(2*pi-theta);
%end
incd=i-i0;
inc(y)=incd;
deltaw=w0-w;
argument(y)=deltaw;
w0=w;
deltaec=e-e0;
eccentricity(y)=deltaec;
e0=e;
semimajor=a-a0;
angularmd=h-h0;
omegaw=omega-omega0;
teta(y)=theta;
%if(mod(y,2)~=0)
%omegav(y)=-1*omegaw;
%else
omegav(y)=omegaw;
%end
angularm(y)=angularmd;
axis(y)=semimajor;
energy=(((v^2)/2)-(miu/r));
deltaE(y)=energy-E0;
E0=energy;
h0=h;
a0=a;
omega0=omega;
hx(y)=dhx;
hy(y)=dhy;
hz(y)=dhz;
end
for l=1 %GRAPHICS
g=1;
Mve=(zeros(1,length(0:10:T)));
for te=0:10:T
Mve(g)=Mev(g);
g=g+1;
end
ht=[0:10:T];
ht=ht/3600;
Mve=(Mve*180)/pi;
time=time/3600;
figure;
plot(time,hx,'b');
hold on;
grid on;
plot(time,hy,'g');
plot(time,hz,'r--');
xlabel('Time (hours)');
ylabel('Change in angular momentum components (km^2/s)');
legend('hX','hY','hZ');
hold off;
figure;
plot(time,positionx,'b');
hold on;
plot(time,positiony,'g');
10
plot(time,positionz,'r--');
xlabel('Time (hours)');
ylabel('Position r(vector) (km)');
legend('X','Y','Z');
hold off;
figure;
plot(time,velocityx,'g');
hold on;
plot(time,velocityy,'b');
plot(time,velocityz,'r--');
xlabel('Time (hours)');
ylabel('Velocity v(vector) (km/s)');
legend('Xdot','Ydot','Zdot');
hold off;
figure;
plot(time,position,'r');
xlabel('Time (hours)');
ylabel('Position r (km)');
figure;
plot(time,velocity,'g');
xlabel('Time (hours)');
ylabel('Velocity v (km/s)');
figure;
plot(ht,Mve,'b--');
xlabel('Time (hours)');
ylabel('Mean Anomaly (degrees)');
figure;
plot(time,deltaE,'b');
xlabel('Time (hours)');
ylabel('Change in energy');
figure;
plot(time,angularm,'g--');
xlabel('Time (hours)');
ylabel('Change in angular momentum');
plot(time,axis,'b--');
xlabel('Time (hours)');
ylabel('Semi-major axis length change (km)');
figure;
omegav=((omegav*180)/pi);
plot(time,omegav,'g--');
xlabel('Time (hours)');
ylabel('Change in Right ascencion (Degrees)');
figure;
plot(time,eccentricity,'b');
xlabel('Time (hours)');
ylabel('Change in Eccentricity (Shape)');
figure;
plot(time,argument,'y');
argument=((argument*180)/pi);
xlabel('Time (hours)');
ylabel('Change in Argument of perigee (Degrees)');
figure;
inc=((inc*180)/pi);
plot(time,inc,'r--');
xlabel('Time (hours)');
ylabel('Change in Inclination (Degrees)');
figure;
teta=((teta*180)/pi);
plot(time,teta,'r');
xlabel('Time (hours)');
ylabel('Mean anomaly (Degrees)');
end
end
elseif eleccion==2
disp('3)PERTURBED TWO BODY EOM');%
clc
T=2*pi*(a^(3/2))/(sqrt(miu));
time=[0:10:(2*T)];
for s=1; %counters
position=(zeros(1,length(time)));
deltaE=(zeros(1,length(time)));
angularm=(zeros(1,length(time)));
velocity=(zeros(1,length(time)));
axis=(zeros(1,length(time)));
omegav=(zeros(1,length(time)));
eccentricity=(zeros(1,length(time)));
argument=(zeros(1,length(time)));
inc=(zeros(1,length(time)));
Mev=(zeros(1,length(time)));
positionx=(zeros(1,length(time)));
positiony=(zeros(1,length(time)));
positionz=(zeros(1,length(time)));
velocityx=(zeros(1,length(time)));
velocityy=(zeros(1,length(time)));
velocityz=(zeros(1,length(time)));
end
y=0;
time=0:10:(2*T);
E0=(((v^2)/2)-(miu/r));
a0=((h^2)/miu)*(1/(e^2-1));
h0=h;
wc=w;
11
thet0=theta;
omeg0=omega;
ic=i;
for t=0:10:(2*T)
Me=((2*pi)/T)*t;
E=Me;
y=y+1;
e0=e;
w0=w;
i0=i;
omega0=omega;
for i=1:5
E=E-(E-e*sin(E)-Me)/(1-e*cos(E));
end
theta=acos((e-cos(E))/(e*cos(E)-1));
r=((h^2)/miu)*(1/(1+e*cos(theta)));
v=sqrt((miu/a)+(2*miu/r));
position(y)=r;
velocity(y)=v;
Rx=(((h^2)/miu)*(1/(1+e*cos(theta)))).*(vertcat(cos(theta),sin(theta),0));
Vx=(miu/h)*[-sin(theta); e+cos(theta);0];
C1=[cos(w) sin(w) 0; -sin(w) cos(w) 0; 0 0 1];
C2=[1 0 0; 0 cos(ic) sin(ic) ; 0 -sin(ic) cos(ic)];
C3=[cos(omega) sin(omega) 0; -sin(omega) cos(omega) 0; 0 0 1];
Q=C1*C2*C3;
Qt=transpose(Q);
Mev(y)=Me;
ri=Qt*Rx;
vi=Qt*Vx;
vt=(h/r);
rx=ri(1);
ry=ri(2);
rz=ri(3);
vz=vi(3);
vx=vi(1);
vy=vi(2);
aJ2x =1/2*miu*J2*re^2*(15*vx*vz^2/r^7-3*vx/r^5);
aJ2y = 1/2*miu*J2*re^2*(15*vy*vz^2/r^7-3*vy/r^5);
aJ2z = 1/2*miu*J2*re^2*(15*vz^3/r^7-9*r/r^5);
ax = -miu*vx/r^3+aJ2x;
ay = -miu*vy/r^3+aJ2y;
az = -miu*vz/r^3+aJ2z;
X_vec_dot_J2 = [vx vy vz ax ay az];
accv=[ax ay az];
k1=0;
k2=0;
k3=0;
k4=0;
cont=.1;
for x=0:cont:xf
x1=x;
y0=y;
k1=subs(f);
x=x+(1/2)*h;
x0=x;
y=y+(1/2)*k1;
k2=h*subs(f);
y=y0;
y=y+(1/2)*k2;
k3=h*subs(f);
y=y0;
y=y+k3;
x=x0+h;
k4=h*subs(f);
y=y0+(1/6)*(k1+2*k2+2*k3+k4)
x=x1;
end
positionx(y)=rx;
positiony(y)=ry;
positionz(y)=rz;
velocityx(y)=vx;
velocityy(y)=vy;
velocityz(y)=vz;
rv=[rx ry rz];
vv=[vx vy vz];
r=norm(rv);
v=norm(vv);
vr = (dot(rv,vv))/r;
hv=cross(rv,vv);
h=norm(hv);
i= acos((hv(3))/h);
nv=cross([0 0 1],hv);
n=norm(nv);
omega= acos((nv(1))/n);
if nv(2)<0
omega=2*pi-omega;
end
ev=(1/miu)*((((v^2)-(miu/r)).*rv)-(r*vr.*vv));
e=norm(ev);
w=acos((dot(nv,ev))/(n*e));
12
if ev(3)<0
w=2*pi-w;
end
a=((h^2)/miu)*(1/(1-e^2));
theta=acos((dot(ev,rv))/(r*e));
if vr<0
theta=(2*pi-theta);
end
incd=i-i0;
inc(y)=incd;
deltaw=w0-w;
argument(y)=deltaw;
w0=w;
deltaec=e-e0;
eccentricity(y)=deltaec;
e0=e;
semimajor=a-a0;
angularmd=h-h0;
omegaw=omega-omega0;
%if(mod(y,2)~=0)
%omegav(y)=-1*omegaw;
%else
omegav(y)=omegaw;
%end
angularm(y)=angularmd;
axis(y)=semimajor;
energy=(((v^2)/2)-(miu/r));
deltaE(y)=energy-E0;
E0=energy;
h0=h;
a0=a;
omega0=omega;
end
for l=1 %GRAPHICS
g=1;
Mve=(zeros(1,length(0:10:T)));
for te=0:10:T
Mve(g)=Mev(g);
g=g+1;
end
ht=[0:10:T];
ht=ht/3600;
Mve=(Mve*180)/pi;
time=time/3600;
figure;
plot(time,positionx,'b');
hold on;
plot(time,positiony,'g');
plot(time,positionz,'r--');
xlabel('Time (hours)');
ylabel('Position r(vector) (km)');
legend('X','Y','Z');
hold off;
figure;
plot(time,velocityx,'g');
hold on;
plot(time,velocityy,'b');
plot(time,velocityz,'r--');
xlabel('Time (hours)');
ylabel('Velocity v(vector) (km/s)');
legend('Xdot','Ydot','Zdot');
hold off;
figure;
plot(time,position,'r');
xlabel('Time (hours)');
ylabel('Position r (km)');
figure;
plot(time,velocity,'g');
xlabel('Time (hours)');
ylabel('Velocity v (km/s)');
figure;
plot(ht,Mve,'b--');
xlabel('Time (hours)');
ylabel('Mean Anomaly (degrees)');
figure;
plot(time,deltaE,'b');
xlabel('Time (hours)');
ylabel('Change in energy');
figure;
plot(time,angularm,'g--');
xlabel('Time (hours)');
ylabel('Change in angular momentum');
plot(time,axis,'b--');
xlabel('Time (hours)');
ylabel('Semi-major axis length change (km)');
figure;
omegav=((omegav*180)/pi);
plot(time,omegav,'g--');
xlabel('Time (hours)');
ylabel('Change in Right ascencion (Degrees)');
figure;
plot(time,eccentricity,'b');
xlabel('Time (hours)');
13
Earth
Earth
Earth
Earth
if h == 0
h = figure(fig);
end
a
ecc
inc
O
w
nuo
=
=
=
=
=
=
Kepler(1);
Kepler(2);
Kepler(3);
Kepler(4);
Kepler(5);
Kepler(6);
n = (mu/a^3)^.5;
E = atan2(sin(nuo)*(1-ecc^2)^.5,ecc+cos(nuo));
MA = E-ecc*sin(E); %Initial Mean anomaly
%Eccentric anomaly
=
=
=
=
=
0;
length(time);
2;
zeros(1,length(time));
zeros(1,length(time));
14
for j = 1:length(time)
GMST = zeroTo360(GMSTo + w_earth*time(j),1);
M = zeroTo360(MA + n*time(j),1);
nu = nuFromM(M,ecc,10^-12);
%GMST in radians
[ECI,Veci] = randv(a,ecc,inc,O,w,nu);
clear veci
ECEF = eci2ecef(ECI,GMST);
[Lat_rad(j),Long_rad(j)] = RVtoLatLong(ECEF);
if j > 1 && ((Long_rad(j)-Long_rad(j-1)) < -pi || (Long_rad(j)-Long_rad(j-1)) > pi)
bp(k) = j-1;
k
= k+1;
end
end
bp(length(bp)+1) = length(time);
Lat
= Lat_rad.*r2d;
Long
= Long_rad.*r2d;
x = load('Coastline.dat');
plot(x(:,1),x(:,2),'r--')
clear x
hold on
for j = 2:length(bp)
plot(Long(bp(j-1)+1:bp(j)),Lat(bp(j-1)+1:bp(j)),s)
end
axis([-180,180,-90,90])
xlabel('Longitude (\circ)')
ylabel('Latitude (\circ)')
end
end
15
');