Sum of the diagonal elements of A
function trace extends Modelica.Icons.Function; input Real A[:, size(A, 1)]; output Real result; end trace;