functionsmoothInterpolation

Interpolate using a cubic Hermite spline with linear extrapolation for a vector xSup[], ySup[] and independent variable x

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

Information

For xSup1 ≤ x ≤ xSupn, where n is the size of the support points xSup, which must be strictly monotonically increasing, this function interpolates using cubic hermite spline. For x outside this interval, the function linearly extrapolates.

If n=2, linear interpolation is used an if n=1, the function value y1 is returned.

Note that if xSup and ySup only depend on parameters or constants, then IBPSA.Utilities.Math.Functions.cubicHermiteLinearExtrapolation will be more efficient. In contrast to the function Modelica.Math.Vectors.interpolate which provides linear interpolation, this function does not trigger events.

For how to use this function, see IBPSA.Utilities.Math.Functions.Examples.SmoothInterpolation.

Inputs

TypeNameDefaultDescription
RealxAbscissa value
Real[:]xSupSupport points (strictly increasing)
Real[size(xSup, 1)]ySupFunction values at xSup
BooleanensureMonotonicityisMonotonic(ySup, strict = false)Set to true to ensure monotonicity of the cubic hermite

Outputs

TypeNameDefaultDescription
RealyIntInterpolated ordinate value

Revisions

  • October 1, 2015, by Michael Wetter:
    First implementation.