Up | Next | Prev | PrevTail | Tail |
The operator family \(Chebyshev\_\ldots \) implements approximation and evaluation of functions by the Chebyshev method. Let \(T_n^{(a,b)}(x)\) be the Chebyshev polynomial of order \(n\) transformed to the interval \((a,b)\). Then a function \(f(x)\) can be approximated in \((a,b)\) by a series
\((fcn,var=(lo .. hi),n)\)
\((coeffs,var=(lo .. hi),var=pt)\)
\((coeffs,var=(lo .. hi))\)
\((coeffs,var=(lo .. hi))\)
where \(\langle \)fcn\(\rangle \) is an algebraic expression (the function to be fitted), \(\langle \)var\(\rangle \) is the variable of \(\langle \)fcn\(\rangle \), \(\langle \)lo\(\rangle \) and \(\langle \)hi\(\rangle \) are numerical real values which describe an interval (\(lo < hi\)), \(\langle \)n\(\rangle \) is the approximation order, a positive integer, set to 20 if missing, \(\langle \)pt\(\rangle \) is a numerical value in the interval and \(\langle \)coeffs\(\rangle \) is a series of Chebyshev coefficients, computed by one of the operators chebyshev_coeff, chebyshev_df, or chebyshev_int.
Example:
on rounded; w:=chebyshev_fit(sin x/x,x=(1 .. 3),5); w := {0.0382345446975*x - 0.239802588672*x + 0.0651206939005*x + 0.977836217464, {0.899091895826,-0.406599215895, -0.00519766024352,0.00946374143079, -0.0000948947435876}} chebyshev_eval(second w, x=(1 .. 3), x=2.1); 0.411091086819
Up | Next | Prev | PrevTail | Front |