# 警告(3617)

# 3617-1

# 警告信息

内置函数 %1!s! 参数类型不匹配 ,%2!s! 要求为数组.

# 产生原因

语义规定内置函数 sum(A), product(A) 的参数应为数组, 当参数为变量时则产生警告 3617.

# 解决方法

将内置函数 sum, product 的参数统一为数组.

# 示例

model _3617_ParaTypeInBuildInError
  Real x;              // Warning: 3617
  //Real x[3];             // OK
  Real y = product(x); 
end _3617_ParaTypeInBuildInError;

# 3617-2

# 警告信息

内置函数 %1!s! 的调用参数 %2!s! 是数组, 与 connect 不同, 它作为整体对待.

# 产生原因

超定连接中内置函数 root 的参数为数组时产生警告 3617-2.

# 解决方法

将超定连接中的 root 内置函数的参数修改为标量.

# 示例

model _3617_2_ParaInBuiltInFuncIsArray
  type TMatrix = Real[3, 3];
  type Orient
    extends TMatrix;
    function equalityConstraint
      input Orient R1;
      input Orient R2;
      output Real residue[3];
    protected
      Orient R_rel;
    algorithm
      R_rel := R2 * transpose(R1);
    end equalityConstraint;
  end Orient;
  connector Fream
    Orient R[2];
  end Fream;
  Fream fream_a;
  record A
    Real x;
  end A;
  A a;
equation
  Connections.root(fream_a.R); // Warning 3617-2
end _3617_2_ParaInBuiltInFuncIsArray;