An implementation of Kreisselmeier Steinhauser smooth maximum
function smoothMax_der extends Modelica.Icons.Function; import Modelica.Math.exp; import Modelica.Math.log; input Real x1 "First argument of smooth max operator"; input Real x2 "Second argument of smooth max operator"; input Real dx "Approximate difference between x1 and x2, below which regularization starts"; input Real dx1; input Real dx2; input Real ddx; output Real dy "Derivative of smooth max operator"; end smoothMax_der;