.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-04-28T18:16:21Z by OpenModelicaOpenModelica 1.22.3 using GenerateDoc.mos