Check ode45 for a certain value and start a new solver when these limitations are reached

1 回表示 (過去 30 日間)
I use the ode45 solver for my rigid multibody system. I wanted to limit the movement of the bodies to a certain max and min. I know it is possible to stop the solver completely when a condition is reached but I want it to compute the remaining values and if possible mirror the second output of the body so that a bouncing is simulated.
In my first attempt I solved the system and swapped the unwanted values with my max/min but that doesn't make sense. Could I start another ode45 with initial conditions that are my last values of the first ode45 outputs and just mirror the second output with a minus?

採用された回答

Torsten
Torsten 2023 年 5 月 26 日
移動済み: Torsten 2023 年 5 月 26 日
That's exactly what the Event facility of the ODE integrators does.
Look at the "ballode" example:

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeOrdinary Differential Equations についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by