Game Development Reference
In-Depth Information
A Rocket Simulator
Let's use what we have learned about modeling the physics of rockets to write a rocket simu-
lator. The user gets to build her own rocket by selecting an engine type, number of engines, and
payload mass. When the rocket is launched, it flies until its propellant is used up. The simulator
will include the effects of aerodynamic drag and gravitational acceleration and thrust variations
due to altitude.
A typical screen shot for the Rocket Simulator is shown in Figure 11-7. At the top of the GUI
is a display area that shows a rocket cartoon moving along the computed trajectory of the rocket. In
the bottom left-hand corner are combo box and text field components that display the charac-
teristics of the rocket. The user selects the engine type, number of engines, and payload mass.
Based on these inputs, the simulator computes the sea-level thrust, vacuum thrust, and initial
mass of the rocket. A Launch button is provided to launch the rocket. The Reset button resets
the display and brings the rocket back to the launch pad.
In the bottom right-hand corner of the GUI are text fields that display information about
the rocket trajectory. The rocket burn time shows the elapsed time since the rocket launch. The
simulation runs up until the burn time for the particular engine that was selected. The simula-
tion is set up such that the pitch angle of the rocket decreases from 90 degrees to 10 degrees
over the course of the flight. Because the rocket is pitching over, it will travel in the x-direction.
The distance traveled in the x-direction is shown in the Cross range text field. The Rocket mass
text field shows the current mass of the rocket. As propellant is expended, the mass of the
rocket will decrease.
The Rocket Simulator allows the user to choose between two different engines. The F-1
rocket engine is a LOX-RP1 (kerosene) motor that was used on the Saturn V rocket that took
men to the moon. The second engine choice is the RD-180, which is a more recent LOX-RP1
rocket engine that is used to power the Atlas 5 rocket. Specifications for the two rocket engines
are shown in Table 11-3. 3, 4, 5, 6
Table 11-3. Rocket Specifications for the F-1 and RD-180 Rocket Engines
Quantity
F-1 Engine
RD-180 Engine
Sea level thrust ( N )
6.67 e + 6
3.83 e + 6
Vacuum thrust ( N )
7.86 e + 6
4.15 e + 6
Sea level I sp ( s )
260
311.3
Vacuum I sp , ( s )
306
337.8
Engine burn time, ( s )
150
227
Engine dry mass, ( kg )
8371
5480
Propellant burn rate, ( kg/s )
2616
1254
Search WWH ::




Custom Search