Modelica评估订单

Flu*_*mon 2 evaluation numerical-analysis modelica dymola

我无法在Modelica规范中找到任何答案,所以生病了.该规范指出, A tool is free to solve equations, reorder expressions and to not evaluate expressions if their values do not influence the result (e.g. short-circuit evaluation of Boolean expressions). If-statements and if-expressions guarantee that their clauses are only evaluated if the appropriate condition is true, but relational operators generating state or time events will during continuous integration have the value from the most recent event. If a numeric operation overflows the result is undefined. For literals it is recommended to automatically convert the number to another type with greater precision. 现在,我想,该工具可以选择在积分器步骤中多次评估表达式吗?例如(可能不是一个有效的例子,只是为了让你们知道我在想什么:))

Real x;

equation
  der(x) = -t;
  Modelica.Utilities.Streams.print(String(time));
Run Code Online (Sandbox Code Playgroud)

这将同时打印几次,所以我认为有某种迭代正在进行.但我真的希望得到一些消息来源的确认.

Adr*_*Pop 5

这很正常.可变步长求解器(如dassl)可以及时来回查找曲线的方向.此外,如果您有事件,可以同时生成更多值.

如果您想在方程时需要的精确时刻打印时间或值:

when sample(0, 1) then
  Modelica.Utilities.Streams.print(String(time));
end when;
Run Code Online (Sandbox Code Playgroud)

阅读Modelica Spec中有关样本的更多信息.

也可以使用欧拉等固定步长求解器.

  • 如果您想了解系统仿真的细节,那么您可以查看这些书: - FrançoisE.Cellier和Ernesto Kofman的连续系统仿真 - 由FrançoisE.Cellier和Jurgen Greifeneder进行的连续系统建模 (3认同)
  • 根据寻根策略,即使是固定步长求解器也可能会倒退;) (2认同)