This function outputs the average of the vector.
function average extends Modelica.Icons.Function; input Integer nin "Number of inputs"; input Real u[nin] "Input vector"; output Real y "Result"; end average;