Back to library index.
Package cheby (in cheby.i) -
Index of documented functions or symbols:
DOCUMENT fit = cheby_conv(poly, interval) convert polynomial coefficients POLY = [a0, a1, ..., aN] to a Chebyshev fit suitable for input to cheby_eval. The INTERVAL = [xmin,xmax] is the most stable region for evaluation. Omitting INTERVAL gives the natural interval [-1,1] for Chebyshev polynomials. You may also pass another Chebyshev fit (from cheby_fit) as the INTERVAL to use the same interval as that fit.
SEE ALSO: cheby_fit, cheby_eval, cheby_poly
DOCUMENT cheby_deriv(fit) returns Chebyshev fit to the derivative of the function of the input Chebyshev FIT.
SEE ALSO: cheby_fit, cheby_integ
DOCUMENT cheby_eval(fit, x) evaluates the Chebyshev fit (from cheby_fit) at points X. the return values have the same dimensions as X.
SEE ALSO: cheby_fit
DOCUMENT fit = cheby_fit(f, interval, n)
or fit = cheby_fit(f, x, n)
returns the Chebyshev fit (for use in cheby_eval) of degree N
to the function F on the INTERVAL (a 2 element array [a,b]).
In the second form, F and X are arrays; the function to be
fit is the piecewise linear function of xp interp(f,x,xp), and
the interval of the fit is [min(x),max(x)]. You can use the
nterp= keyword to set a different interpolator, which must have
the same calling sequence as interp (e.g.- nterp=spline).
The return value is the array [a,b, c0,c1,c2,...cN] where [a,b]
is the interval over which the fit applies, and the ci are the
Chebyshev coefficients. It may be useful to use a relatively
large value of N in the call to cheby_fit, then to truncate the
resulting fit to fit(1:3+m) before calling cheby_eval.
SEE ALSO: cheby_eval, cheby_integ, cheby_deriv, cheby_poly, cheby_conv, cheby_trunc, rcheby_fit
DOCUMENT cheby_integ(fit)
or cheby_integ(fit, x0)
returns Chebyshev fit to the integral of the function of the
input Chebyshev FIT. If X0 is given, the returned integral will
be zero at X0 (which should be inside the fit interval fit(1:2)),
otherwise the integral will be zero at x=fit(1).
SEE ALSO: cheby_fit, cheby_deriv
DOCUMENT cheby_poly(fit) returns coefficients An of x^n as [A0, A1, A2, ..., An] for the given FIT returned by cheby_fit. You should only consider actually using these for very low degree polynomials; cheby_eval is nearly always a superior way to evaluate the polynomial.
SEE ALSO: cheby_fit, cheby_conv
DOCUMENT tfit = cheby_trunc(fit, err)
or tfit = cheby_trunc(fit, err, e)
truncate cheby_fit FIT to relative error ERR by dropping trailing
Chebyshev coefficients smaller than ERR. If ERR is omitted, it
defaults to 1.e-9. Optionally returns E, which is the list of
relative errors incurred by dropping each order [e0, e1, ... eN].
Often there will be a sudden improvement with some order, which
can assist you with selecting an appropriate truncation.
SEE ALSO: cheby_fit
