modelCubicHermite

Test problem for cubic hermite splines

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

Parameters

TypeNameDefaultDescription
Realxd{-1, 1, 5, 6}Support points
Realyd{-1, 1, 2, 10}Support points
RealdDerivatives at the support points
RealdMonotoneDerivatives at the support points
BooleanensureMonotonicitytrue

Components

TypeNameDefaultDescription
RealxIndependent variable
RealyDependent variable without monotone interpolation
RealyMonotoneDependent variable with monotone interpolation
IntegeriInteger to select data interval

Revisions

  • March 8, 2013, by Michael Wetter:
    First implementation.