ENH: Two stage rocket example.
Pull request type
Other (please describe): Added example of a 2 stage rocket.
Checklist
Docs have been reviewed and added / updated Lint (black rocketpy/ tests/) has passed locally
Current behavior
There are no examples of 2 stage rockets available.
New behavior
This PR adds a simple example using the already existent Andromeda rocket.
Key features:
This adds an ipynotebook called two_stage_example.ipynb in the docs/example folder.
Breaking change
No
Additional information
Two stage rocket motor example done as part of the selection process for the RocketPy team of 2026.
I know better multi stage support is planned in RocketPy for the near future. I'm interested in contributing with that. The notebook has a few comments on problems I found during the implementation.
Unfortunately, due to time constraints I had to keep the example simple. I plan on updating it using data from rockets VSB-30 or SS-520.
Linters not passing... Could you check it please?
Important: Do you want to merge this PR or was it created just for learning purposes?
@Gui-FernandesBR Will check it throughout the week.
I created the PR for two reasons:
- As part of my registration to the recruitment for the team of 2026.
- To assess to multi stage capabilities of RocketPy. It was my first time using it so it certainly fits your "learning purpose" description.
About merging this PR, here's two important points:
-
There are some incosistencies in the example. For example, I used the same mass and inertia properties as the original Andromeda example, which is a single stage vehicle, for the two stages vehicle. So it's phisically inaccurate.
-
There are some adjustments I did in the example because the code wasn't working properly. I believe those were caused by real bugs, but I didn't have time to investigate. For example I used a
rail_lengthfor the second stage flight, which had aninitial_solutioncondition specified. It shouldn't be necessary, but the code won't work without it. I also had to manually update the altitude of the second flight, because it seems the Flight class doesn't automatically update it based oninitial_solution
In other words, my engineering judgment is that it's best to fix those two items above first, and then merge a proper example. Correct me if I'm wrong, but there's a plan to implement better multi stage capabilities in the near future, so fixing those small problems would certainly fit.
I also believe I have some papers with trajectory data for VSB 30, SS-520, some NASA examples, that might make up for a better example. I didn't try to use those due to the lack of time for the registration, which ended yesterday.
What do you think? Seems reasonable to me to fix these small things, and use an example from a real rocket, if possible, for the merge. It would be useful during the implementation of better multi stage capabilities too.