0% found this document useful (0 votes)
11 views

assign_1_sfm (1)

Uploaded by

pagariyachhand
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views

assign_1_sfm (1)

Uploaded by

pagariyachhand
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

AE 313/AE 613 Space Flight Mechanics

Assignment 1

Chhand Pagariya SC22B047

Department of Aerospace Engineering


Indian Institute of Space Science and Technology,
Kerala, India

Academic year 2024-25


IIST Space Flgiht Mechanics

Problem 1

Problem Description
At a given instant, a space object has the following position and velocity vectors relative to an
Earth-centered inertial frame of reference (î, ĵ, k̂):

r0 = 20, 000î − 105, 000ĵ − 19, 000k̂ (km)


v0 = 0.9000î − 3.4000ĵ − 1.5000k̂ (km/s)
The task is divided into two parts:

(i) Using Algorithm 3.4 from Curtis


Using the initial conditions r0 and v0 , apply Algorithm 3.4 from Curtis (3rd Edition) to compute
the position vector r and velocity vector v after 2 hours. Detailed steps involved in the algorithm
must be shown, along with the MATLAB code used to obtain the solution.

(ii) Using Different Initial Conditions


Choose a different set of initial conditions (r0 , v0 ) and compute the position vector r and velocity
vector v at a later time t, which could be 1 hour, 2 hours, or 3 hours. This will involve solving the
problem with the new initial conditions and showing the steps as well as the MATLAB code.

1 Solution
1.1 MATLAB CODE

1 clc ;
2 % t a k i n g i n p u t th e v a l u e o f g r a v i t a t i o n a l c o n s t a n t parameter
3 mu = i n p u t ( ” Enter t h e v l a u e o f G r a v i t a t i o n a l c o n s t a n t parameter i n (km
ˆ3/ s ˆ 3 ) = ” ) ;
4 % Take v a l u e o f Ro from u s e r
5 Ro = i n p u t ( ” Enter th e v a l u e o f Ro i n (km) as [ x , y , z ] = ” ) ;
6 % Take v a l u e o f Vo from u s e r
7 Vo = i n p u t ( ” Enter t he v a l u e o f Vo (km/ s ) as [ x , y , z ] = ” ) ;
8 % Take t h e v a l u e o f time a f t e r which p o o s i t i o n i s t o f i n d out
9 t = i n p u t ( ” Enter th e time a f t e r which you want t o f i n d t he p o s i t i o n (
hrs ) = ”) ;
10 ts = t ∗3600;
11 r o = norm (Ro) ; % Magnitude o f Ro
12 vo = norm (Vo) ; % Magnitude o f Vo
13 vro = (Ro ( 1 ) ∗Vo ( 1 )+Ro ( 2 ) ∗Vo ( 2 )+Ro ( 3 ) ∗Vo ( 3 ) ) / r o ; %R a d i a l component o f
Velocity
14 a lp h a = ( 2 / r o ) −(( vo ˆ 2) /mu) ;
15 f p r i n t f (”\ n ” ) ;
16

17 i f alpha >0
18 f p r i n t f ( ” The t r a j e c t o r y i s E l l i p s e \n ” ) ;
IIST Space Flgiht Mechanics

19 e l s e i f a lp ha < 0
20 f p r i n t f ( ” The t r a j e c t o r y i s Hyperbola \n ” ) ;
21 else
22 f p r i n t f ( ” The t r a j e c t o r y i s Parabola \n ” ) ;
23 end
24 e r r o r = 1 . e −8;
25 n maxi = 1 0 0 0 ; %maximum no . o f i t e r a t u i o n s
26 Xo = ( s q r t (mu) ) ∗ ( abs ( alpha ) ) ∗ t s ; % Value o f U n i v e r s a l Anomaly
27 n = 0;
28 ratio = 1;
29 w h i l e r a t i o > e r r o r & n<=n maxi
30 n = n+1;
31 C = stumpC ( alpha ∗Xoˆ 2) ;
32 S = stumpS ( alpha ∗Xoˆ 2) ;
33 f x= ( ( r o ∗ vro ) / ( s q r t (mu) ) ) ∗Xoˆ2∗C + ( 1 − alpha ∗ r o ) ∗Xoˆ3∗S + r o ∗Xo−(
s q r t (mu) ) ∗ t s ;
34 d f x =(( r o ∗ vro ) / ( s q r t (mu) ) ) ∗Xo∗ ( 1 −alpha ∗Xoˆ2∗S ) + ( 1 − alpha ∗ r o ) ∗Xoˆ2∗
C + ro ;
35 r a t i o = f x / d fx ;
36

37 Xo=Xo − r a t i o ;
38 end
39

40 f = 1−Xoˆ 2∗ ( stumpC ( alpha ∗Xoˆ 2) ) / r o ; % C a l c u l a t i n g v a l u e o f l a g r a n g e f


41

42 g= t s −Xoˆ 3∗ ( stumpS ( alpha ∗Xoˆ 2) ) / ( s q r t (mu) ) ; %C a l c u l a t i n g v a l u e o f


lagrange g
43

44 R = f ∗Ro+g∗Vo ; %F i n a l p o s i t i o n r
45 r = norm (R) ;
46

47 d f = ( s q r t (mu) ) ∗ ( alpha ∗Xoˆ3∗ ( stumpS ( alpha ∗Xoˆ 2) )−Xo) / ( r ∗ r o ) ;%


Derivative of lagrange f
48

49 dg= 1 − Xoˆ2∗ ( stumpC ( alpha ∗Xoˆ 2) ) / r ; % D e r i v a t i v e o f l a g r a n g e g


50

51 V = d f ∗Ro + dg∗Vo ;
52 v = norm (V) ;
53 f p r i n t f (”\ n ” ) ;
54 f p r i n t f (” Final P o s i t i o n : r = %d i + %d j + %d k (km) \n ” , R( 1 ) , R( 2 ) , R
(3) ) ;
55 f p r i n t f (”\ n ” ) ;
56 f p r i n t f ( ” Magnitude o f r = %d km\n ” , r ) ;
57 f p r i n t f (”\ n ” ) ;
58 f p r i n t f (” Final Velocity : v = %d i + %d j + %d k (km) / s ” , V( 1 ) , V( 2 ) , V
(3) ) ;
59 f p r i n t f (”\ n ” ) ;
60 f p r i n t f ( ” Magnitude o f v = %d km/ s ” , v ) ;
61 f p r i n t f (”\ n ” ) ;
IIST Space Flgiht Mechanics

62

63 f u n c t i o n c = stumpC ( z )
64 i f z>0
65 c = (1− c o s ( s q r t ( z ) ) ) / z ;
66 e l s e i f z<0
67 c = ( cosh ( s q r t (−z ) ) − 1 ) /(− z ) ;
68 else
69 c = 1/2;
70 end
71 end
72

73

74 f u n c t i o n s = stumpS ( z )
75 i f z>0
76 s = ( s q r t ( z ) − s i n ( s q r t ( z ) ) ) /( s q r t ( z ) ) ˆ3;
77 e l s e i f z<0
78 s = ( s i n h ( s q r t (−z ) ) − s q r t (−z ) ) / ( s q r t (−z ) ) ˆ 3 ;
79 else
80 s = 1/6;
81 end
82 end

1.2 Part 1
The given initial values of position and velocity vector are:
r0 = 20, 000 î − 105, 000 ĵ − 19, 000 k̂ (km)

v0 = 0.9000 î − 3.4000 ĵ − 1.5000 k̂ (km/s)


The final values of position and velocity vector after 2 hours are:
r = 26340.98 î − 12, 8768.2 ĵ − 29659.16 k̂ (km)

v = 0.8636392 î − 3.215873 ĵ − 1.462163 k̂ (km/s)

Figure:

Figure 1: Values of Position and Velocity after t = 2 hours


IIST Space Flgiht Mechanics

1.3 Part 2
1.3.1 Taking t = 3 hours

That is we will calculate the values of Position and Velocity after 3 hours. The given initial values
of position and velocity vector are:

r0 = 22000 î + 27000 ĵ + 7000 k̂ (km)

v0 = 0.7000 î + 0.7000 ĵ + 1.000 k̂ (km/s)


The final values of position and velocity vector after 3 hours are:
r = 19890.64 î + 22919.1 ĵ + 13618.98 k̂ (km)

v = −1.152436 î − 1.506447 ĵ + 0.08326165 k̂ (km/s)

Figure:

Figure 2: Values of Position and Velocity after t = 3 hours


IIST Space Flgiht Mechanics

1.3.2 Taking t = 1 hours

That is we will calculate the values of Position and Velocity after 3 hours. The given initial values
of position and velocity vector are:
r0 = 4011 î + 3011 ĵ + 2931 k̂ (km)

v0 = 2.003 î + 2.004 ĵ + 3.000 k̂ (km/s)


The final values of position and velocity vector after 1 hour are:

r = 3199.936 î + 2273.879 ĵ + 1944.501 k̂ (km)

v = 4.599312 î + 3.903782 ĵ + 4.746070 k̂ (km/s)

Figure:

Figure 3: Values of Position and Velocity after t = 1 hours

You might also like