Modelica Dymola: How to change component parameters during state graph simulation?

蹲街弑〆低调 提交于 2021-01-28 04:28:12

问题


Say I have a fluid model, with initial pressures, temperatures, valve settings, etc.

Is there a way to run a State Graph simulation where each of the states contains new component parameter settings for the model, i.e. some parameters of some selected components are changed during one state, and are changed again during the next state?

For example, during State1 let's set the values for the following component parameters:

  • source.pressure = 1
  • source.temperature = 1
  • valve1.opening = 1

Until State1 switches to State2 where the parameters are:

  • source.pressure = 0.5
  • source.temperature = 0.5
  • valve1.opening = 0.5

Thanks for your time :-)


回答1:


Short answer: No. For that use-case you should use discrete variables (and change them using a when-clause).

Long answer: As of version 3.3, Modelica has a new feature, called State Machines (see chapter 17 of the specification). In theory, it should do what you require, but it might still be buggy since it is quite new.

What you are attempting to do is called "variable structure modeling" (although only changing parameters is hardly "variable structure" and can be implemented using discrete variables instead, as my short answer suggests). Long before StateMachines where introduced to Modelica, this was (and remains) an active area of research. You could also use an external tool to achieve your goal, e.g. DysMo



来源:https://stackoverflow.com/questions/30487580/modelica-dymola-how-to-change-component-parameters-during-state-graph-simulatio

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