本文介绍了当前版本的 modelica 转换器只能处理固定大小的组件数组的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用 AC 库创建了一个零件,当我尝试模拟模型时,出现错误提示当前版本的 modelica 转换器只能处理固定大小的组件数组".

I created an part with the AC library, and when I was trying to simulate the model, there is an error says "Current version of the modelica translator can only handle array of components with fixed size".

不知道是什么意思,有没有人遇到过这样的问题?

Not sure what is the meaning of it, and is there anyone has the same issue like this one?

谢谢

在此处输入图片说明

推荐答案

考虑以下简单模型:

model M
  parameter Integer n(start=3, fixed=false);
initial algorithm
  n := n;
end M;

它有一个参数 n 可以在模拟开始之前更改.并且数组维度需要是参数表达式.所以你会认为以下模型是合法的:

It has a parameter n which can be changed before simulation starts. And array dimensions need to be parameter expressions. So you would think that the following model would be legal:

model M2
  Real arr[n] = fill(1, n);
  parameter Integer n(start=3, fixed=false);
initial algorithm
  n := n;
end M2;

但这并不是因为 Modelica 工具会扩展方程和变量的数量以获得固定数量.(根据语言规范,n 是一个结构参数;它没有很好地定义它们有什么限制——大多数 Modelica 工具似乎要求它们表现得像常量,这意味着只有 fixed=true 参数带有仅依赖于其他结构参数或常数的绑定方程).

But it isn't since Modelica tools will expand the number of equations and variables to get a fixed number. (According to the language specification, n is a structural parameter; it is not well defined what restrictions these have - most Modelica tools seem to require them to behave like constants which means only fixed=true parameters with a binding equation that depends only on other structural parameters or constants).

这篇关于当前版本的 modelica 转换器只能处理固定大小的组件数组的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-27 16:05