英文:
Looking for a principle to determine how to choose the number of intervals in Dymola
问题
有一个选项可以在Dymola模拟期间设置“间隔数”,但我不确定如何在实际模型中选择这些间隔。
所以我做了一些测试,以下是我的结论和问题:
- 间隔数不应该太小,因为当它太小时,模拟结果可能偏离真实值。
- 因此,我总是将间隔数设置为500以上,目前似乎正常工作,但我不确定是否应该增加它。
- 当使用更多的间隔时,模拟时间可能会变长,所以也许我可以减少它。
简而言之,我正在寻找一个原则来确定如何选择间隔数。
英文:
There is an option to set the "Number of intervals" during the simulation in Dymola, but I am not sure how to choose the intervals in a real model.
So I did some tests, Here are my conclusions and questions:
- The number of intervals shouldn't be too small, cause when it is too small, the simulation result could deviate from the real value.
- So I set the number of intervals above 500 always, it seems working fine right now, but I am not sure if I should increase it.
- When using a larger number of intervals, the simulation time could be longer, so maybe I could decrease it.
In short, I am looking for a principle to determine how to choose the number of intervals.
答案1
得分: 2
间隔仅适用于绘图窗口,而不适用于模拟。
如果选择了500,将使用线性插值绘制500个点。模拟的实际步长由DASSL整合器选择,以确保稳定性。容差选项可能会影响该行为。如果选择另一个求解器,甚至可以设置固定数量的迭代步骤,但我强烈建议将该决策留给求解器。
英文:
The intervals are just the ones for the plot window not for the simulation.
If you chose 500 you will get 500 points plotted with linear interpolation. The actual stepsize for simulation is chosen by the DASSL-Integerator to ensure stability. The tolerance option can influence that behaviour. If you choose another solver you can even set fixed number of iterator steps, but i would strongly recommend leaving that decision to the solvers.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论