Skip to content

yuriachermann/Rocket-Optimizer

Repository files navigation


Logo

Rocket Optimizer

A Python project for optimizing your rocket projects using OpenRocket and PSO
Explore the docs »

View Demo · Report Bug · Request Feature

Table of Contents
  1. About The Project
  2. Getting Started
  3. Usage
  4. Roadmap
  5. Contact
  6. Acknowledgments

About The Project

Rocket Optimizer is a Python script that uses OpenRocket to optimize rocket designs. It uses a genetic algorithm to find the best rocket design for a given set of constraints. The script is designed to be used with the OpenRocket rocket design software.

(back to top)

Built With

  • Python

(back to top)

Getting Started

To get a local copy up and running follow these simple example steps.

Prerequisites

Installation

Linux

For most people jpype will be able to automatically find the JDK. However, if it fails or you want to be sure you are using the correct version, add the JDK path to a JAVA_HOME environment variable:

  • Find installation directory (e.g. /usr/lib/jvm/[YOUR JDK 1.8 FOLDER HERE])
  • Open the ~/.bashrc file with your favorite text editor (will likely need sudo privileges)
  • Add the following line to the ~/.bashrc file:
export JAVA_HOME="/usr/lib/jvm/[YOUR JDK 1.8 FOLDER HERE]"
  • Restart your terminal or run the following for the changes to take effect:
source ~/.bashrc

Windows

  • Set Windows environment variables to the following:
    • If Oracle
      JAVA_HOME = C:\Program Files\Java\[YOUR JDK 1.8 FOLDER HERE]
    • If OpenJDK
      JAVA_HOME = C:\Program Files\ojdkbuild\[YOUR JDK 1.8 FOLDER HERE]

Setup OpenRocket

  • Download the OpenRocket-15.03.jar file
  • Right-click the file and select Properties
  • On the Permissions tab, enable the Allow executing file as program option

Installing orhelper

Make sure to have https://pypi.python.org/simple as a repository channel on your environment

  • Install orhelper from pip
pip install orhelper
  • Set environment variable CLASSPATH path to OpenRocket .jar file. (Only required if it's not already at .\OpenRocket-15.03.jar)
CLASSPATH=\some\path\to\OpenRocket-15.03.jar

Adding the motor to OpenRocket

  • Open the motor file link and save as "Acrux.eng"
  • Execute OpenRocket
  • Select the Edit tab and click on Preferences
  • On User-defined thrust curves click on Add and select the path to the Acrux.eng file
  • Click OK to save the changes

(back to top)

Usage

PSO running

gif_model gif

(back to top)

Roadmap

(back to top)

Contact

Yuri Winche Achermann - @YuriAchermann - [email protected]

(back to top)

Acknowledgments

  • Sampo Niskanen for the original simulator development: Documentation
  • @SilentSys for the advising and consolidation of orhelper: Source
  • And of course everyone who has contributed to OpenRocket over the years.

(back to top)