# Intro to STK with Hubble

This homework will help you get started in simple Astronautics calculations using the Systems Tool Kit and Python. We will use the Hubble Space Telescope as our orbiting body around the Earth.

The Hubble is one of the largest man-made space telescopes. It's been orbiting the earth since 1990. To read more about it go to: http://en.wikipedia.org/wiki/Hubble_Space_Telescope

The homework will help you calculate some interesting orbital properties of the HST like its orbital velocity and period. One of the main goals of this homework is to get you started with some tools that can help you through the class. The first thing to do is use a simple calculator and go trough the astronautics equations that you learned in class and get the relevant numbers. Then verify your numbers using STK and Python.

The objective of this homework is to compute the orbital velocity and period of the HST (make sure you use the right units):
1) Find the orbital velocity (at nu = 90deg)
2) Find the orbiting period

The orbit period is given in seconds. Convert to minutes and hours to get a better feeling of it how long it takes for the HST to orbit the Earth once.

# Systems Tool Kit (STK)

Note: STK only works on Windows
1. Go to the AGI website and get registered to download the Free version of STK: http://www.agi.com/products/stk/modules/default.aspx/id/stk-free

2. Follow the instructions to install STK

3. Open STK. Create a new scenario, give it a name and use the defaults start and stop dates

4. Insert an STK object: satellite: From standard object database

5. Search for the Hubble Space Telescope. Select the result and click insert. You should be connected to the internet to allow the software to download the right database for the HST. Then close all the insert windows untill you're left with just the main STK views. At this point you should see a 3D window and a 2D window showing the orbit of the HST

6. Click the blue 'start' button on the control toolbar to see the satellite move. Then click pause.

7. Now click the yellow 'Real-time animation mode' button and then the 'play' button again. Now you are seing the actual position of the satellite at this exact moment.

8. Now right click on the satellite icon on the Object browser on the left and select 'Report & Graph Manager'. This will bring up a list of different types of reports you can get about the satellite. Explore the list of installed styles.

9. Ok, now let's double click on the 'Classic Orbit Elements' report (not the graph). This will bring up a new window with different columns: Time, Semi-major Axis, etc.

10. Now let's create a new custom report: click on the 3rd icon in the styles toolbar. Give it a name like 'me419'

11. Select 'Classical Elements' -> 'J2000' then double click on
1. Time
2. Apogee Altitude
3. Perigee Altitude
6. Semi-major axis
7. Eccentricity
8. Period

12. Select 'Cartesian velocity' -> 'J2000' and double click on speed.

13. Save this report.

14. Do the math with the given equations to confirm these results (for your own sake). Done!

# Python

2. Open the editor and create a new file.

3. Read the following mini tutorial and try some commands in the prompt.

4. Type in the necessary equations and check the results with print statements. Don't forget to hit run (ctr + R or Cmd + R).

5. Save the python script you just made. done!

## Extra help to get started with python and numpy.

First of all python is free! Then, I think of python as a super cool programming language that is also a super calculator. It allows you to do higher level math calculations but it can also help find cheaper airplane tickets in the Internet (ask me if you're interested). Here is a short tutorial to get you started with python after you have installed canopy.

variables in python
you can basically use any typical variable name in python such as 'perigee' or 'radius_earth'. Try to give descriptive variable names so your code is easily readable by others.

assign numerical values to variables
it's as easy as you'd expect
perigee = 418.0

important note: in python 2.7 an integer number (such as '18') is treated differently than a floating number (such as '18.0'). To do math with floating numbers in python 2.7 you can't have integers in the mix. So that's why I usually initialize my integer variables with a '.0' at the end so I won't get strange results. You should try to see what I mean.

math calculations in python
To do math in python is also very simple and as expected
Examples:
R = a*(1-e**2)/(1+e*cos(nu))

important note: in python the exponent operator is '**' instead of '^' as in other programming languages. Here is a short list of the operators you  can use in python:
http://www.tutorialspoint.com/python/python_basic_operators.htm