lab#1-stkandorbitanalysis...university of colorado - boulder asen 3200 - group 30 - 33a orbital...

22
U C - B ASEN 3200 - G 30 - 33A O M 4/5/2019 Lab #1 - STK and Orbit Analysis Author: Jarrod P a Author: Karim K b Author: Nick Z c a 104003252 b 104667875 c 106980975

Upload: others

Post on 03-Oct-2020

3 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Lab#1-STKandOrbitAnalysis...University of Colorado - Boulder ASEN 3200 - Group 30 - 33A Orbital Mechanics 4/5/2019 Lab#1-STKandOrbitAnalysis Author: JarrodPusemana Author: KarimKrartib

University of Colorado - BoulderASEN 3200 - Group 30 - 33A

Orbital Mechanics

4/5/2019

Lab #1 - STK and Orbit Analysis

Author:Jarrod Pusemana

Author:Karim Krartib

Author:Nick Zellmannc

a104003252b104667875c106980975

Page 2: Lab#1-STKandOrbitAnalysis...University of Colorado - Boulder ASEN 3200 - Group 30 - 33A Orbital Mechanics 4/5/2019 Lab#1-STKandOrbitAnalysis Author: JarrodPusemana Author: KarimKrartib

The primary objective of this labwas to learn how to use STK as amodel for astrodynamicalsystems. This lab also served as a demonstration of the limitations of the two-body model ofastrodynamical systems, as well as conservation of angular momentum in said systems. Wealso created a MATLAB simulation of orbital systems, to gain a better understanding of thephysics involved in these models. We completed two orbital simulations, one for a spacecraftin a high orbit of the Earth, the other in a highly eccentric orbit of Luna. We found thatthe two-body model was usually accurate enough for most mission parameters. This lab alsointroduced Kepler’s Equation and the importance of time in mission design, which we usedboth MATLAB and STK simulation to explore.

I. IntroductionIn this lab, our team hopes to achieve a better practical understanding of the modeling software STK, and apply the

software to orbital mission design. We plan to test the errors incurred in using the two-body assumption in spacecraftorbital dynamics. To this end, we will consider highly elliptical or very large orbits, to increase the potential effect ofmore distant celestial bodies and the irregularity of celestial bodies in general. These models will also be simulated inMATLAB, for a better, more direct understanding of the dynamics at play. We also plan to conduct a study on the timebetween two points in an orbit, again using both MATLAB and STK. These principles can be and are applied to almostall facets of orbital mission design, as an understanding of astrodynamical modeling is critical in any space mission.Time sensitivity is also critical to a many kinds of space mission. In this lab, we consider the case of a spacecraft thatneeds to conduct a scientific experiment at a range of altitudes. In this case, knowing when to begin recording data is animportant of achieving the mission objectives.

II. Part 1Part I of this lab encompassed modelling the flight of a spacecraft around the earth. The satellite is set up to run from

Jan 1, 2020 00hr 00min 00s UTCG for the duration of one orbit. The professional celestial-body modelling softwareSTK is used, and for this part of the experiment, a two-body approximation is used. The following parameters are usedin STK to set up the orbit:

1) Coordinate System: Earth Inertial2) Coordinate Type: Keplerian3) Element Type: Osculating4) Orbit Epoch: 1 Jan 2020 00:00:00.000 UTCG5) Semimajor axis: a = 37.9735 Re6) Eccentricity: e = .5877) Inclination: i = 108) Longitude of Ascending Node: Ω = 09) Argument of Periapsis: ω = 010) True Anomaly = 0This satellite merely in an elliptical orbit around the earth. The results for each of the questions asked in this part of

the lab are outlined below.

A. Question 1As the simulation runs, the directions and magnitudes of the eccentricity and angular momentum do not change with

time. The angular momentum vector points perpendicularly to the orbital plane due to the spacecraft not having its ownangular velocity (and thus, angular momentum) pointing in a separate direction from the angular momentum obtainedby orbiting the Earth. Angular momentum h is defined as:

h = r × v (1)

Therefore, as the radius of the orbit increases, the velocity of the spacecraft decreases. This maintains the constantmagnitude and direction of the angular velocity over time.

1

Page 3: Lab#1-STKandOrbitAnalysis...University of Colorado - Boulder ASEN 3200 - Group 30 - 33A Orbital Mechanics 4/5/2019 Lab#1-STKandOrbitAnalysis Author: JarrodPusemana Author: KarimKrartib

The eccentricity vector is defined as:

e =v × hµ−

rr

(2)

Because the angular momentum remains constant, and v is inversely proportional to r , this value also remains constantin both magnitude and direction with time.

A defining parameter between the eccentricity and angular momentum is that the two vectors must be perpendicularto each other, i.e.:

e · h = 0 (3)

This is due to the cosine of the angle between the two vectors always being 0, corresponding to 90. Two 3-dimensionalview of these vectors are shown in Figures 1 and 2.

Fig. 1 One view of the Eccentricity and Angular Momentum Vectors

Fig. 2 Top view of the Eccentricity and Angular Momentum Vectors

B. Question 2This simulation was run under the assumption of a two-body point mass model of the earth. The two significant

perturbations acting during this model are the gravitational forces due to the Earth and Moon. During most of this

2

Page 4: Lab#1-STKandOrbitAnalysis...University of Colorado - Boulder ASEN 3200 - Group 30 - 33A Orbital Mechanics 4/5/2019 Lab#1-STKandOrbitAnalysis Author: JarrodPusemana Author: KarimKrartib

spacecraft’s orbit, the force of gravity from the Earth is much larger than the force of gravity from the Moon, andtherefore keeps it trajectory mainly undisturbed. For the small portion of the orbit where the spacecraft is near its apogeeand the moon is nearby, a disturbance to the orbit may be observed.

The Sun is not considered in this analysis because of its radius vector from the sun to the spacecraft being so large.As described from Newton’s law of gravitation,

Fg = Gm1m2

r2 (4)

Therefore, as the radius between the two objects increase, the force due to gravity decreases. Because of thisfundamental law, it can be assumed that even though the mass of the sun is astronomically larger than the mass of theEarth/Moon, its distance from the spacecraft causes the relative force to be negligible.

C. Question 3The orbit of the spacecraft does not intersect with the orbit of the Moon. As shown from a 2-D view in figure 3.a, the

radii of the two orbits as seen from an overhead view do appear to intersect, but due to the inclinations of the two orbitsbeing different, the orbits do not actually intersect. The differences in inclinations between the two orbits is shown inFigure 3. In the second image of this orbit, it is clear that the satellite orbit is entirely “within" the orbit of the moon. Ifthe orbit paths every intersected, that point would have to be coincident on both paths no matter the viewing direction,and thus since a view is found with no intersection, then the two orbit paths do not intersect.

Fig. 3 Moon and Spacecraft Orbits

D. Question 4Question 4 of the first part of this lab had us perform a numerical integration of the same orbit in MATLAB. This

was done by solving for the radius to periapsis as well as the velocity at periapsis. With these two quantities, we canfully define the initial conditions of the spacecraft in the perifocal frame. The MATLAB numerical integrator functionode45 was used to numerically integrate the position and velocity of the spacecraft in this orbit.

The parameters used at the beginning of the script were given in the problem statement of the lab document, withthe exception of the radius of the earth, which was taken from Appendix A of the course textbook and the gravitationalparameter, taken from STK. The equations used to compute the initial equations are all taken from the notes in class foran elliptical orbit (we are still assuming the satellite and Earth form a 2-body problem.)

1 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%2 % ASEN 3200 : O r b i t Lab 13 %4 % Dr . Bosonac5 % 3 / 15 / 1 96 % S t a t i o n 33A

3

Page 5: Lab#1-STKandOrbitAnalysis...University of Colorado - Boulder ASEN 3200 - Group 30 - 33A Orbital Mechanics 4/5/2019 Lab#1-STKandOrbitAnalysis Author: JarrodPusemana Author: KarimKrartib

7 %8 % Crea t e d : 3 / 15 / 20199 % Modi f i ed : 3 / 15 / 201910 %11 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%1213 %Clean Up14 c l e a r ; c l c ; c l o s e a l l ;1516 %% Set Up17 g l o b a l mu18 r e = 6378 ; %[km]19 a = 37 .9735∗ r e ; %[km]20 e = . 5 8 7 ;21 mu = 398600 .4418 ; %G r a v i t a t i o n a l Pa r ame t e r [km^3 / s ^2 ]2223 %% Compute I n i t i a l Condi t ions and Orbit Parameters24 T = 2∗ p i ∗ s q r t ( a ^3 /mu) ;25 rp = a∗(1− e ) ; %I n i t i a l P o s i t i o n26 h = [0 0 s q r t (mu∗a∗(1− e ^2 ) ) ] ; %Eq 2 .7127 vp = h ( 3 ) / rp ; %I n i t i a l speed28 % Let ' s use t h e P e r i f o c a l Frame29 %S t a t e Vec to r = [ p q w pdo t qdo t wdot ] ;30 % We can r educe t h i s t o a fou r −e l emen t s t a t e v e c t o r s i n c e we a r e i n t h e31 % p e r i f o c a l f rame32 % s t a t e = [ p q pdo t qdo t ]33 r0 = [ rp 0 0 ] ;34 v0 = [0 vp 0 ] ;35 i n i s h c o n d i s h = [ r0 v0 ] ; %S t a r t a t p e r i a p s i s36 t s p a n = l i n s p a c e ( 0 ,T+160 ,100000) ;37 [ t , s o l ] = ode45 ( ' Lab1 ' , t s pan , i n i s h c o n d i s h ) ;3839 e = c r o s s ( v0 , h ) /mu− r0 / norm ( r0 ) ;4041 %% Plo t a l l the S t u f f4243 p l o t ( s o l ( : , 1 ) , s o l ( : , 2 ) )44 xl im ([ −4 e5 , 2 e5 ] )45 yl im ([ −3 e5 , 3 e5 ] )46 a x i s s qu a r e47 t i t l e ( ' T r a j e c t o r y o f t h e S p a c e c r a f t i n t h e P e r i f o c a l Frame ' )48 ho ld on49 g r i d on50 ar row ( [ 0 0 ] , [ rp 0 ] )51 ar row ( [ 0 0 ] , [ 0 h ( 3 ) ^2 /mu ] )52 t e x t ( rp −20000 ,20000 , ' \ t e x t b f \ ^ p ' , ' i n t e r p r e t e r ' , ' l a t e x ' )53 t e x t (10000 , h ( 3 ) ^2 /mu+10000 , ' \ t e x t b f \ ^ q ' , ' i n t e r p r e t e r ' , ' l a t e x ' )54 p l o t ( rp , 0 , ' k . ' , ' marke rS i z e ' , 1 0 )55 t e x t ( rp +10000 ,0 , ' P e r i a p s i s ' , ' ( I n i t i a l Loc a t i o n ) ' , ' i n t e r p r e t e r ' , ' l a t e x ' )56 p l o t ( 0 , 0 , ' b . ' , ' marke rS i z e ' , 2 0 )57 t e x t (−40000 ,−10000 , ' Ea r t h ' , ' c o l o r ' , ' b ' )58 ar row ( [ 0 0 ] , e ( 1 : 2 ) ∗100000 , ' c o l o r ' , ' r ' )59 t e x t ( e ( 1 ) ∗30000 , −30000 , ' E c c e n t r i c i t y Vec to r ' , ' c o l o r ' , ' r ' )60 x l a b e l ( ' \ t e x t b f \ ^ p D i r e c t i o n [km] ' , ' i n t e r p r e t e r ' , ' l a t e x ' )

4

Page 6: Lab#1-STKandOrbitAnalysis...University of Colorado - Boulder ASEN 3200 - Group 30 - 33A Orbital Mechanics 4/5/2019 Lab#1-STKandOrbitAnalysis Author: JarrodPusemana Author: KarimKrartib

61 y l a b e l ( ' \ t e x t b f \ ^ q D i r e c t i o n [km] ' , ' i n t e r p r e t e r ' , ' l a t e x ' )62 l egend ( ' Orb i t T r a j e c t o r y ' , ' l o c a t i o n ' , ' s ou t hwe s t ' )63 s e t ( gcf , ' P o s i t i o n ' , [ 100 , 100 , 1100 , 700 ] )64 p r i n t ( ' orbitPathMATLAB ' , '−dpng ' )6566 %% Another P lo t : |H| and | e |67 l e n = l e n g t h ( s o l ) ;68 H = c r o s s ( s o l ( : , 1 : 3 ) , s o l ( : , 4 : 6 ) ) ;69 r = s q r t ( s o l ( : , 1 ) . ^ 2 + s o l ( : , 2 ) . ^ 2 + s o l ( : , 3 ) . ^ 2 ) ;70 e = c r o s s ( s o l ( : , 4 : 6 ) ,H) . / mu− s o l ( : , 1 : 3 ) . / [ r r r ] ;71 magH = s q r t (H( : , 1 ) . ^ 2 + H( : , 2 ) . ^ 2 + H( : , 3 ) . ^ 2 ) ;72 mage = s q r t ( e ( : , 1 ) . ^ 2 + e ( : , 2 ) . ^ 2 + e ( : , 3 ) . ^ 2 ) ;73 t ime = t . / 3 6 0 0 . / 2 4 ; %days7475 f i g u r e76 ho ld on77 g r i d on78 yyax i s l e f t79 p l o t ( t ime ,magH) ;80 yl im ( [240000 263350 ] )81 y l a b e l ( ' Angula r Momentum [km^2 / s ] ' )82 yy ax i s r i g h t83 p l o t ( t ime , mage )84 yl im ( [ 0 1 ] )85 y l a b e l ( ' E c c e n t r i c i t y ' )86 t i t l e ( ' Magni tudes o f Angula r Momentum and E c c e n t r i c i t y ' , ' wi th Time ' )87 x l a b e l ( ' Time [ days ] ' )88 l egend ( ' Angula r Momentum ' , ' E c c e n t r i c i t y ' , ' l o c a t i o n ' , ' no r t hwe s t ' )89 s e t ( gcf , ' P o s i t i o n ' , [ 100 , 100 , 1100 , 700 ] )90 p r i n t ( 'magHande ' , '−dpng ' )

Please note that the small function containing the differential equations that are integrated is not included here but inthe appendix of this report.

A plot of the orbit predicted by the numerical integration is shown in Figure 4. The orbit shape is very similar tothat predicted by STK. This makes sense: both models are modeling the same orbit and should be pretty close. Notethat the p and q perifocal directions are marked on this plot as well as the Earth, initial location of the spacecraft, and theeccentricity vector direction.

5

Page 7: Lab#1-STKandOrbitAnalysis...University of Colorado - Boulder ASEN 3200 - Group 30 - 33A Orbital Mechanics 4/5/2019 Lab#1-STKandOrbitAnalysis Author: JarrodPusemana Author: KarimKrartib

Fig. 4 Orbital Path as Predicted via Numerical Integration

To create this numerical integration model, the given eccentricity and semi-major axis are used as starting points.Some other constants were also used, namely: the mean radius of the earth (6378 km, from the textbook for the course[2] and µ the gravitational parameter (3.986×105 km3

s2 ). This value for the gravitational parameter was used since it isthe product of the gravitational constant G and the mass of the Earth. The mass of the satellite is not included because itis so small compared to the mass of the Earth that it would have no appreciable effect on the value for µ even if it wereconsidered.

These values allowed the calculation of the radius of periapsis from the equation rp = a · (1 − e) km. Next theangular momentum vector is formed. In the perifocal frame, it will lie solely in the w axis, with magnitude given byh =

√µ · a · (1 − e2) km2/s. This allowed the calculation of the speed of the satellite at periapsis then: vp = h

rpkm/s

since the velocity of the craft and the position vectors are perpendicular at periapsis. These then fully give the initialconditions of the spacecraft that can be integrated: ®r = [rp 0 0] km and ®v = [0 vp 0] km/s in the perifocal frame.

These values were integrated using ode45 in MATLAB, so the derivatives of each value are calculated in a separatefunction we defined. This integrator was used since it has many advanced built-in integrating techniques. For example,it will change the time step of an integration if any of the values are beginning to grow too quickly. It also uses anon-first order integration technique: the Runge-Kutta method, which is more accurate than the Euler method whichwould be tempting to use if we coded the integrator by hand due to its simplicity. The derivatives of the positions arenaturally the velocities in the same direction. The derivatives of the velocities is the acceleration components. These arefound be dividing the gravitational attraction force between the earth and satellite by the mass of the satellite. Note, thisfollows Newton’s second law and assumes that the spacecraft does not change mass at all and that both the earth andspacecraft can be treated as point masses. This is reasonable since the bodies are very far away and any effects of anon-uniform gravitational field will be negligible. These conditions were integrated for the period of the orbit, given byT = 2π

√a3

µ s. The solutions are then plotted and the extra requested markers inserted. Note, the eccentricity vector was

calculated using the equation from class: ®e = ®v×®hµ −®rr .

Another plot was then created to show the magnitude of the angular momentum and the eccentricity of the orbit overthe course of the flight. This is shown in Figure 5. The angular momentum is plotted against the left axis of the plot,and the magnitude of the eccentricity of the orbit on the right. For every time step in the orbit, the angular momentumvector is computed ®h = ®v × ®r . The eccentricity vector is calculated the same as above. The magnitudes of these vectors

6

Page 8: Lab#1-STKandOrbitAnalysis...University of Colorado - Boulder ASEN 3200 - Group 30 - 33A Orbital Mechanics 4/5/2019 Lab#1-STKandOrbitAnalysis Author: JarrodPusemana Author: KarimKrartib

are plotted in Figure 5:

Fig. 5 Magnitude of ®h and ®e As a Function of Time

Upon first glance, these plots are very startling. It appears that both the angular momentum and the eccentricity varyquite a lot over the course of the orbit. However, the analytic solutions to the 2-Body problem state that both of thesequantities are constant over an orbit. Moreover, STK confirmed this when these vectors were monitored for one period.Even more alarming is the fact that neither value seems to move back toward the value it starts at even as the spacecraftapproaches the starting point of the orbit.

To get a better idea of what is happening, the magnitudes are also plotted in Figure 6, but this time with a largerlimit set on the y-axis giving more perspective to the problem. In this plot, we can see that on the range of 0 to 1, theeccentricity hardly changes at all. Similarly, the angular momentum is much more stable. This aligns slightly betterwith what we expect from this orbit.

7

Page 9: Lab#1-STKandOrbitAnalysis...University of Colorado - Boulder ASEN 3200 - Group 30 - 33A Orbital Mechanics 4/5/2019 Lab#1-STKandOrbitAnalysis Author: JarrodPusemana Author: KarimKrartib

Fig. 6 Magnitude of ®h and ®e As a Function of Time, with a Better y-Scale

Considering all this, the alarm at first can be attributed to the approximation techniques employed in the numericalintegration. Since discrete steps are used and the position and velocity predicted based off derivatives and a previouscondition, the values will not be exact. In fact, this was confirmed by zooming into the periapsis of the orbit prediction,and the path actually does not overlap it’s starting position like we know it should. This is a result of error compoundingin the calculation. Additionally, we expect more error when values are changing faster. This is near the periapsis of theorbit. This is exactly where the eccentricity and angular momentum magnitudes appear to fluctuate the most - rightat the beginning and end of the integration period. In the middle of the flight where the spacecraft is moving slower,the eccentricity and angular momentum magnitudes are more stable, so the surprising appearance of the eccentricityand angular momentum varying can most likely be attributed to the approximate nature of the numerical integrationtechnique.

III. Part II of the LabPart II of the experiment studied the motion a spacecraft around the moon. As before, the date of the flight is set to

January 1, 2020 at 00:00:00.000 UTCG to start. It was important to set the central body of the STK analysis to be themoon for this section of the report. The initial conditions as given in the lab document are:

1) Coordinate System: Moon Inertial2) Coordinate Type: Keplerian3) Element Type: Osculating4) Orbit Epoch: 1 Jan 2020 00:00:00.000 UTCG5) Orbit Period: 6.3 hours.6) Radius at Periapsis: rp = 1840 km7) Right Ascension of the Ascending Node: Ω = 08) Argument of Periapsis: ω = 09) Initial Distance: r = 2400km

These parameters set a spacecraft into an elliptical orbit around the moon.

8

Page 10: Lab#1-STKandOrbitAnalysis...University of Colorado - Boulder ASEN 3200 - Group 30 - 33A Orbital Mechanics 4/5/2019 Lab#1-STKandOrbitAnalysis Author: JarrodPusemana Author: KarimKrartib

A. Question 5Before the orbit could be modelled in STK, however, some other initial orbit conditions, namely the semimajor axis,

eccentricity, and true anomaly of the craft had to be computed. This was done as follows from the equations in class fora 2-body elliptical orbit. Note that the gravitational parameter for the moon is taken from STK since the spacecraft isassumed substantially small compared to the mass of the moon.

µ = 4902.8km3

s2

T = 6.3 hr = 22680 s

a =

√(T2π

)2µ3 = 3997.5 km

With the semimajor axis computed, we can use the radius of periapsis rp to get the radius of apoapsis ra, which allowsfor the calculation of the eccentricity.

rp = 1840 kmra = 2 · a − rp = 6155 km

e =ra − rpra + rp

= .5397

Finally, the given initial radius of position can be related to the true anomaly of the orbit using the orbit parameter p asfollows:

p = rp(1 + e) km

θ∗ = cos−1( pr − 1

/e)= 70.47

We double check the sign of the true anomaly - positive since the craft is given to be moving away from the periapsis.

B. Question 6With these calculated orbit parameters, the orbit was entered into STK and modeled in flight around the moon. A

vector indicating the moon north pole was also added to the orbit display, resulting in the image of Figure 7.

9

Page 11: Lab#1-STKandOrbitAnalysis...University of Colorado - Boulder ASEN 3200 - Group 30 - 33A Orbital Mechanics 4/5/2019 Lab#1-STKandOrbitAnalysis Author: JarrodPusemana Author: KarimKrartib

Fig. 7 Orbit Around the Moon, with Moon North Pole

C. Question 7A snapshot of this orbit taken in the perifocal frame is shown in Figure 8. This frame is useful for observing the

motion of the satellite and the basis of many equations used to describe the orbit.

Fig. 8 Orbit Around the Moon, Useful Perspective: Perifocal Frame

D. Question 8Next we are given some specifications on an instrument that the satellite is flying around the moon. This instrument

can only take measurements from altitudes between 200 and 500 km. The time from the initial location to the first

10

Page 12: Lab#1-STKandOrbitAnalysis...University of Colorado - Boulder ASEN 3200 - Group 30 - 33A Orbital Mechanics 4/5/2019 Lab#1-STKandOrbitAnalysis Author: JarrodPusemana Author: KarimKrartib

instant that the equipment can be used is calculated from Kepler’s Equation. Note that the radius of the moon is alsotaken from Appendix A from Curtis. As is convention in the course, E is the eccentric anomaly of the orbit, M isthe mean anomaly, and n is the mean orbit angular velocity. Note that the eccentric anomaly E is found from there-arrangement of the equation for the position as a function of E: r = a(1 − e cos E).

rmoon = 1737 kmrstart = rmoon + 500 = 2237 km

Einitial = cos−1(

1 − ra/e

)= .7371 rad

Estart = cos−1(

1 − rstarta

/e)= .6164 rad

n =√

µ

a3 = 2.7703 · 10−4 rads

Minitial = Einitial − e · sin Einitial = .3743 radMstart = 2π − Estart + e · sin Estart = 5.9788 rad← other side of orbit

(tinitial − tp) =Minitial

n= 1351.14 s

(tstart − tp) =Mstart

n= 21581.4 s

twait = (tstart − tp) − (tinitial − tp) = 21581.4 − 1351.14 = 20230.2 stwait = 5.6195 hr

This answer makes sense: the craft is just leaving the operational window and is headed toward apoapsis. It will not beable to observe the moon until it makes it back all the way until the other side of the moon as it approaches periapsisagain. Thus it will need to wait for a majority of the period of 6.3 hours.

E. Question 9This the eccentric anomaly of the starting and terminating locations of the observation window allow for the

calculation of the true anomaly of the same locations. Additionally, Kepler’s equation allows for the calculation of thetime spent in the observation window. We reuse the eccentric and mean anomaly for the start of the window from theprevious question. Additionally, the mean orbit angular velocity is the same across these questions.

The orbit window in minutes is calculated as follows:

rend = rmoon + 200 = 1937 km

Eend = cos−1(

1 − renda/e

)= .3010 rad

Mend = 2π − Eend + e · sin Eend = 6.1422 rad← other side of orbit

(tend − tp) =Mend

n= 22171.1 s

twindow = tend − tstart = 9.83 min

Finding the true anomaly locations for the edges of the window can be done by re-arranging the conic equation and

11

Page 13: Lab#1-STKandOrbitAnalysis...University of Colorado - Boulder ASEN 3200 - Group 30 - 33A Orbital Mechanics 4/5/2019 Lab#1-STKandOrbitAnalysis Author: JarrodPusemana Author: KarimKrartib

plugging in the corresponding starting and ending radii calculated earlier.

r =p

1 + e cos θ∗r + r · e cos θ∗ = p

r + r · e cos θ∗ = a(1 − e2)

r · e cos θ∗ = a(1 − e2) − r

cos θ∗ =a(1 − e2) − r

r · e

θ∗ = cos−1(

a(1 − e2) − rr · e

)θ∗start = −60.4154

θ∗end = −31.0033

These signs for the true anomaly make sense. We know from earlier that the first observation window will occur afteralmost a whole orbit as the spacecraft approaches periapsis. Thus the signs of the true anomaly for these bounds shouldbe negative and relatively close to 0.

By starting the spacecraft at the true anomaly of −60.4154 and running the simulation for the window observationperiod 9.83 min, STK gives a prediction of the orbit trajectory while the spacecraft is inside one instance of theobservation window. Specifically, this is the window as the craft approaches periapsis, and there is a symmetric windowon the other side of periapsis as the spacecraft ascends in altitude moving away from periapsis. This trajectory is plottedin Figure 9.

Fig. 9 Trajectory of the Spacecraft during the Observation Window

F. Question 10The ground track of the satellite during this window was studied next. The modelling software STK plots the ground

path of the satellite on the surface of the moon. This is shown in Figure 10.

12

Page 14: Lab#1-STKandOrbitAnalysis...University of Colorado - Boulder ASEN 3200 - Group 30 - 33A Orbital Mechanics 4/5/2019 Lab#1-STKandOrbitAnalysis Author: JarrodPusemana Author: KarimKrartib

Fig. 10 Ground Path on the Surface of the Moon

By looking at a closer view of the path like in Figure 11, the latitudinal and longitudinal coordinates are found to bea path moving up the moon at -170 longitude from -60 latitude to -30 latitude. This makes sense since the orbitis a polar orbit and the argument of periapsis is at 0. This will make the true anomaly of the orbit directly translateto latitude of the moon (for anomalies between -90 and 90, else they are reflected down to something between thesevalues). These latitude limits are almost identical to the true anomalies of the observation window limits.

By comparing this ground track’s coordinates (Figure 10) to a map of the moon (provided in the lab description),the satellite passes fairly close to Bose and Oppenheimmer Craters on the surface of the moon.

Fig. 11 Ground Path on the Surface of the Moon, Closer Look

G. Question 11Next, a script to solve Kepler’s equation iteratively was written. The way that this code solve for eccentric anomaly

E is using Newton’s Method as discussed in class. Essentially, some number of iterations is done creating better andbetter guesses for E . Specifically, the equation for each next guess for E is given in terms of the previous guess and afunction g, g = E − e sin(E) − M which is just Kepler’s equation solved for 0.

Ei+1 = Ei +g(E)dgdt

This code is included here:

1 f u n c t i o n [E , E2 ] = NewtonsMethod (M, e , num)2 % NewtonsMethod pe r f o rms t h e Newton ' s Method s o l u t i o n f o r f i n d i n g r o o t s o f

13

Page 15: Lab#1-STKandOrbitAnalysis...University of Colorado - Boulder ASEN 3200 - Group 30 - 33A Orbital Mechanics 4/5/2019 Lab#1-STKandOrbitAnalysis Author: JarrodPusemana Author: KarimKrartib

3 % an e q u a t i o n t o f i n d t h e e c c e n t r i c anomaly o f an e l l i p t i c a l o r b i t g i ven4 % some mean anomaly M and e c c e n t r i c i t y e .5 %6 % Format o f c a l l : NewtonsMethod (M, e , num) −> num i s t h e number o f i t e r a t i o n s7 % d e s i r e d t o use on t h e method .8 % Re t u r n s [E , E2 ] E i s t h e e c c e n t r i c anomaly9 % E2 i s t h e e c c e n t r i c anomaly c a l c u l a t e d by u s i ng b u i l t − i n10 % s o l v e r s i n MATLAB f o r compar i son .1112 % J a r r o d Puseman13 % ID : 10400325214 % Dr . Bosanac15 % ASEN 320016 % Crea t e d 3 / 2 1 / 1 917 % Modi f i ed 3 / 2 1 / 1 918 %19 %20 E = M;21 f o r i = 1 : num22 E = E − (E − e∗ s i n (E ) − M) /(1 − e∗ cos (E ) ) ; %Newton ' s Method23 end2425 i f n a r g ou t ==2 %Compare t o MATLAB b u i l t − i n s o l v e r26 f =@(E) E−e∗ s i n (E )−M;27 E2 = f z e r o ( f ,M) ;28 end29 end

The initial guess for this function is to guess E = M . This is a decent guess since at most, M is 1 radian away fromE due to the bounds on the sine function and limits on e for an elliptical orbit. This initial guess is simple and is closeenough here to cause Netwon’s Method to converge.

Next, this function simply iterates Newton’s Method a provided number of times. Via experimentation, 10 iterationsis found to be convergent to greater than the 15th decimal place in E . That is, the first 15 decimals are the same for 10iterations and beyond for a number of test cases. This is sufficiently convergent for the models being run in this lab.

H. Question 12Considering a location 13.5 minutes past the periapsis, we can use this little function to calculate the position radius

of the craft at this time.

t − tp = 13.5 min = 810 sM = (t − tp) ∗ n = .2244 rad

E = NewtonsMethod(M, e, 10) = .4677 radr = a(1 − e ∗ cos E) = 2071.7 km

z = r − rmoon = 334.74 km

We can see that at 13.5 minutes past periapsis, the spacecraft is at an altitude of 334.7 km, which is between the operationrange 200-500 km. For sake of brevity, every iteration of Newton’s method is not shown here, but the function providedabove is used to numerically compute the root of that equation.

I. Question 13Our two body model is accurate to within a reasonable degree, though it fails to match reality in a number of ways.

The model neglects to consider the gravitational influence of other celestial bodies, most notably the Earth, that couldhave non-negligible effects on the orbit of the spacecraft over time. This deviation becomes especially noticeable at high

14

Page 16: Lab#1-STKandOrbitAnalysis...University of Colorado - Boulder ASEN 3200 - Group 30 - 33A Orbital Mechanics 4/5/2019 Lab#1-STKandOrbitAnalysis Author: JarrodPusemana Author: KarimKrartib

Fig. 12 Orbit Path for 100 Orbits of the Moon including 3rd-body Earth Gravitational Effects

orbital altitudes, where the diminishing gravitational force from the moon begins to give way to the sphere of influenceof the Earth.

Another deviation from the model is that uneven distribution of mass within the moon. No celestial body is anideal spherical mass, though it may be computationally convenient to model them as such. The moon is a notablygood spherical mass, with a very slow rotation rate leading to a small degree of oblateness around the equator. It is,however, a small, irregular body with a number of geological features that will cause local gravitational anomalies inunpredictable ways. This deviation is very hard to model without a detailed understanding of surface features, and issmall enough that most useful models can consider it negligible. Note that deviations from the ideal sphere are mostnotable on close approach. Because our spacecraft is on a highly eccentric orbit, both of the perturbations discussedhere will have effect on some point of the orbit.

J. Question 14Because our team was curious, we actually checked both of these disturbances in the STK simulation. In each case,

the orbit was allowed to propagate for 100 orbital periods. For the case of adding the Earth’s gravity as a perturbation tothe spacecraft, the orbit trajectory for 100 orbits is shown in Figure 12.

This figure shows that the earth gravity does actually have an impact on the trajectory of the satellite. Thoughdeviation does not look large in this depiction, this is the deviation for just under three Earth days’ time. For a missionspanning many months at the moon, the Earth’s gravity would significantly alter the trajectory of the orbit.

In contrast, the effects of the moon not being a perfect sphere and not being of uniform density are shown in Figure13.

Figure 13 shows that the orbit path as perturbed by the non-uniform gravitational field of the moon is altered verylittle over the course of 100 orbits. Over a longer time, this effect may cause enough alteration in the spacecraft trajectoryto warrant correction, but the corrections would be reasonable. Considering this, the perturbation from the moon beingnon-uniform in gravitational field is a small perturbation, but still not exactly zero effect.

15

Page 17: Lab#1-STKandOrbitAnalysis...University of Colorado - Boulder ASEN 3200 - Group 30 - 33A Orbital Mechanics 4/5/2019 Lab#1-STKandOrbitAnalysis Author: JarrodPusemana Author: KarimKrartib

Fig. 13 Orbit Path for 100 Orbits of the Moon, Considered a non-Perfect Sphere

IV. Conclusions and RecommendationsThis lab was valuable as a confirmation of the theoretical principles of orbital dynamics discussed in lecture. Most of

the ideas we were asked to consider or test were already well understood on a mathematical level, though the modelingsolutions were a more tangible demonstration of these principles. Our results from both the MATLAB and STKsimulations were mostly in line with these theoretical expectations.

The most valuable part of this lab was the practical experience with orbital modeling in both the pre-built STK, aswell as bottom-up development with MATLAB. These skills can be applied to any number of mission design projects.STK is an especially versatile piece of sotware, as it is not limited to simulations of celestial bodies and astrodynamics,but can be used for an incredible range of mission simulations, from suborbital missile trajectories to atmospheric droneprograms. We would be very interested in using STK to model interplanetary missions, though this would go far beyondthe two-body models explored in this lab and require a much better understanding of the software, as well as a strongergrasp on interplanetary maneuvers and transfer orbits.

V. AcknowledgementsWe first like to acknowledge the help of Sam Kersting. Sam showed us how to get the moon north pole vector to

show up in the STK simulation.Additionally, we thank Erik Johnson for creating the “arrow.m" MATLAB function to put arrows on plots. It has

been a very useful function.Finally, we would like to thank Dr. Bosanac and the T.A.’s of the course for help with miscellaneous questions and

advice throughout the completion of these lab tasks.The tasks completed by each group member are as follows:Karim Krarti - Abstract, Introduction, Conclusion, Q13Jarrod Puseman - Leftover Questions, CodeNick Zellmann - Q1, Q2, Q3, Chief Editor

16

Page 18: Lab#1-STKandOrbitAnalysis...University of Colorado - Boulder ASEN 3200 - Group 30 - 33A Orbital Mechanics 4/5/2019 Lab#1-STKandOrbitAnalysis Author: JarrodPusemana Author: KarimKrartib

References[1] Bosanac. “LABORATORY O-1". University of Colorado, Boulder. March 2019. pdf.

[2] Curtis, Howard D. Orbital Mechanics for Engineering Students. 3rd ed., Elsevier, 2014.

[3] Johnson, Erik. “arrow.m". 2016. <https://www.mathworks.com/matlabcentral/fileexchange/278-arrow>.

All images generated by STK are used with permission under the educational license of the program. Full ownershipof the images is given to Analytical Graphics, Inc.

17

Page 19: Lab#1-STKandOrbitAnalysis...University of Colorado - Boulder ASEN 3200 - Group 30 - 33A Orbital Mechanics 4/5/2019 Lab#1-STKandOrbitAnalysis Author: JarrodPusemana Author: KarimKrartib

Appendix A: Code DevelopedThis script served as the driver of the computations performed for this lab. It set up the numerical integration and

created the plots included in the report.1 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%2 % ASEN 3200 : O r b i t Lab 13 %4 % Dr . Bosanac5 % 3 / 15 / 1 96 % S t a t i o n 33A7 %8 % Crea t ed : 3 / 15 / 20199 % Modi f i ed : 3 / 22 / 201910 %11 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%1213 %Clean Up14 c l e a r ; c l c ; c l o s e a l l ;1516 %% Set Up17 g l o b a l mu18 r e = 6378 ; %[km]19 a = 37 .9735∗ r e ; %[km]20 e = . 5 8 7 ;21 mu = 398600 .4418 ; %G r a v i t a t i o n a l Pa r ame t e r [km^3 / s ^2 ]2223 %% Compute I n i t i a l Condi t ions and Orbit Parameters24 T = 2∗ p i ∗ s q r t ( a ^3 /mu) ;25 rp = a∗(1− e ) ; %I n i t i a l P o s i t i o n26 h = [0 0 s q r t (mu∗a∗(1− e ^2 ) ) ] ; %Eq 2 .7127 vp = h ( 3 ) / rp ; %I n i t i a l speed28 % Let ' s use t h e P e r i f o c a l Frame29 %S t a t e Vec to r = [ p q w pdo t qdo t wdot ] ;30 % We can r educe t h i s t o a fou r −e l emen t s t a t e v e c t o r s i n c e we a r e i n t h e31 % p e r i f o c a l f rame32 % s t a t e = [ p q pdo t qdo t ]33 r0 = [ rp 0 0 ] ;34 v0 = [0 vp 0 ] ;35 i n i s h c o n d i s h = [ r0 v0 ] ; %S t a r t a t p e r i a p s i s36 t s p a n = l i n s p a c e ( 0 ,T+160 ,100000) ;37 [ t , s o l ] = ode45 ( ' Lab1 ' , t s pan , i n i s h c o n d i s h ) ;3839 e = c r o s s ( v0 , h ) /mu− r0 / norm ( r0 ) ;4041 %% Plo t a l l the S t u f f4243 p l o t ( s o l ( : , 1 ) , s o l ( : , 2 ) )44 xl im ([ −4 e5 , 2 e5 ] )45 yl im ([ −3 e5 , 3 e5 ] )46 a x i s s qu a r e47 t i t l e ( ' T r a j e c t o r y o f t h e S p a c e c r a f t i n t h e P e r i f o c a l Frame ' )48 ho ld on49 g r i d on50 ar row ( [ 0 0 ] , [ rp 0 ] )51 ar row ( [ 0 0 ] , [ 0 h ( 3 ) ^2 /mu ] )

18

Page 20: Lab#1-STKandOrbitAnalysis...University of Colorado - Boulder ASEN 3200 - Group 30 - 33A Orbital Mechanics 4/5/2019 Lab#1-STKandOrbitAnalysis Author: JarrodPusemana Author: KarimKrartib

52 t e x t ( rp −20000 ,20000 , ' \ t e x t b f \ ^ p ' , ' i n t e r p r e t e r ' , ' l a t e x ' )53 t e x t (10000 , h ( 3 ) ^2 /mu+10000 , ' \ t e x t b f \ ^ q ' , ' i n t e r p r e t e r ' , ' l a t e x ' )54 p l o t ( rp , 0 , ' k . ' , ' marke rS i z e ' , 1 0 )55 t e x t ( rp +10000 ,0 , ' P e r i a p s i s ' , ' ( I n i t i a l Loc a t i o n ) ' , ' i n t e r p r e t e r ' , ' l a t e x ' )56 p l o t ( 0 , 0 , ' b . ' , ' marke rS i z e ' , 2 0 )57 t e x t (−40000 ,−10000 , ' Ea r t h ' , ' c o l o r ' , ' b ' )58 ar row ( [ 0 0 ] , e ( 1 : 2 ) ∗100000 , ' c o l o r ' , ' r ' )59 t e x t ( e ( 1 ) ∗30000 , −30000 , ' E c c e n t r i c i t y Vec to r ' , ' c o l o r ' , ' r ' )60 x l a b e l ( ' \ t e x t b f \ ^ p D i r e c t i o n [km] ' , ' i n t e r p r e t e r ' , ' l a t e x ' )61 y l a b e l ( ' \ t e x t b f \ ^ q D i r e c t i o n [km] ' , ' i n t e r p r e t e r ' , ' l a t e x ' )62 l egend ( ' Orb i t T r a j e c t o r y ' , ' l o c a t i o n ' , ' s ou t hwe s t ' )63 s e t ( gcf , ' P o s i t i o n ' , [ 100 , 100 , 1100 , 700 ] )64 p r i n t ( ' orbitPathMATLAB ' , '−dpng ' )6566 %% Another P lo t : |H| and | e |67 l e n = l e n g t h ( s o l ) ;68 H = c r o s s ( s o l ( : , 1 : 3 ) , s o l ( : , 4 : 6 ) ) ;69 r = s q r t ( s o l ( : , 1 ) . ^ 2 + s o l ( : , 2 ) . ^ 2 + s o l ( : , 3 ) . ^ 2 ) ;70 e = c r o s s ( s o l ( : , 4 : 6 ) ,H) . / mu− s o l ( : , 1 : 3 ) . / [ r r r ] ;71 magH = s q r t (H( : , 1 ) . ^ 2 + H( : , 2 ) . ^ 2 + H( : , 3 ) . ^ 2 ) ;72 mage = s q r t ( e ( : , 1 ) . ^ 2 + e ( : , 2 ) . ^ 2 + e ( : , 3 ) . ^ 2 ) ;73 t ime = t . / 3 6 0 0 . / 2 4 ; %days7475 f i g u r e76 ho ld on77 g r i d on78 yyax i s l e f t79 p l o t ( t ime ,magH) ;80 yl im ( [240000 263350 ] )81 y l a b e l ( ' Angula r Momentum [km^2 / s ] ' )82 yy ax i s r i g h t83 p l o t ( t ime , mage )84 yl im ( [ 0 1 ] )85 y l a b e l ( ' E c c e n t r i c i t y ' )86 t i t l e ( ' Magni tudes o f Angula r Momentum and E c c e n t r i c i t y ' , ' wi th Time ' )87 x l a b e l ( ' Time [ days ] ' )88 l egend ( ' Angula r Momentum ' , ' E c c e n t r i c i t y ' , ' l o c a t i o n ' , ' no r t hwe s t ' )89 s e t ( gcf , ' P o s i t i o n ' , [ 100 , 100 , 1100 , 700 ] )90 p r i n t ( 'magHande ' , '−dpng ' )919293 %% Day 2 s t u f f94 c l e a r ;95 %Ca l c u l a t e O r b i t P a r ame t e r s96 mu = 4902 . 8 ;97 T = 6 . 3 ; %[ h r ]98 T = T∗3600;99 a = ( ( T / 2 / p i ) ^2∗mu) ^ ( 1 / 3 ) ; %100 rp = 1840 ;101 r a = 2∗a− rp ;102 e = ( ( ra − rp ) / ( r a + rp ) ) ; %103 p = rp ∗(1+ e ) ;104 r = 2400 ;105 t h e t a S t a r = acos ( ( p / r −1) / e ) ∗180 / p i ; %

19

Page 21: Lab#1-STKandOrbitAnalysis...University of Colorado - Boulder ASEN 3200 - Group 30 - 33A Orbital Mechanics 4/5/2019 Lab#1-STKandOrbitAnalysis Author: JarrodPusemana Author: KarimKrartib

106107 %Ca l c u l a t e t h e t ime s / c must wa i t108 rmoon = 1737 ;109 z s t a r t = 500 ;110 r s t a r t = rmoon+ z s t a r t ;111 Enow = acos ((1 − r / a ) / e ) ;112 E s t a r t = acos ((1 − r s t a r t / a ) / e ) ;113 n = s q r t (mu / a ^3 ) ; %[ r ad / s ]114 Mnow = Enow−e∗ s i n (Enow ) ;115 Ms t a r t = 2∗ pi −E s t a r t + e∗ s i n ( E s t a r t ) ; %S t a r t s on o t h e r s i d e o f o r b i t116 timeNow = Mnow/ n ;117 t i m e S t a r t = Ms t a r t / n ;118 wai tTime = ( t i m e S t a r t − timeNow ) / 3 6 0 0 ;119120 %Anomaly Bounds on t h e Ob s e r v a t i o n Window121 zend = 200 ;122 rend = rmoon + zend ;123 t h e t a S t a r S t a r t = −acos ( ( a∗(1− e ^2 )− r s t a r t ) / ( e∗ r s t a r t ) ) ∗180 / p i ; %rad124 t h e t a S t a r E n d = −acos ( ( a∗(1− e ^2 )− r end ) / ( e∗ r end ) ) ∗180 / p i ; %rad125 %Use Kep l a r t o Get t h e Time between t h e s e p o i n t s126 Eend = acos ((1 − r end / a ) / e ) ;127 Mend = 2∗ pi −Eend + e∗ s i n ( Eend ) ;128 t imeEnd = Mend / n ;129 Window = ( timeEnd− t i m e S t a r t ) / 6 0 ;130131 %% Quest ion 12132 t = 1 3 . 5 ; %[ min ]133 t = t ∗60 ;134 M = t ∗n ;135 E = NewtonsMethod (M, e , 1 0 ) ;136 r = a∗(1− e∗ cos (E ) ) ;137 z = r−rmoon ;

The Lab1 function is the function for computing the derivatives of the 6 states for the motion of a single body, verysimilar to Algorithm 2.2 in the textbook[2].

1 f u n c t i o n d e r i v a t i v e s = Lab1 (~ , s t a t e )2 %Lab1 computes t h e d e r i v a t i v e s o f c e r t a i n s t a t e s f o r t h e f i r s t o r b i t s l a b .3 %Arguments : Lab1 ( ~ , [ p q w pdo t qdo t wdot ] ) i n t h e p e r i f o c a l p l a n e4 %Re tu r n s d e r i v a t i v e s56 g l o b a l mu7 p = s t a t e ( 1 ) ;8 q = s t a t e ( 2 ) ;9 w = s t a t e ( 3 ) ;10 pdo t = s t a t e ( 4 ) ;11 qdo t = s t a t e ( 5 ) ;12 wdot = s t a t e ( 6 ) ;13 r = s q r t ( p^2 + q^2 + w^2) ;14 r3 = r ^3 ;1516 d e r i v a t i v e s = [ pdo t ; qdo t ; wdot ;−mu/ r3 ∗p ;−mu/ r3 ∗q ;−mu/ r3 ∗w] ;171819 end

20

Page 22: Lab#1-STKandOrbitAnalysis...University of Colorado - Boulder ASEN 3200 - Group 30 - 33A Orbital Mechanics 4/5/2019 Lab#1-STKandOrbitAnalysis Author: JarrodPusemana Author: KarimKrartib

The function for computing Newton’s Method is included again here. For its description, see question 11 in thereport body.

1 f u n c t i o n [E , E2 ] = NewtonsMethod (M, e , num)2 % NewtonsMethod pe r f o rms t h e Newton ' s Method s o l u t i o n f o r f i n d i n g r o o t s o f3 % an e q u a t i o n t o f i n d t h e e c c e n t r i c anomaly o f an e l l i p t i c a l o r b i t g i ven4 % some mean anomaly M and e c c e n t r i c i t y e .5 %6 % Format o f c a l l : NewtonsMethod (M, e , num) −> num i s t h e number o f i t e r a t i o n s7 % d e s i r e d t o use on t h e method .8 % Re t u r n s [E , E2 ] E i s t h e e c c e n t r i c anomaly9 % E2 i s t h e e c c e n t r i c anomaly c a l c u l a t e d by u s i ng b u i l t − i n10 % s o l v e r s i n MATLAB f o r compar i son .1112 % J a r r o d Puseman13 % ID : 10400325214 % Dr . Bosanac15 % ASEN 320016 % Crea t e d 3 / 2 1 / 1 917 % Modi f i ed 3 / 2 1 / 1 918 %19 %20 E = M;21 f o r i = 1 : num22 E = E − (E − e∗ s i n (E ) − M) /(1 − e∗ cos (E ) ) ; %Newton ' s Method23 end2425 i f n a r g ou t ==2 %Compare t o MATLAB b u i l t − i n s o l v e r26 f =@(E) E−e∗ s i n (E )−M;27 E2 = f z e r o ( f ,M) ;28 end29 end

This final function we used is from the MATLAB open source sharing site. It puts arrows on plots and is created byErik A Johnson. It is used with permission. Due to it’s length, it is omitted here. It is available from

<https://www.mathworks.com/matlabcentral/fileexchange/278-arrow>.

21