在我看来,以下简单的function
是完全合法的Modelica代码:
function foo "Returns true"
input Boolean[:] x "Vector of booleans";
output Boolean y "= true, in any case here";
algorithm
y := true;
end foo;
在Check Model
中使用OpenModelica v1.16.2 (64-bit)
会引发一个错误:
[1] 15:15:11 Translation Error
[foo: 2:3-2:42]: Failed to deduce dimension 1 of x due to missing binding equation.
Modelica代码有什么问题吗?或者这是OME问题?
编辑
只是为了表明,这实际上不是一个明确的案例:
这是在Wolfram 12.2中验证foo
时得到的消息:
3 10:59函数foo的验证
函数foo的验证成功完成.
发布于 2021-01-31 15:07:08
错误信息应该是:"OpenModelica不检查或实例化函数。要测试函数,请在模型中使用它。“
https://stackoverflow.com/questions/65979673
复制相似问题