Linear Interpolation
Back to Portal
Maple has multiple tools for interpolation, including linear, spline and more. Here we demonstrate how to linearly interpolate data.
Experimental Data
This data was recorded during experiments on the outflow of a pump. The first column is time, while the second column is volumetric flowrate.
flowData≔0.00.21.02.02.03.55.06.07.09.09.08.010.08.015.010.016.011.019.012.0:
T≔flowData..,1:Q≔flowData..,2:
Create a Linear Interpolation Function
flowInterpolated ≔t→CurveFitting:-ArrayInterpolationT, Q, t
flowInterpolated≔t↦CurveFitting:−ArrayInterpolation⁡T,Q,t
Hence at the time of 2.7, the interpolated flowrate is
flowInterpolated2.7
4.08333333333333
Plot the original experimental data against the linearly-interpolation values.
f≔plotflowInterpolated,minT..maxT:
g≔plotT,Q,style=point,symbol=solidcircle,symbolsize=20:
plots:-displayf,g
Download Help Document