在 Modelica 模型中找到导致非线性误差的变量

Find the variable that causes nonlinear error in Modelica models

我在 Dymola 中调试非线性模型,模型停在 56600s,最后一个错误是

IF97 medium function g2 called with too low pressure
p = 611.643 Pa <= 611.657 Pa (triple point pressure)
Failed condition: p > 611.657

所以我尝试定位导致此错误的变量,但我不确定是否有一种简单的方法可以在 Dymola 中找到它,或者我需要输出非线性迭代详细信息,这将是一个巨大的日志文件。我的问题是:
我怎样才能简单地找到 wrong variable

这是 dslog.txt 文件:

Expression preheaterHP_LevelController.limiter.u < preheaterHP_LevelController.limiter.uMin became false ( (preheaterHP_LevelController.limiter.u) - (preheaterHP_LevelController.limiter.uMin) = 1.2054e-09 )
Iterating to find consistent restart conditions.
      during event at Time :  52544.06110892259
Expression pPI1.limiter.u < pPI1.limiter.uMin became false ( (pPI1.limiter.u) - (pPI1.limiter.uMin) = 7.89853e-09 )
Iterating to find consistent restart conditions.
      during event at Time :  52681.07501417062

POINTA=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>

Expression  -vol_turbineHP1.drain[2].m_flow > 0.0 became true ( ( -vol_turbineHP1.drain[2].m_flow)-(0.0) = 1.96259e-14 )
Iterating to find consistent restart conditions.
      during event at Time :  56087.88419083787

=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>

POINTB=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>

Error: The following error was detected at time: 56600
  IF97 medium function g2 called with too low pressure
p = 611.643 Pa <= 611.657 Pa (triple point pressure)
  Failed condition: p > 611.657

=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>

Error: The following error was detected at time: 56598.40726897018
  IF97 medium function g2 called with too low pressure
p = 611.656 Pa <= 611.657 Pa (triple point pressure)
  Failed condition: p > 611.657
Error: The following error was detected at time: 56598.30750099612
  IF97 medium function g2 called with too low pressure
p = 611.657 Pa <= 611.657 Pa (triple point pressure)
  Failed condition: p > 611.657
Error: The following error was detected at time: 56598.30750099612
  IF97 medium function g2 called with too low pressure
p = 611.657 Pa <= 611.657 Pa (triple point pressure)
  Failed condition: p > 611.657

Integration terminated before reaching "StopTime" at T = 5.66e+04

对于大多数模型,您应该确保您没有禁用 模拟设置>调试>在消息中包含函数调用 默认设置如下:

Error: The following error was detected at time: 0
  IF97 medium function tsat called with too low pressure
p = -210190 Pa <= 611.657 Pa (triple point pressure)
  Failed condition: p > 611.657
The stack of functions is:
Modelica.Media.Water.IF97_Utilities.BaseIF97.Basic.tsat
Modelica.Media.Water.IF97_Utilities.BaseIF97.Regions.boilingcurve_p
Modelica.Media.Water.IF97_Utilities.BaseIF97.Regions.hl_p
Modelica.Media.Water.IF97_Utilities.BaseIF97.Regions.region_ph
Modelica.Media.Water.IF97_Utilities.waterBaseProp_ph
Modelica.Media.Water.IF97_Utilities.rho_props_ph(
V18.port_a.p,
volume4.medium.h,
Modelica.Media.Water.IF97_Utilities.waterBaseProp_ph(V18.port_a.p, volume4.medium.h, 0, 0))
Modelica.Media.Water.IF97_Utilities.rho_ph(pipeB7Pump.port_b.p, V18.port_a.h_outflow, 0, 0)
Modelica.Media.Water.WaterIF97_ph.density_ph_Unique5(pipeB7Pump.port_b.p, V18.port_a.h_outflow, 0, 0)
Modelica.Media.Water.WaterI...

对于非常大的模型,这将被禁用(这将用附加指令编写在 C 代码中)。

可能可以构建一个调试版本的 dymosim(通过设置 Advanced.BuildDebugDymosim=true )并在这种情况下设置一个断点,然后从那里开始。