5.27.33 Rational interpolation without poles: ratinterp
The ratinterp command computes a family of pole-free rational functions which interpolate given data.
Rational interpolation usually gives better results than the classic polynomial interpolation, which may oscillate highly in some cases.
ratinterp takes up to three arguments:
Matrix data with 2 columns with rows corresponding to points (xk,yk), k=0,1,…,n, or the sequence of lists data_x=[x0,x1,…,xn] and data_y=[y0,y1,…,yn], where a=x0<x1<⋯<xn=b,
an identifier var, which may also be a number, symbolic expression or list of numbers a (optional, by default x),
an integer d such that 0≤ d≤ n (optional, by default 0).
ratinterp(data⟨,var,d⟩) or ratinterp(data_x,data_y⟨,var,d⟩) returns a rational interpolation r(a) of the given points using the method of Floater and Hormann (2006). If a is a list of numbers a1,a2,…,am, then the list [r(a1)…,r(am)] is returned. There are at most n+1 distinct interpolants which can be specified by varying the parameter d.