# Project 8: From the Earth to the Moon, part III

Monday, May 8, at noon
The finished code and analysis

Your job in this project: as before, follow the motion of a projectile as it travels vertically up away from a cannon. This time, you must follow the projectile all the way to the Moon. For extra credit, you can include (in a simplified manner) the effect of the Moon's gravity on the projectile.

The situation is similar to that of the previous week: a gigantic cannon shoots a projectile vertically at high speed. The initial conditions are

• a starting height of H = 0 meters above the ground
• a starting speed of V meters per second
• projectile mass M = 10 metric tons
• a very streamlined projectile with maximum radius R = 2 meters

Note that the engineers, after running several tests, realized that a spherical projectile would suffer from very great air resistance; therefore, they have made the projectile into a pointy, streamlined shape which has much, much lower air resistance.

You must include the following effects:

• air resistance, according to the following rule:
```                                                    2
F(air)  =  C * (density) * (area) * (speed)

where

F(air)          is the force of air resistance (Newtons)

C               is the drag coeff, C = 0.02 for a very
cleverly streamlined, pointy projectile

density         is the density of the air at current altitude

area            is the maximum cross-section area of the projectile

speed           is the ball's current speed (meters/sec)
```
• the changing gravitational force due to the Earth's gravity

See the previous assignment, From the Earth to the Moon II, for a formula giving the density of the atmosphere as a function of height.

Write a Scilab routine which calculates position and velocity as a function of time for this problem. It should look like this:

```  function moonshot(start_velocity, timestep, output_file)

where

start_velocity          is the starting velocity, in meters per second

timestep                is the size of the INITIAL timestep (t1 - t0)
to use in calculations, in seconds

output_file             is the name of a file in which you will
write values of time, height, and speed

```

You should use Heun's method for this assignment.

As a check on the performance of your simulation, you can use the total mechanical energy of the projectile:

```  total energy  =  KE  +  GPE
```

Now, this energy will NOT be conserved at first, because air resistance will dissipate much of the initial kinetic energy. However, once the projectile has reached a large enough altitude, air resistance becomes negligible; from that point on, total energy SHOULD be conserved. Pick as your starting point a height above the surface of H = 100,000 m. You can compare the total energy at this point to the total energy at any later point to estimate the accuracy of your calculations.

You may use a fixed timestep, given by the user, for the entire flight; however, you will receive a small deduction to your score for doing so. To receive full credit, you must use an adaptive timestep, as described in this week's lecture notes.

You may assume that the Moon has the following properties:

• center of Moon 384,000 km from center of Earth
• radius of Moon 1738 km (I originally listed it as 3476 km, which is the diameter -- argh!)
• mass of Moon 7.35 x 10^(22) kg

• Use an initial velocity of 15,000 m/s. Once the projectile leaves the atmosphere, make sure its total energy doesn't change by more than 1 percent. How long does it take the projectile to reach the Moon's distance?
• What was the fractional change in total energy between the fiducial height of 100,000 m and the end of your simulation?
• Were you using fixed timesteps or adaptive timesteps? If adaptive timesteps, write neatly the rules you used to increasing or decreasing the timestep. How large was the timestep when the projectile reached the Moon's distance?
• How long, in real time, did it take your computer to simulate this flight?
• In Verne's story, astronomers at Harvard University compute the total time for a trip to the Moon to be 97 hours, 13 minutes and 20 seconds. What is the minimum initial velocity required to send your projectile to the Moon in this time? Describe in full sentences the method you used to find this value? (Hint: trial and error plus a little interpolation)

#### Bells and Whistles

1. Verne's adventurers don't want to smash into the lunar surface, of course. They plan to use rockets to slow their descent. Assume that the mass of the rocket fuel is m, and the mass of the rest of the projectile is 10,000 kg - m. The exhaust speed of gunpowder rockets is roughly 1,000 m/s.

Pick one of your simulations in which the projectile reached the Moon. Write down its velocity when it reached the lunar surface. In order to bring the projectile to a stop right at the surface, with zero speed, how much mass m must be devoted to rockets?

(Hint: it may help to read some notes on rockets and momentum, especially the section on "the final speed of a rocket")

2. Pick one initial velocity which will cause your projectile to reach the Moon. Write down the initial velocity, time to reach the lunar surface, and final speed when it reaches the lunar surface.

Now, add the gravitational effect of the Moon. Pretend that the Moon is stationary. Add to your simulation the Moon's gravitational force on the projectile, during the entire trip.

Using the same initial velocity as before, run the simulation until the projectile reaches the Moon's surface. How much does the Moon's gravity change your values for the time for the journey and the final speed when the projectile reaches the surface?