.ThermoSysPro.Functions.SplineInterpolation

Information

ThermoSysPro Version 3.1

Spline interpolation function. The resulting spline will be continuous and have a continuous first derivative.

Implementation

It uses a cardinal spline interpolation algorithm. Cardinal splines are a sub-set of cubic Hermite splines where each piece is a third-degree polynomial specified in Hermite form: i.e specified by its values and the first derivatives at the end points of the reference interval.

The derivatives are calculated based on the non-uniform cardinal grid approach according to:

y1_der=0.5(1-t)(y1-y0/(x1-x0)+(y2-y1/(x2-x1)

I.e. the derivative in a point is calculated as an average of the surrounding points with an extra input shape parameter t.

Inputs

Output

Extrapolation

Linear extrapolation is employed if the reference value is not contained in the reference value table.

Example

References

http://people.cs.clemson.edu/~dhouse/courses/405/notes/splines.pdf

Interface

function SplineInterpolation
  input Real TabX[:] "References table";
  input Real TabY[:] "Results table";
  input Real X "Reference value";
  input Real t(max = 1) = 0.5 "Stiffness parameter";
  output Real Y "Interpolated result";
end SplineInterpolation;

Revisions


Generated at 2024-04-26T18:16:04Z by OpenModelicaOpenModelica 1.22.3 using GenerateDoc.mos