Vous êtes sur la page 1sur 9

Indian Institute of Space Science and Technology

AE 313 SPACE FLIGHT MECHANICS

Assignment 1

Submitted By: Submitted to:


Rahul Goud Togita Ramanan R.V., Ph.D.
SC15B039 Adjunct Professor,
B.Tech,Aerospace Engineering Dept. of Aerospace
IIST Engineering.

September 5, 2017
1 Question 1
Assume eccentricity (e) = ( 0.01, 0.1, 0.2, 0.4, 0.6, 0.9 )

Solve the Kepler equation for M=[0,360] degrees .

Plot your results .

Develop a code to solve Kepler equation in whichever language you are comfortable
with.

Analyze the results and make observations.

Answer
To solve the Kepler Equation. A general function was used to solve the Kepler equation
using Newton Raphson method. Now to find the values of Eccentric Anomaly as the Mean
Anomaly changes from [0, 360] degrees.

M = E e sin(E) (1)

We cannot solve this transcendental equation directly for E. However, an accurate solution
requires an iterative, trial and error procedure.
Using MATLAB, a general function was written to compute the root using Newton Raphson
method. This code was used to solve the Kepler Equation for different values of Eccentricity
as mentioned in the question. The following were the plots obtained.

Observations
The monotonic increasing relationship between mean anamaly and eccentric anamaly
can be seen from the plot.

As the eccenticity is decreased(approching to 0) the mean anamaly and eccentric ana-


maly becomes equal which can be verified from equation(1).

As the eccentricity is increased the deviation of eccentric anamaly from mean anamaly
can be seen from Fig(1).

We know that at perigee and apogee the auxiliary circle and the ellipse intersect. So
it can been seen from Fig.1 that for any value of eccentricity the value of eccentric
anomaly and mean anamaly is same.

As the value of eccentricity is increased, near the perigee the spacecraft sweeps more
angle so that Keplers Second law is satisfied. This can also be verified from the graph.

1
Figure 1: Variation of Eccentric anomaly with Mean Anomaly for different values of eccen-
tricites

2
Figure 2: Geocentric equatorial frame and the orbital elements

2 Question 2
Write a code to transform a state vector in to orbital elements. With this code transform the
following state vectors :
Case 1 :
x=-8503.8558701333313 ; xdot = -4.3229148869407341
y= 14729.110427313784 ; ydot = -2.3293249804847838
z= 6190.3008264368991 ; zdot = 5.24855402558600526E-002
Case 2 :
x =-13686.889393418738 ; xdot = 0.88259108105901152
y =-13344.772667428870 ; ydot = 1.9876415852134037
z = 10814.629905439588 ; zdot = 3.4114313525042017

Answer
Using MATLAB, a general code was written to transform a state vector into orbital elements.
The six orbital elements are: a-semi major axis.
e- eccentricity.
i-inclination.
-right ascension of the ascending node(RAAN).
- argument of perigee.
- true anomaly.

3
Results
First case -
Orbital Element Result from code
a(km) 20000.027200
e 0.100001
i(degrees) 20.000000
-raan(degrees) 30.000000
-omega(degrees) 70.000220
-nyu(degrees) 19.999780

Second case -
Orbital Element Result from code
a(km) 20000.018461
e 0.099999
i(degrees) 100.000000
-raan(degrees) 230.000000
-omega(degrees) 199.999888
-nyu(degrees) 190.000112

3 MATLAB codes
3.1 Question 1-Kepler Equation

%AE313 SPACE FLIGHT MECHANICS


%Solving Kepler equation using Newton-Raphson method
%Written by Rahul Goud Togita on 04-09-2017

%% Initialisation
clc;
clear all;
%% Given parameters

e = [ 0.01,0.1,0.2,0.4,0.6,0.9]; % Eccentricity of the conic


M = 0:0.001:2*pi; % Range of the Mean Anomaly (in radians)
%%

for i=1:6 % loop for different values of eccentricity


for j=1:6284 % loop for different values of Mean anamoly
fx(i,j) = newtonraphson(0,1e-6,M(j),e(i)); % Calls the newtonraphson.m function...
to get the answer
end
% Plotting mean anomaly versus eccentric anomaly

h= plot(M*180/pi,fx(i,:)*180/pi); %Plotting in Degrees


% for changing the sizes and styles of labels
xlabel(Mean Anomaly,FontSize,14, FontName,Arial,FontWeight,bold);

4
ylabel(Eccentric Anomaly,FontSize,14, FontName,Arial,FontWeight,bold);

set(h,LineWidth,1.2); %Setting linewidth for curve


set(gca,... %Setting the axes width of the plot
YTick,0:30:360,...
XTick,0:30:360)
grid on
axis ( [ 0 360 0 360])

hold on
end
legend(e=0.01,e=0.1,e=0.2,e=0.4,e=0.6,e=0.9)

3.2 Function for Newton Raphson method


function [fx] = newtonraphson(eini,tol,M,e)
x=eini; % Initial Guess of Eccentric Anomaly
f=0.1;
while (abs(f)>tol) % Condition to check if the error is within the tolerance

f = x-(e*sin(x))-M;
df = 1 - (e*cos(x));
dx = -f/df;
x = x + dx;

end
fx=x; % Returns the answer to the main function

3.3 Question 2-Code to transform a state vector in to orbital ele-


ments.

clc;
clear all;
%%
%AE313-SPACE FLIGHT MECHANICS
%Code to transform a state vector in to orbital elements.
%Written by Rahul Goud Togita(SC15B039)
%First Case - Given State vector is.
x1=-8503.8558701333313;
xdot1 = -4.3229148869407341;
y1=14729.110427313784 ;
ydot1 = -2.3293249804847838;
z1= 6190.3008264368991 ;
zdot1 = 5.24855402558600526E-002;

5
%%
i=[1 0 0]; % Unit vector in X_direction
j=[0 1 0]; % Unit vector in Y_direction
k=[0 0 1]; % Unit vector in Z_direction
r1=[x1 y1 z1]; %converting into position vector
v1=[xdot1 ydot1 zdot1]; %converting into Velocity vector
mr1=norm(r1); %magnitude of position vector
mv1=norm(v1); %magnitude of velocity
myu = 398600 ; %Gravitational Constant Units are km^3/s^2
%% Semi Major Axis

a1=(myu*mr1)/(2*myu-mr1*mv1*mv1); % Semi Major Axis


%% Eccentricity

je1=(mv1*mv1-myu/mr1).*r1-dot(r1,v1).*v1;
e1=je1./myu; %eccentricity vector
me1=norm(e1); %magnitude of eccentricity
%% Inclination

h1=cross(r1,v1); %Angular momentum Vector


mh1=norm(h1); %magnitude of Angular momentum Vector
w1=h1./mh1; %vector perpendicular to orbital plane
ci1=dot(w1,k); %Cosine of Inclination
inc1=acosd(ci1); %Inclination(in degrees)
%% Right ascension of ascending node

N1=cross(k,w1)./(norm(cross(k,w1))); %Unit vector along line of nodes


craan1=dot(N1,i); % cosine of Right ascension of ascending node
sraan1=dot(k,cross(i,N1)); %sine of Right ascension of ascending node
raan1=atan2d(sraan1,craan1) ; %Right ascension of ascending node(in degrees)
%% Argument of Perigee

ecap1=e1./norm(e1); %Unit Vector of eccentricity


comega1=dot(N1,ecap1); %Cosine of Argument of Perigee
somega1=dot(w1,cross(N1,ecap1)); %Sine of Argument of Perigee
omega1=atan2d(somega1,comega1); %Argument of Perigee(in degrees)
rcap1=r1./norm(r1); %Unit Vector of Position Vector
%% True Anamoly

cnyu1=dot(ecap1,rcap1); %Cosine of True Anamoly


snyu1=dot(w1,cross(ecap1,rcap1)); %Sine of True Anamoly
nyu1=atan2d(snyu1,cnyu1); %True Anamoly(in degrees)
%% For Finding Positive Angles.

if nyu1<0
nyu1=nyu1+360;
end
if omega1<0
omega1=omega1+360;

6
end
if raan1<0
raan1=raan1+360;
end
%Printing the values of orbital Elements.
fprintf(For First case--a=%f\n e=%f\n i=%f\n raan=%f\n omega=%f\n nyu=%f\n,...
a1,me1,inc1,raan1,omega1,nyu1)
%% For Second case-Given State vector is.

x2 =-13686.889393418738;
xdot2 = 0.88259108105901152;
y2 =-13344.772667428870;
ydot2 = 1.9876415852134037;
z2 = 10814.629905439588;
zdot2 = 3.4114313525042017 ;
%% Semi Major Axis

r2=[x2 y2 z2];
v2=[xdot2 ydot2 zdot2];
mr2=norm(r2);
mv2=norm(v2);
myu = 398600 ;

a2=(myu*mr2)/(2*myu-mr2*mv2*mv2);
%% Eccentricity
je2=(mv2*mv2-myu/mr2).*r2-dot(r2,v2).*v2;
e2=je2./myu;
me2=norm(e2);
%% Inclination

h2=cross(r2,v2);
mh2=norm(h2);
w2=h2./mh2;
k=[0 0 1];
i=[1 0 0];
j=[0 1 0];
ci2=dot(w2,k);
inc2=acosd(ci2);
%% Right ascension of ascending node

N2=cross(k,w2)./(norm(cross(k,w2)));
craan2=dot(N2,i);
sraan2=dot(k,cross(i,N2));
raan2=atan2d(sraan2,craan2);
%% Argument of Perigee

ecap2=e2./norm(e2);

7
comega2=dot(N2,ecap2);
somega2=dot(w2,cross(N2,ecap2));
omega2=atan2d(somega2,comega2);
%% True Anamoly

rcap2=r2./norm(r2);
cnyu2=dot(ecap2,rcap2);
snyu2=dot(w2,cross(ecap2,rcap2));
nyu2=atan2d(snyu2,cnyu2);
%% For Finding Positive Angles.

if nyu2<0
nyu2=nyu2+360;
end
if omega2<0
omega2=omega2+360;
end
if raan2<0
raan2=raan2+360;
end
fprintf(for Second case -- a=%f\n e=%f\n i=%f\n raan=%f\n omega=%f\n nyu=%f\n...
,a2,me2,inc2,raan2,omega2,nyu2)

Vous aimerez peut-être aussi