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.

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
| Type | Name | Default | Description |
|---|---|---|---|
| Real | xSup | {-1, 1, 5, 6} | Support points |
| Real | ySup | {-1, 1, 2, 10} | Support points |
Components
| Type | Name | Default | Description |
|---|---|---|---|
| Real | x | Independent variable | |
| Real | y | Dependent variable without monotone interpolation | |
| Real | yMonotone | Dependent variable with monotone interpolation | |
| Real | y2 | Dependent variable without monotone interpolation for n=2 | |
| Real | y2Monotone | Dependent variable with monotone interpolation for n=2 | |
| Real | y1 | Dependent variable without monotone interpolation for n=1 | |
| Real | y1Monotone | Dependent variable with monotone interpolation for n=1 |
Revisions
-
October 1, 2015, by Michael Wetter:
First implementation.