How much is the largest capability of solving the nonlinear system model in Dymola?

╄→尐↘猪︶ㄣ 提交于 2020-05-30 06:10:03

问题


In Dymola, I often meet a nonlinear system initialization failure or maybe a stiff system that is hard to solve in the large thermo-fluid system, but for a simple system, there wouldn't be this kind of problem. My questions are:

  1. So I am wondering how much is the largest capability of solving a nonlinear system model? For example, how many nonlinear equations I could include in my model at most?
  2. Is there any setting in Dymola which allows increasing the capability of solving nonlinear system?
  3. How could I decrease the number of nonlinear equations in the model without damage to the accuracy of the model?

回答1:


These are pretty difficult questions to be answered in a generally valid fashion. Still I'll try to share some of my experience with Dymola and non-linear systems.

  1. There is no hard number which will limit the size. It depends more on how strongly non-linear the equations are than on their number. I have simulated models with non-linear systems of size 150, which are pretty stable while others of size 10 can brake...

  2. There are multiple perspectives to this

    • I have worked on some models that made the C-Compiler run out of memory during compilation. If you have this sort of problem, forcing 64Bit compilation by setting Advanced.CompileWith64=2 can help. Then you shouldn't run out of memory any more. This only refers to the size only.
    • Performance for non-linear systems can be improved by activating DAE-mode by setting Advanced.Define.DAEsolver=true. This does not work with all solvers though.
    • Additionally to the above it can help to set Advanced.MoveEquationsToDynamics=true, for which the manual states: "It forces the integrator to solve the nonlinear equations each integrator step and thereby it also updates the initial guesses more often."
    • As mentioned by Erik, the homotopy()-operator can be very important as it helps the solver converging in case of difficult initialization.
  3. This is very specific to the model. Decoupling can help, e.g. by splitting the system in smaller systems by adding energy storing elements/states. This can be done based on physics of the system and is the preferable solution if possible. As an (more artificial) alternative filter/delays can be added. Usually this has a negative effect on accuracy.




回答2:


I very much agree with Markus's advice but would also like to remind you about Modelica's homotopy operator. A well-chosen simplified model can greatly help Dymola to initialize a model with a large and difficult non-linear system.

In general good initial guesses are very important when solving non-linear systems. Using homotopy is simply an implicit way to provide these good guesses.



来源:https://stackoverflow.com/questions/61408790/how-much-is-the-largest-capability-of-solving-the-nonlinear-system-model-in-dymo

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!