1

在我看来,以下简单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 ModelinOpenModelica 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 问题?

编辑

只是为了表明,这实际上不是一个明确的案例:
这是foo在 Wolfram System Modeler 12.2 中验证时得到的消息:

[3] 10:59 验证函数 foo
验证函数 foo 成功完成。

4

1 回答 1

4

错误消息应该是:“OpenModelica 不检查或实例化函数。要测试函数,请在模型中使用它。”

于 2021-01-31T15:07:08.383 回答