【发布时间】:2020-12-08 13:26:25
【问题描述】:
我在 Dymola 中构建了一个简单的模型,在不同时期使用不同的方程,但令我惊讶的是,Dymola 无法处理这个简单的模型。索引减少后,系统似乎是单一的。
我的问题是:
- 这是使用 Modelica 时常见的问题吗?
- 如果是这样,我应该如何修改这个模型,我知道当我用
der(x)=0替换方程x=100时,模型工作正常,但我想知道是否有更复杂情况的通用规则。如果能提供详细的解释,我将不胜感激。
这是模型的代码:
model ErrorWhenUsingIf
Real x(start=100);
equation
if time<=0.5 then
x=100;
else
der(x)=5;
end if;
end ErrorWhenUsingIf;
错误信息是:
Failed to evaluate model for ODE-Jacobian
Error: The following error was detected at time: 7.62939453125E-012
Error: Singular inconsistent scalar system for der(x) = ( -(if time <= 0.5 then x-100 else -5.0))/((if time <= 0.5 then 0.0 else 1.0)) = 8e-008/0
Solver will attempt to handle this problem.
Failed to evaluate model for ODE-Jacobian
【问题讨论】: