functionregFun3

Co-monotonic and C1 smooth regularization function

Extends from Modelica.Icons.Function (Icon for functions).

Information

Approximates a function in a region between x0 and x1 such that

  • The overall function is continuous with a continuous first derivative everywhere.
  • The function is co-monotone with the given data points.

In this region, a continuation is constructed from the given points (x0, y0), (x1, y1) and the respective derivatives. For this purpose, a single polynomial of third order or two cubic polynomials with a linear section in between are used [Gasparo and Morandi, 1991]. This algorithm was extended with two additional conditions to avoid saddle points with zero/infinite derivative that lead to integrator step size reduction to zero.

This function was developed for pressure loss correlations properly addressing the static head on top of the established requirements for monotonicity and smoothness. In this case, the present function allows to implement the exact solution in the limit of x1-x0 -> 0 or y1-y0 -> 0.

Typical screenshots for two different configurations are shown below. The first one illustrates five different settings of xi and yid:

regFun3_a.png

The second graph shows the continuous derivative of this regularization function:

regFun3_a.png

Literature

Gasparo M. G. and Morandi R. (1991):
Piecewise cubic monotone interpolation with assigned slopes. Computing, Vol. 46, Issue 4, December 1991, pp. 355 - 365.

Inputs

TypeNameDefaultDescription
RealxAbscissa value
Realx0Lower abscissa value
Realx1Upper abscissa value
Realy0Ordinate value at lower abscissa value
Realy1Ordinate value at upper abscissa value
Realy0dDerivative at lower abscissa value
Realy1dDerivative at upper abscissa value

Outputs

TypeNameDefaultDescription
RealyOrdinate value
RealcSlope of linear section between two cubic polynomials or dummy linear section slope if single cubic is used

Revisions

  • May 2008 by Michael Sielemann:
    Designed and implemented.
  • February 2011 by Michael Sielemann:
    If the inflection point of the cubic S0 was at +/- infinity, the test criteria of [Gasparo and Morandi, 1991] result in division by zero. This case is handled properly now.
  • March 2013 by Michael Sielemann:
    If the arguments prescribed a degenerate case with points (x0,y0) and (x1,y1) on horizontal line, then return value c was undefined. This was corrected. Furthermore, an additional term was included for the computation of y in this case to assist automatic differentiation.