.BusinessSimulation.Functions.rawInterpolate

Information

This information is part of the Business Simulation Library (BSL). Please support this work and ► donate.

The output y is the interpolated value given a list of tuples (tuples = { {x1,y1}, {x2,y2}, ...}) and the index value jlo as a result from the functions hunt() or locate().

Syntax


Functions.rawInterpolate(x, tuples, jlo);

Examples


rawInterpolate(1.5, {{0,1},{1,2}, {2,4},{3,5}}, 2); // 3.0

See also

interpolate, locate, hunt

Interface

encapsulated function rawInterpolate
  import BusinessSimulation.Icons.Function;
  import BusinessSimulation.Functions.bitShiftRight;
  extends Function;
  input Real x "Value to locate in a list";
  input Real[:, 2] tuples "Ordered list of values";
  input Integer jlo "Index value to the left of x";
  output Real y "Interpolated value";
end rawInterpolate;

Revisions


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