Piecewise linear function
function Piecewise input Real x "Independent variable"; input Real x_grid[:] "Independent variable data points"; input Real y_grid[:] "Dependent variable data points"; output Real y "Interpolated result"; end Piecewise;