Half-interval search algorithm
function FindInterval extends Modelica.Icons.Function; input Real x "Input"; input Real[:] breaks "Grid points defining the intervals"; output Integer i "Found interval number"; output Integer error = 0 "1=did not find interval"; end FindInterval;