Simulink simulation fails or not at a specific time depending on duration

2 ビュー (過去 30 日間)
Joris Naudin
Joris Naudin 2021 年 11 月 4 日
コメント済み: Joris Naudin 2021 年 11 月 8 日
Holla,
Something very weird happens if I set the duration too long for a simscape model :
If I set the simulation duration to, let's say 30 seconds, it completes perfectly without any errors or warnings.
However, if I set the simulation duration to 60 s, the exact SAME model will crash at around 5.5 s, whereas it did went through and beyond the 5.5 s before !
Nothing changes apart from how long I want the simulation to run. Crazy huh.
Some wild guess: I use a variable step solver, is it possible it computes differently depending on "knowing" how much it will has to simulate ? What's the reason behind this ?
Cheers

採用された回答

David John
David John 2021 年 11 月 8 日
It would be helpful to see your example model, but when this occurs it is most likely that the "Max step size" is having an impact. If you double the overall simulation time with "Max step size" equals "auto", the actual "Max step size" will also be doubled, and this can have some impact on convergence (depending on the model). Please try setting "Max step size" to something like 0.1 for both models and see if you get consistent behaviour.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeGeneral Applications についてさらに検索

製品


リリース

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by