.BLDC.Functions.addIndex

Information

  result:= k + a;

and bring the result to the range [1, m] in a cyclic way, i.e. m + 1 -> 1 and 0 -> m. The addend can also be negative.

Interface

function addIndex
  extends Modelica.Icons.Function;
  input Integer k "Index";
  input Integer a "Addend";
  input Integer m "Max. index";
  output Integer result = 1 + mod(k + a - 1, m) "Resulting index";
end addIndex;

Generated at 2024-12-03T19:25:34Z by OpenModelicaOpenModelica 1.24.2 using GenerateDoc.mos