How to run

Setup

You'll need a working python 3.12 environment with Elodin installed. These instructions assume Linux.

Python env

uv is easiest:

uv venv --python 3.12 python-env
source python-env/bin/activate
uv pip install elodin

Elodin sim GUI

Download the Elodin GUI from here: https://github.com/elodin-sys/elodin/releases

Running

This simulation is run in two stages. First you run the targeting simulation to figure out the proper vector magnitude, then you run the simulation in the GUI with that value to visualize hitting the target.

For an example, let's assume we want to hit a target at x=1328, y=4389

First run targeting:

python3 rocket.py target 1328 4389

The algorithm will run for a while, then output a solution magnitude. In this case the value is 18.81316304206848.

Next fire up the Elodin GUI.

Then input the value from the target command into the run command:

python3 rocket.py run 1328 4389 18.81316304206848

You should see the rocket fly torwards the target. You can use the sidebar inspect to verify that it hits the target when world_pos.z = 0.0.

RFD

I am tasked with using Elodin to design and test a rocket that can hit a target at maximum range.

Scope

Simplifying assumptions

  • No earth curvature
  • Uniform air density
  • Ignoring Mach and Reynolds effects for drag

Anticipated Challenges

  • Implementing the thrust curve
  • Accounting for air resistance, particularly important as we modify the shape of the rocket
  • Figuring out how to calculate the expected trajectory up-front in order to hit the target

High-level plan

Phase 0 - Learn tooling

Get familiar with Elodin, jax, etc

  • Look over Elodin docs
  • Get Elodin up and running
  • Go through ball tutorial
  • Create a custom Elodin.System

Phase 1 - Basic rocket

Create an MVP for the assignment: a spherical rocket that implements the thrust curve

  • Implement sqherical rocket
  • Gravity
  • Create a system for simulating thrust curve
  • Implement air resistance

Phase 2 - Hitting the target

  • Implement launch angles
  • Calculate/estimate the correct launch angles before launch

Phase 3 - Optimize rocket

Find the design that maximizes range

  • Test cube rocket
  • Test cylinder rocket
  • Test cylinder with cuboid fins
  • Test cylinder with fins and cone