
Free Rocket Simulation Program
------------------------------

This program is designed for rocket acceleration/velocity/altitude simulations
and it is available under the GNU General Public License (GPL).

The code should be easy to read and experiment with. Rocket enthusiasts are 
encouraged to use it and develop it further.

Requirements, compilation & running
-----------------------------------

An Java-compiler (JDK = Java Developement Kit) is required.
That can be obtained from: http://www.javasoft.com.

The program (Simulation.java) should be compiled with javac:

javac Simulation.java

After compilation there is an compiled program (Simulation.class).
The can be run with java:

java Simulation

Parameters
----------

Without parameters program displays it's usage information:

 Usage: Simulation <motor> <m> <Cd> <d> <file>

Where:
 motor: Type of motor: SF_A, SF_B, SF_C or SF_D
 m:     Rocket's mass without a motor (kg)
 Cd:    Rocket's drag coefficient
 d:     Diameter of rocket's tube (m)
 file:  File to print simulation steps. Optional.

The last parameter (file) is optional.

Calculations
------------

The program calculates various variables of rocket's flight; including: max/min drag,
max/min acceleration, max/min velocity, max altitude, flight time.

By default simulation is done using 0,001 second interval. That can be adjusted with variable
dDeltaTime.

Simulation steps to file
------------------------

With optional 5. parameter each simulation step can be directed to a file. Typical file
size with dDeltaTime = 0,001 s is 1 Mb.

From the file one can easily make for example the following observation: Velocity of the rocket
at the end of the launch stick. That information can be used to determine optimum launch stick
length at certain wind conditions.

Variables in the simulation step file are separted by tabs. The file should be easy to
import the spreadsheet program of choice. Notice that if you want to draw a graph using the
spreadsheet program, a much longer simulation step is required, otherwise the spreadsheet
program could hang.

And naturally, the simulation step file can be used for debugging.

Improvements and scientific problems
------------------------------------

The program could be nicer with an GUI and ability to make graphs. But for the moment,
I am more interested in making it more accurate.

The thrust of motors is approximated with linear equations. 
At the moment, available motors are Sachsen-Feuerwerk A8-3, B4-4, C6-4 and D7-3.
Mainly, because those are available in Finland at the moment.
It should be quite straightforward to add additional motors, however.

Modifications required for each new motor type:
- a new row to array sMotors (Code & Description)
- a new row to array dMotors (Full Mass, Empty Mass & Ejection Time)
- a new row to method calcThrust()
- a method to approcimate thrust profile with linear equations (like calcSachsen_A8_3()).

The data was manually measured from graphs at:
http://www.raketenmodellbautechnik.de/produkte/Motoren

The thrust data could be more accurate.

The change in rocket's mass during flight is approximated linearly between motors
full mass and empty mass. That could be calculated more accurately if mass of delay charge
and mass of ejection charge were known. That could be calculated still more accurately with
thrust and velocity of escape gases (if known).

Earth's gravity (g) should decrease with increasing altitude.

Different drag coefficients could be used for different Reynolds numbers and
of course some CFD-calculation for drag coefficient would be cool....



Aapo Puhakka, 15.6.2003
