非线性系统求解器无法收敛

时间:2019-11-19 13:16:32

标签: modelica openmodelica

there is outlet mass flow rate changing when the valve opens

我正在使用默认的dassl集成器。在我的模型中,使用布尔控制打开或关闭4个阀(2个共同作用)的体积。布尔值的状态(从1变为零)以毫秒为单位后,我收到以下错误消息:

am having this error msg

有什么办法找出导致问题的原因吗?

model CONTROLLER
  Modelica.Blocks.Interfaces.RealInput V_LT_min;
  Modelica.Blocks.Interfaces.RealInput V_LT_max;
  Modelica.Blocks.Interfaces.RealInput V_LT_lev;
  Modelica.Blocks.Interfaces.BooleanOutput open1(start=true);
  Modelica.Blocks.Interfaces.BooleanOutput open2(start=false);
equation 
  when (V_LT_lev <= V_LT_max) then
    open1 = true;
  elsewhen (V_LT_lev < V_LT_min) then
    open1 = false;
  end when;
  open2 = not open1;
end CONTROLLER;

model EV_LT
  package SI = Modelica.SIunits;
  package Medium = Modelica.Media.Water.WaterIF97_ph;
  Thermofluid_connector port_e;
  Thermofluid_connector port_s;
  parameter Real Kv=3.79;
  Modelica.Blocks.Interfaces.BooleanInput open;
  Real dbM;
  Real delta_p;
equation 
  //dbM=port_e.dbM;
  delta_p = (port_e.p - port_s.p)/10^5;
  if (delta_p >= 10^(-5)) then
    dbM = Kv*sqrt(delta_p)*1000/3600;
  else
    dbM = 0;
  end if;
  port_e.dbM = if open then dbM else 0;
  port_e.dbM + port_s.dbM = 0;
  port_s.dbH = port_s.dbM*port_s.h;
  port_e.h = port_s.h;
end EV_LT;

connector Thermofluid_connector
  package SI = Modelica.SIunits;
  SI.AbsolutePressure p;
  flow SI.MassFlowRate dbM;
  SI.SpecificEnthalpy h;
  flow SI.EnthalpyFlowRate dbH;
equation 

end Thermofluid_connector;

1 个答案:

答案 0 :(得分:0)

我对该模型进行了更深入的研究,我不知道为什么其中任何一个实际上都可以在您的系统上工作。我试图模拟模型EV_LT并遇到结构上的奇异之处,从系统上看很明显。

您定义方程式port_e.dbM + port_s.dbM = 0.0;,并且由于port_eport_s均未连接到任何东西,因此生成了方程式port_e.dbM = 0.0port_s.dbM = 0.0(将Flow设置为对于未连接的连接器为零)。这是三个方程,只有两个未知数->结构奇点。编译器实际上试图通过区分这些差异(索引减少)来解决此问题,但是您可能会想象,它不会产生任何其他信息。

确定要模拟上述确切模型吗?

如果您仅谈论控制器的仿真,那确实可行,但由于它完全不依赖于时间,因此非常令人兴奋。

编辑:是否可以提供正在使用的omc版本?我用1.14和1.16〜dev进行了测试。也许您有一个较旧的版本,应该升级。