Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUG: the rocket does not take off the rail #411

Open
Gui-FernandesBR opened this issue Sep 16, 2023 · 2 comments
Open

BUG: the rocket does not take off the rail #411

Gui-FernandesBR opened this issue Sep 16, 2023 · 2 comments
Labels
Bug Something isn't working Flight Flight Class related features

Comments

@Gui-FernandesBR
Copy link
Member

Gui-FernandesBR commented Sep 16, 2023

Describe the bug

  • I did everything correctly when creating my Flight object, but for some reason the rocket doesn't fly.
  • I guess this is happening because my thrust curve doesn't start at time == 0 seconds
  • Therefore the SciPy's integrator adopts really large time steps, which make the thrust curve to be ignored.

To Reproduce

Try to follow the code block below. You're gonna see that the rocket never leaves the position (0, 0, 0).

liquid_motor = LiquidMotor(
        thrust_source="data/SEBLM/test124_Thrust_Curve.csv",
        burn_time=(8, 20), # this is important to reproduce the error!
        dry_mass=10,
        dry_inertia=(5, 5, 0.2),
        center_of_dry_mass_position=0,
        nozzle_position=-1.364,
        nozzle_radius=0.069 / 2,
    )
liquid_motor.add_tank(pressurant_tank, position=2.007)
liquid_motor.add_tank(fuel_tank, position=-1.048)
liquid_motor.add_tank(oxidizer_tank, position=0.711)

calisto_liquid_modded= Rocket(
        radius=0.0635,
        mass=14.426,
        inertia=(6.321, 6.321, 0.034),
        power_off_drag="data/calisto/powerOffDragCurve.csv",
        power_on_drag="data/calisto/powerOnDragCurve.csv",
        center_of_mass_without_motor=0,
        coordinate_system_orientation="tail_to_nose",
    )
calisto_liquid_modded.add_motor(liquid_motor, position=-1.373)

test_flight = Flight(
        rocket=calisto_liquid_modded,
        environment=Environment(),
        rail_length=5,
        inclination=85,
        heading=0,
        max_time_step=np.inf # this is important to reproduce the error!
)

test_flight.all_info()

Expected behavior

A description of what you expected to happen.

Screenshots

If applicable, add screenshots to help explain your problem.

Additional context

Some warning are also generated due to this BUG, for example:

tests/test_flight.py::test_liquid_motor_flight
  RocketPy\rocketpy\plots\flight_plots.py:107: UserWarning: Attempting to set identical low and high zlims makes transformation singular; automatically expanding.
    ax1.set_zlim3d([0, max_z])

tests/test_flight.py::test_liquid_motor_flight
  RocketPy\rocketpy\plots\flight_plots.py:108: UserWarning: Attempting to set identical low and high ylims makes transformation singular; automatically expanding.
    ax1.set_ylim3d([min_xy, max_xy])

tests/test_flight.py::test_liquid_motor_flight
  RocketPy\rocketpy\plots\flight_plots.py:109: UserWarning: Attempting to set identical low and high xlims makes transformation singular; automatically expanding.
    ax1.set_xlim3d([min_xy, max_xy])

Possible solutions:

While discussing this internally, we came up with some suggestions:

  • We could set the max_time_step as 0.1 * burn_duration, for example, to ensure that any simulation will have at least 10 steps.
  • The default value of max_time_step could now be set to 0.1 instead of np.inf
  • We could stop initializing the flight simulations at t=0s, instead, starting it at t= burn_time[0]
@Gui-FernandesBR
Copy link
Member Author

I think it's not a good idea to start the simulation with a initial_time different of t=0.
Otherwise, we would lose some insights in the flight, for example, the "apogee_time" would become the flight time plus the time until ignition starts. This would be a bit confusing I guess.

It's better to adjust the thrust curve to always start at 0, probably.

I'm open to discussions anyway

@Gui-FernandesBR Gui-FernandesBR removed their assignment Sep 16, 2023
@Gui-FernandesBR Gui-FernandesBR added the Bug Something isn't working label Sep 16, 2023
@Gui-FernandesBR Gui-FernandesBR added this to the Release v1.1.0 milestone Sep 16, 2023
@williambrenner
Copy link

This bug happens to me frequently even when the thrust curve starts with 0. The way I fix it is the same as suggested (changing the maxTimeStep to 0.1) as shown in the screenshot

image

The simulations of this screenshot had a thrust curve that starts like this

image

In Monte Carlo simulations this also happens sometimes, usually when the standard deviation of the burn time is too high. To correct the dispersion analysis, I have to reduce the standard deviation.

@Gui-FernandesBR Gui-FernandesBR added the Flight Flight Class related features label Oct 30, 2023
@Gui-FernandesBR Gui-FernandesBR moved this from Backlog to Mid-Term in LibDev Roadmap Nov 20, 2023
@Gui-FernandesBR Gui-FernandesBR moved this from Mid-Term to Backlog in LibDev Roadmap Jul 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working Flight Flight Class related features
Projects
Status: Backlog
Development

No branches or pull requests

2 participants