(1) Overview

Introduction

The Cambridge Rocketry Simulator is designed for use with unguided rockets including model rockets, High Power Rockets (HPR), and sounding rockets. Typically, these will perform a sub-orbital flight, collect some data, and deploy a parachute for recovery to Earth. The software models the flight dynamics of the rocket in six-degrees-of-freedom and of the parachute descent in three-degrees-of-freedom. It has a range of uses. Firstly, it can guide the design process. For example, it allows the engineer to select the appropriate size motor for a desired apogee; or to design the fins for an appropriate margin of stability; or to optimise the timing of stage separation or parachute deployment. Secondly, it enables the operator to predict the landing location, which helps in determining the required launch safety exclusion zone, as well as facilitating the retrieval of the reusable components of the rocket. In order to map uncertainties in the dynamics and the atmospheric conditions into confidence bounds around the predicted landing location, a Monte Carlo approach is combined with a numerical integration scheme.

Most research performed on predicting the trajectories of projectiles is done by numerical integration. The exception is the work of Chudinov [], who predicts the trajectories by applying an analytical solution. While this approach is beneficial in terms of computation costs, the prediction is limited to modelling a point mass with a quadratic drag force. At the other end of the spectrum, there are advanced simulators such as that described by Sahu [], where the authors use advanced coupled computational fluid dynamics/rigid body dynamics to predict the rocket behaviour even as it enters supersonic speeds. However, as the additional computational cost is significant due to the calculation of unsteady aerodynamics associated with supersonic flight, it is computationally costly to perform an uncertainty analysis of parameters via a Monte Carlo method. While there are other methods available for non-linear uncertainty propagation, the Monte Carlo method is capable of handling large state spaces and arbitrary input distributions, making it the most widely used approach. That does not take away that advanced simulations remain invaluable when testing the performance of new control methods, as performed by Gomez and Miikkulainen [], who test their control method for a finless rocket via simulations. Uncertainty propagation is also useful for Impact Point Prediction (IPP), where the impact point of a projectile is determined while it is in-flight. Yuan et al. [] incorporates the uncertainty due to the presence of wind to increase the accuracy on the confidence bounds on the landing location. Rogers [] applies an uncertainty analysis not only to predict the impact point, but also to guide the rocket such that it avoids objects and reaches the target location without collision. With the exception of the analytical solution, all research is done via a six-degrees-of-freedom rocket model and parameters describing the projectile’s properties.

There are various software packages that facilitate conceptual studies of rocket design, including commercial solutions such as RockSim [], open-source solutions such as OpenRocket [], and even computer games such as the Kerbal Space Program []. All these packages simulate the performance of a rocket under nominal conditions, returning the expected performance to the user. While RockSim Pro does display confidence bounds around the predicted landing location to the user, it is only available to USA citizens.

The Cambridge Rocketry Simulator has four advantages over these software packages. Firstly, it is free and open-source []. Secondly, the physics model is verified, peer-reviewed, and published []. Thirdly, by using a Monte Carlo wrapper, it incorporates uncertainties in both rocket dynamics and atmospheric conditions, making it possible to produce a splash-down area with confidence bounds. Finally, the atmospheric model supports a 3-dimensional wind vector, air density, and air temperature, all as a function of altitude. These atmospheric data may be populated from a recent meteorological forecast to maximize the accuracy of predictions. And with the introduction of the third version of the Cambridge Rocketry Simulator, as presented in this paper, parts of the Graphical User Interface (GUI) from Open-Rocket [] are integrated to assist the user in their rocket design. The software package is useful in predicting the trajectories of rockets in academic activities [, , , ], or when sampling the atmosphere using sounding rockets. Without the prediction of the trajectories, or more specifically, the confidence bounds of the landing location, you may never get permission from the aviation authorities to launch your rocket []. Furthermore, the output of the simulator, the rocket trajectories, have been used in the trajectory modelling research described by Eerland, Box, and Sóbester [].

The remainder of this paper covers the implementation and architecture, quality control, the availability, and reuse potential of the software.

Implementation and architecture

The software package consists of three components, each written in a different language to suit their individual purpose: A GUI, a simulator, and a visualisation module. A schematic representation of the three components, and how they interact, is presented in Figure 1.

Figure 1 

A schematic representation of the three components and the corresponding programming languages.

The GUI used to design the rocket is coded in Java, where the start-up file SWINGSTARTUP.JAVA is located at GUI/SWING/SRC/NET/SF/OPENROCKET/STARTUP/. This starts the design page as seen in Figure 2, where the user can select the different components to build the rocket. More details about the GUI, and the corresponding internal structure can be found in Niskanen []. The example here shows a two-stage rocket. Once the rocket is designed, all the parameters are passed to the simulator core (written in C++) via an Extensible Markup Language (XML) data-sheet. These parameters are required in the simulation, and consist of the moments of inertia, centre of pressure, drag coefficient, and the thrust curve. A full list of parameters and a description of the components are available in the user guide USER_GUIDE.PDF, which is located at DOC/.

Figure 2 

GUI for designing a rocket. It contains all the basic components required to design a rocket.

The core of the physical simulation, the ROCKETC source code, is located in CPP/ which includes a Makefile that compiles the binary and moves it to the simulator folder, found in SIMULATOR/. The Java GUI calls the simulation binary, after which the simulation starts by reading the input XML generated by the Java code. The XML file SIMULATIONINPUT.XML can be found in the Data folder at DATA/. Upon completion of the simulation an output XML file SIMULATIONOUTPUT.XML is generated in the same folder.

This output of the simulation is then input to the Python visualization code which is located in PLOTTER/. This presents the user with an overview of the flight trajectories and the splash-down area. The splash down-area includes confidence bounds, as seen in Figures 3 and 4.

Figure 3 

Mean trajectories of both stages of a two-stage rocket including a staged parachute descent. The 1 and 2 σ bounds of confidence in landing position are also shown.

Figure 4 

Landing position confidence bounds from Figure 3 along with the individual landing locations of 25 Monte Carlo iterations.

When running the software under Linux, the three folders, SIMULATOR/, DATA/, and PLOTTER/, are expected to be located in the users home directory ~/.CAMROCSIM/. Therefore, to prepare the system for execution from source code, a script called PREPARE_LINUX.SH is included in the repository. This copies the three relevant folders to this location. The information presented in this section, and build instructions for Windows, are available in the README.MD file found in the repository.

Quality control

The performance of the simulator has been evaluated by comparison to telemetry data recorded in rocket flights as described by Box, Bishop, and Hunt [].

The performance and stability of the GUI and the visualiser have been tested in two rounds of user-testing, including cross-platform testing, which was done on Ubuntu 14.04 Trusty Tahr and Windows 10.0 (Build 10240).

Furthermore, there are unit tests available for the GUI and simulator, using JUnit for the GUI (Java), and GoogleTest for the simulator (C++). Instructions on how to run these are included in the README.MD file.

(2) Availability

Operating system

The Cambridge Rocketry Simulator is able to function on any operating system that supports a standard Java and Python installation, which includes Linux and Windows. In all systems the simulator can be set-up by checking out the code repository. Detailed instructions on how to start the program and continue development are included in the documentation.

Programming language

Java ≥ 1.7

Python ≥ 2.7

C++ ≥ C++ 98

Additional system requirements

No special requirements.

Dependencies

The following C++ library is a required dependency:

  • Boost ≥ 1.58

The following Python libraries are a required dependency:

  • numpy ≥ 1.5
  • matplotlib ≥ 1.1
  • scipy ≥ 0.16.0

List of contributors

  1. Willem Eerland (developer).
  2. Simon Box (developer).
  3. The project includes sources from OpenRocket [] (GNU GPL).

Software location

Archive

Name: Zenodo

Persistent identifier: https://doi.org/10.5281/zenodo.161850

Licence: GPL v3

Publisher: Zenodo

Version published: 3.1

Date published: 19/10/2016

Code repository

Name: SourceForge

Persistent identifier: https://sourceforge.net/p/camrocsim/code/ci/b888389c281788805b2680190dcda3b706dd8327/

Licence: GPL v3

Version published: 3.1

Date published: 19/10/2016

Language

English

(3) Reuse potential

The modular design of the Cambridge Rocketry Simulator’s source code makes it inherently reusable. The GUI may be reused for applications where rocket design is required but simulation and visualization are not. The simulator itself – as described above – is a stand-alone program callable from the command-line, accepting a XML simulation input file as its single parameter. Therefore this can be ported into other applications.

Furthermore, individual classes of the simulator have reuse potential. For example the RKF45.CPP class is a general ordinary differential equation solver which implements the fourth/fifth order Runge-Kutta algorithm with Fehlberg step-size control []. This may be used in any dynamics simulation application.

Similarly, the VMATHS.CPP class may be used for modelling the six-degrees-of-freedom dynamics of rigid bodies. In particular the implementation of quaternions in this class is helpful for modelling unconstrained rotation without the need to deal with the singularities that arise when using Euler angles [].

To assist users and developers, there is a user guide (USER_GUIDE.PDF) available in the DOC/ directory. This includes information on the required structure of the XML files, and instructions on how to launch the simulator and plotter via the command line.

The website Cambridge Rocketry [] is devoted to producing open-source software for simulating high power rockets, where besides the Cambridge Rocketry Simulator, an Octave/Matlab version of the simulator core named the Cambridge Rocketry Toolbox is available. The preferred method for contributors to contact the developers is via the SourceForge webpage https://sourceforge.net/p/camrocsim/, where questions can be asked on the forum, and the developers may be contacted directly.