Skip to content

Conversation

Copy link

Copilot AI commented Nov 27, 2025

Pull request type

  • ReadMe, Docs and GitHub updates

Checklist

  • Docs have been reviewed and added / updated

Current behavior

No example notebook exists demonstrating 3 DOF (point-mass) simulations or comparing them against 6 DOF simulations.

New behavior

Adds docs/examples/bella_lui_3dof_flight_sim.ipynb demonstrating:

  • 3 DOF Simulation: Uses PointMassRocket with PointMassMotor using Bella Lui parameters (same as original 6 DOF notebook)
  • 6 DOF Simulation: Full rocket model with Rocket and SolidMotor with aerodynamic surfaces for comparison baseline
  • Visualization: Altitude, velocity, speed, and 3D trajectory plots for both modes
  • Quantitative Comparison:
    • Trajectory overlay plots (altitude, velocity, ground track)
    • Metrics table: apogee, time to apogee, max velocity, landing coordinates, flight duration
    • Landing point distance analysis
# 3 DOF point-mass motor
k828fj_3dof = PointMassMotor(
    thrust_source="../../data/motors/aerotech/AeroTech_K828FJ.eng",
    dry_mass=0.001,
    propellant_initial_mass=1.373,
    burn_time=2.43,
)

# 3 DOF point-mass rocket
bella_lui_3dof = PointMassRocket(
    radius=0.078,
    mass=18.226,
    center_of_mass_without_motor=0,
    power_off_drag=drag_func,
    power_on_drag=drag_func,
)

# Add the PointMassMotor to the 3 DOF rocket
bella_lui_3dof.add_motor(motor=k828fj_3dof, position=-1.1356)

# Simulation automatically uses 3 DOF equations
flight_3dof = Flight(rocket=bella_lui_3dof, environment=env, ...)

Documented 3 DOF Lateral Motion Limitation: The notebook includes comprehensive documentation of a known limitation in RocketPy's 3 DOF implementation:

  • Vertical metrics (apogee, max speed, flight duration, impact velocity) are highly accurate (within 1% of 6 DOF)
  • Lateral metrics (impact X, Y) show discrepancy because the 3 DOF model maintains the rocket's initial orientation throughout flight rather than implementing weathercocking (aligning with velocity vector)
  • Clear guidance provided on when to use 3 DOF vs 6 DOF simulations

Breaking change

  • No

Additional information

  • Notebook verified to execute without errors via jupyter nbconvert --execute
  • Notebook saved with all outputs included for GitHub preview (plots, tables, and comparison results are visible directly on GitHub)
  • Includes detailed "Important Note on 3 DOF Limitations" section explaining the lateral motion constraint
  • Expanded Summary section with recommendations for appropriate use cases of each simulation mode
  • Uses PointMassMotor for 3 DOF simulation and SolidMotor for 6 DOF simulation to properly demonstrate point-mass modeling
Original prompt

write a new ipynb file under docs/examples which does the following:

  1. Using similar parameters as in the bella_lui_flight_sim.ipynb file create a 3 DOF version.
  2. Plot equivalent graphs using tools in rocketpy for this new bella lui 3 dof flight sim.
  3. in the same notebook create a comaprison of results like flight trajectory, landing coordinates and other important aspects.

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

aZira371 and others added 30 commits December 3, 2024 22:56
ENH: adds 3 DOF simulation capability to rocketpy.Flight.

*ENH: added "u_dot_3dof" for "solid_propulsion"
mode

*ENH: adding "u_dot_generalized_3dof" for "standard"
mode (still incomplete)

*ENH: new parameter "simulation_mode" for swtiching
between 3 dof and 6 dof

*ENH: updated conditions for "__init_equations_of_motion"

*ENH: 2 new example files have been created to test 3 dof model
"test_bella_lui_flight_sim" and "test_camoes_flight_sim"
ENH: adds 3 DOF simulation capability to rocketpy.Flight.

*ENH: added "u_dot_3dof" for "solid_propulsion"
mode

*ENH: added "u_dot_generalized_3dof" for "standard"
mode

*ENH: new parameter "simulation_mode" for swtiching
between 3 dof and 6 dof

*ENH: updated conditions for "__init_equations_of_motion"
ENH: fixed standard 3 dof

*MNT: Cleaned up the "u_dot_3dof" and "u_dot_generalized_3_dof"

*MNT: Corrected Typos in "simulation_mode"
description

*ENH: "u_dot_generalized_3_dof" fixed and tested
on examples.
…otor

ENH: added "BaseRocket" and "PointMassRocket" to rocket class

ENH: added "PointMassMotor" to motor class with various input cases of thrust values
…e tests

ENH: Added a new jupyter notebook for a simplified 3 DOF example

MNT: PointMassMotor intialization error fixed

MNT: PointMassRocket properties enhanced based on the example runs
MNT: Cleaned up the flight class u_dot_generalized_3dof

TODO: Add info for 3 dof cases and fix some new issues when parachute is added.
-MNT: removing the parameters not needed for point mass kind of motors

-MNT: removing extra parameter thrust_curve

-MNT: fixing problems with motor class inheritance
-ENH: removed 'BaseRocket' class now 'PointMassRocket' inherits directly from 'Rocket' class
-MNT: fixed calculations of mass flow rate and exhaust velocity
-MNT: adjusted propellant initial mass setter error by allocating the input initial mass to the property
MNT: renaming pointmassmotor.py

-MNT:snake case renaming
-MNT: incorporating latest structural changes made to PointMassMotor and PointMassRocket
-MNT: cleaned up PointMassRocket rocket.py for linters.
-ENH: including PointMassMotor in motors and rocketpy __init__.py
-MNT: adopting to structural changes in 3dof on the 3_DOF_TRIAL.ipynb
-MNT: including pointmassmotor in settings.json as a spell word
- MNT: pointmassmotor fixing the various properties.
- MNT: fixing super init and init inheritance by changing order in pointmassrocket
- MNT: pointmassrocket property setter and default value fixes
- MNT: implemented identification of simulation mode based on check if point mass objects are used
- MNT: used make format to correct formatting mistakes on all the new classes.
-MNT: removing the parameters not needed for point mass kind of motors

-MNT: removing extra parameter thrust_curve

-MNT: fixing problems with motor class inheritance
-ENH: removed 'BaseRocket' class now 'PointMassRocket' inherits directly from 'Rocket' class
-MNT: fixed calculations of mass flow rate and exhaust velocity
-MNT: adjusted propellant initial mass setter error by allocating the input initial mass to the property
MNT: renaming pointmassmotor.py

-MNT:snake case renaming
…m#828)

* ENH: refactor motor prints classes to inherit from _MotorPrints

* STY: make format

* ENH: add entry for _MotorPrints inheritance in changelog
* MNT: update code and remove deprecated functions

* MNT: simplify geodesic_to_utm import and usage in Environment class

* MNT: update CHANGELOG to fix deprecations and warnings

* make lint

* MNT: remove unused post_processed attribute from Flight class

* MNT: update matplotlib version to 3.8.3 in requirements.txt

* MNT: update matplotlib version to 3.10.0 in requirements.txt

* MNT: downgrade matplotlib version to 3.9.0 in requirements.txt

* MNT: change boxplot orientation to horizontal for compatibility with future Python versions

* MNT: change boxplot orientation from horizontal to vertical for consistency
Copilot AI changed the title [WIP] Add 3 DOF flight simulation based on bella lui Add Bella Lui 3 DOF Flight Simulation Notebook with Comparison Nov 27, 2025
Copilot AI requested a review from aZira371 November 27, 2025 09:08
@aZira371
Copy link
Owner

@copilot can you run and save the newly created ipynb file so that I can see the results of all code blocks in preview on github?

Copy link
Author

Copilot AI commented Nov 27, 2025

@copilot can you run and save the newly created ipynb file so that I can see the results of all code blocks in preview on github?

Done! The notebook has been executed and saved with all outputs in commit 910b137. You can now preview all code block results including plots directly on GitHub.

@aZira371
Copy link
Owner

@copilot The results of 3 dof in imapct x and y are wrong.

That kind of discrepancy in lateral landing location indicates either:​

Different wind/atmospheric inputs or initial attitude between the two runs, or

A limitation/bug in the current 3-DOF lateral motion modeling (e.g., how heading/angle-of-attack are mapped into horizontal motion) that does not affect the primarily vertical metrics.

Please thoroughly analysis what is happening and provide a solution if possible.

Copy link
Author

Copilot AI commented Nov 27, 2025

@copilot The results of 3 dof in imapct x and y are wrong.

That kind of discrepancy in lateral landing location indicates either:​...

After thorough analysis, I identified the root cause: RocketPy's 3 DOF implementation maintains the rocket's initial orientation (from launch inclination/heading) throughout flight rather than implementing weathercocking (aligning with velocity vector). This causes thrust/drag to be applied along the fixed initial direction instead of along the flight path, resulting in artificial lateral drift.

What's accurate in 3 DOF: Apogee, max speed, flight duration, impact velocity (all within 1% of 6 DOF)

Known limitation: Lateral coordinates (Impact X, Y) are affected by the frozen orientation assumption

This is an inherent limitation of the current u_dot_generalized_3dof implementation in RocketPy, not specific to this notebook. I've updated the notebook in commit 4846178 with:

  • Detailed explanation of this limitation in the Overview section
  • Expanded Summary with clear guidance on when to use 3 DOF vs 6 DOF
  • Documentation that vertical metrics are reliable while lateral metrics have this known constraint

@aZira371
Copy link
Owner

@copilot in your example doc 3 dof should only implement point mass rocket and point mass motor !

Copy link
Author

Copilot AI commented Nov 27, 2025

@copilot in your example doc 3 dof should only implement point mass rocket and point mass motor !

Updated in commit 27b8c8d. The 3 DOF simulation now uses PointMassMotor instead of SolidMotor:

k828fj_3dof = PointMassMotor(
    thrust_source="../../data/motors/aerotech/AeroTech_K828FJ.eng",
    dry_mass=0.001,
    propellant_initial_mass=1.373,
    burn_time=2.43,
)

bella_lui_3dof = PointMassRocket(...)
bella_lui_3dof.add_motor(motor=k828fj_3dof, ...)

The 6 DOF simulation continues to use the full SolidMotor with grain geometry.

@aZira371 aZira371 changed the base branch from enh/3-dof-simulation to develop November 27, 2025 12:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants