.Modelica.Math.Vectors.length

Information

Syntax

Vectors.length(v);

Description

The function call "Vectors.length(v)" returns the Euclidean length "sqrt(v*v)" of vector v. The function call is equivalent to Vectors.norm(v). The advantage of length(v) over norm(v) is that function length(..) is implemented in one statement and therefore the function is usually automatically inlined. Further symbolic processing is therefore possible, which is not the case with function norm(..).

Example

v = {2, -4, -2, -1};
length(v);  // = 5

See also

Vectors.norm

Interface

function length
  extends Modelica.Icons.Function;
  input Real v[:] "Real vector";
  output Real result "Length of vector v";
end length;

Generated at 2024-12-26T19:25:54Z by OpenModelicaOpenModelica 1.24.3 using GenerateDoc.mos