24.01.2014 Views

Introduction to Flight Simulation (List 2)

Introduction to Flight Simulation (List 2)

Introduction to Flight Simulation (List 2)

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>Introduction</strong> <strong>to</strong> <strong>Flight</strong> <strong>Simulation</strong> (<strong>List</strong> 2)<br />

Due: 19 oc<strong>to</strong>ber 2010<br />

In this list, we will simulate planets and asteroids. Download the files<br />

vec<strong>to</strong>r.h andplanets.cpp and theMakefile from the homepage of the course.<br />

In the main program, the sun is set in the origin with zero speed. Its mass<br />

equals 1.9891.10 30 kg. The mass of the earth equals 5.9736.10 24 kg. Its initial<br />

distance is set at 152098232km from the sun, and its initial speed is set at 29.78<br />

km/s.<br />

1. The gravitational force between two objects with masses m 1 , m 2 , and distance<br />

r is given by the following formula:<br />

F = G m 1m 2<br />

r 2 .<br />

In this formula, G is a constant, the gravity constant. The formula defines<br />

only the strength of the gravitational force, not its direction. The direction<br />

is defined as follows: Both of the masses feel the force F. The first mass<br />

m 1 feels the force in the direction of m 2 . The second mass m 2 feels the<br />

force in the direction of m 1 .<br />

Complete the function computegravity( ) that adds the gravity force<br />

between two objects <strong>to</strong> the <strong>to</strong>tal forces working on the objects.<br />

2. Comlete function method integrate( double h ) of struct object .<br />

At this moment, I do not know how <strong>to</strong> integrate with a good convergence<br />

order. Just write a primitive algorithm.<br />

3. Complete the program, so that it can simulate the orbit of the earth<br />

around the sun. The time <strong>to</strong> complete one orbit should be approximately<br />

one year.<br />

4. Add the moon <strong>to</strong> the system. The mass, speed and distance between the<br />

moon and the earth can be found at Wikipedia.<br />

5. Look up at Wikipedia what is a horseshoe orbit. Add an asteroid <strong>to</strong> the<br />

solar system, that is in a horse shoe orbit. Take a weight of 1000kg for<br />

the asteroid.<br />

1


6. Look up at Wikipedia what are the Lagrangian points. Since it appears<br />

that the points L 4 and L 5 are stable, it must be possible <strong>to</strong> put an asteroid<br />

in these points. Add an asteroid <strong>to</strong> the solar system that stays close <strong>to</strong><br />

either L 4 or L 5 .<br />

2

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!