modelSmoothInterpolation

Test problem for cubic hermite splines that takes a vector of values as an argument

Extends from Modelica.Icons.Example (Icon for runnable examples).

Information

This example demonstrates the use of the function for cubic hermite interpolation and linear extrapolation. The example use interpolation with two different settings: One settings produces a monotone cubic hermite, whereas the other setting does not enforce monotonicity. The resulting plot should look as shown below, where for better visibility, the support points have been marked with black dots. Notice that the red curve is monotonically increasing.

image

This example also tests the function for the situation where only 2 or only 1 support points are provided. In the first case, the result will be linear function and in the second case, a constant value.

Parameters

TypeNameDefaultDescription
RealxSup{-1, 1, 5, 6}Support points
RealySup{-1, 1, 2, 10}Support points

Components

TypeNameDefaultDescription
RealxIndependent variable
RealyDependent variable without monotone interpolation
RealyMonotoneDependent variable with monotone interpolation
Realy2Dependent variable without monotone interpolation for n=2
Realy2MonotoneDependent variable with monotone interpolation for n=2
Realy1Dependent variable without monotone interpolation for n=1
Realy1MonotoneDependent variable with monotone interpolation for n=1

Revisions

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