在模型范围内找不到函数

Function not found in the scope of a model

我的简单 Modelica 代码如下并收到错误:在范围 interpo 中找不到函数 Vectors.interpolate。

model interpo
  import Modelica.SIunits.{Temperature, Length};
  import Modelica.Math.Vectors.interpolate;
  parameter Temperature thetas[5] = {45, 46, 54, 48, 51};
  parameter Length barycenters[5] ={2, 4, 6, 8, 10};
  parameter Length x_sens[3] = {3,5,7};
  Temperature thetas_sens[3];
 
equation
thetas_sens = Vectors.interpolate(barycenters, thetas, x_sens);

end interpo;

如果您能提供帮助,我将不胜感激。

equation 应该是 thetas_sens = interpolate(barycenters, thetas, x_sens),因为您已经导入了包 Vectors。这将消除错误并表明您不能使用自变量向量调用 interpolate。所以你必须遍历向量。