Simulink model diverges depending on Stop time (tend)

6 ビュー (過去 30 日間)
Joan Ferrer
Joan Ferrer 2023 年 2 月 2 日
回答済み: Fangjun Jiang 2023 年 2 月 2 日
My Simulink model works fine if I set a Stop time tend=30 s. However, if I increase the Stop time to tend=31 s, my model diverges at t=25 s, but in the previous simulation there wasn's any problem at t=25 seconds. How is this possible?
  1 件のコメント
Benjamin Thompson
Benjamin Thompson 2023 年 2 月 2 日
Can you attach the model to this post?

サインインしてコメントする。

採用された回答

Fangjun Jiang
Fangjun Jiang 2023 年 2 月 2 日
This is odd and rare but could be explained.
First of all, your model or dynamics is probably on the boardline of being unstable. So this case actually helps you to realize the problem and take measures to resolve it.
The most likely cause of this simulation problem is that you are probably taking the default setting for the solver (algorithm and step size). The default step size is tend/50. So by a rare chance, the difference of the default step size caused the different simulation results. You could do the following to confirm the cause.
  1. Log the simulation time ouptut of these two simulations, you will see that the time vectors are different
  2. Set the solver (algorithm and step size) to be the same for the two simulation, then you should see the same simulation result when tend is 30 or 31.

その他の回答 (0 件)

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by