| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
This chapter describes routines for computing Chebyshev approximations
to univariate functions. A Chebyshev approximation is a truncation of
the series
, where the Chebyshev
polynomials
provide an orthogonal
basis of polynomials on the interval
with the weight
function
. The first few Chebyshev polynomials are,
,
,
.
For further information see Abramowitz & Stegun, Chapter 22.
The functions described in this chapter are declared in the header file ‘gsl_chebyshev.h’.
| 28.1 Definitions | ||
| 28.2 Creation and Calculation of Chebyshev Series | ||
| 28.3 Chebyshev Series Evaluation | ||
| 28.4 Derivatives and Integrals | ||
| 28.5 Examples | ||
| 28.6 References and Further Reading |
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
A Chebyshev series is stored using the following structure,
typedef struct
{
double * c; /* coefficients c[0] .. c[order] */
int order; /* order of expansion */
double a; /* lower interval point */
double b; /* upper interval point */
...
} gsl_cheb_series
|
The approximation is made over the range
using
order+1 terms, including the coefficient
. The series
is computed using the following convention,
which is needed when accessing the coefficients directly.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
This function allocates space for a Chebyshev series of order n
and returns a pointer to a new gsl_cheb_series struct.
This function frees a previously allocated Chebyshev series cs.
This function computes the Chebyshev approximation cs for the
function f over the range
to the previously specified
order. The computation of the Chebyshev approximation is an
process, and requires
function evaluations.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
This function evaluates the Chebyshev series cs at a given point x.
This function computes the Chebyshev series cs at a given point x, estimating both the series result and its absolute error abserr. The error estimate is made from the first neglected term in the series.
This function evaluates the Chebyshev series cs at a given point n, to (at most) the given order order.
This function evaluates a Chebyshev series cs at a given point x, estimating both the series result and its absolute error abserr, to (at most) the given order order. The error estimate is made from the first neglected term in the series.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
The following functions allow a Chebyshev series to be differentiated or integrated, producing a new Chebyshev series. Note that the error estimate produced by evaluating the derivative series will be underestimated due to the contribution of higher order terms being neglected.
This function computes the derivative of the series cs, storing the derivative coefficients in the previously allocated deriv. The two series cs and deriv must have been allocated with the same order.
This function computes the integral of the series cs, storing the integral coefficients in the previously allocated integ. The two series cs and integ must have been allocated with the same order. The lower limit of the integration is taken to be the left hand end of the range a.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
The following example program computes Chebyshev approximations to a step function. This is an extremely difficult approximation to make, due to the discontinuity, and was chosen as an example where approximation error is visible. For smooth functions the Chebyshev approximation converges extremely rapidly and errors would not be visible.
|
The output from the program gives the original function, 10-th order
approximation and 40-th order approximation, all sampled at intervals of
0.001 in
.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
The following paper describes the use of Chebyshev series,
| [ << ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
This document was generated by Autobuild on September, 26 2007 using texi2html 1.78.