Getting Started | Documentation | Glish | Learn More | Programming | Contact Us |
Version 1.9 Build 1556 |
|
Package | utility | |
Module | functionals | |
Tool | functionalserver |
order | in | order of the polynomial | |
Allowed: | integer | ||
Default: | 0 | ||
params | in | the Chebyshev coefficients | |
Allowed: | numeric | ||
Default: | all 0 | ||
xmin | in | the minimum value of the interval of interest | |
Allowed: | numeric | ||
Default: | -1 | ||
xmax | in | the maximum value of the interval of interest | |
Allowed: | numeric | ||
Default: | -1 | ||
ooimode | in | the ``out-of-interval'' mode. This controls what gets returned when an input value to the function is outside the interval of interest. | |
Allowed: | 'constant' | ||
Default: | a minimum match to the following values: 'constant' - the value of the def argument; 'zeroth' - the value of the zero-th order coefficient; 'extrapolate' - the function evaluated explicitly at the input value; 'cyclic' - the function evaluated at the input value after ``folding'' it into the interval of interest; 'edge' - the function evaluated at the nearest edge of the interval of interest | ||
def | in | the default value to return for input values outside of the interval of interest when ooimode='constant' | |
Allowed: | numeric | ||
Default: | 0 |
This function creates a functional representing a Chebyshev series, a linear combination of so-called Chebyshev polynomials.
About Chebyshev Polynomials
Chebyshev polynomials are a special type of ultraspheric polynomials that are useful in such contexts as numerical analysis and circuit design. They form an orthogobnal set. A (type I) Chebyshev polynomial, Tn, is generated via the equation:
Tn(x) = cosn(arccos x) | (1.1) |
Through clever use of trigometric identities, one can express Tn as a real polynomial expression of the form
Tn(x) = Citi | (1.2) |
T0 | = | 1 | (1.3) |
T1 | = | x | (1.4) |
T2 | = | 2x2 - 1 | (1.5) |
T3 | = | 4x3 - 3x | (1.6) |
T4 | = | 8x4 - 8x2 + 1 | (1.7) |
T5 | = | 16x5 - 20x3 + 5x | (1.8) |
Tn + 1 = 2xTn - Tn - 1. | (1.9) |
A common use of Chebyshev polynomials is in approximating functions. In particular, any function that is approximated by a power series,
f (x) Pixi, | (1.10) |
f (x) CiTi(x), | (1.11) |
Approximating a function with Chebyshev polynomials has some important advantages. For one, if the function is well approximated by a converging power series, one can obtain an equally accurate estimate using fewer terms of the corresponding Chebyshev series. More important, though, is the property over the interval [-1, 1], each polynomial has a domain of [-1, 1]; thus, the series is nicely bounded. And because of this bounded property, approximations calculated from a Chebyshev series are less susceptible to machine rounding errors than the equivalent power series.
The ``Interval of Interest''
Of course, in most real applications of these polynomials, one doesn't want to be limited to the [-1, 1] interval; thus, it is necessary to map the actual interval of interest into [-1, 1] before evaluating the series. The chebyshev functional supports this automatically when one sets the xmin and xmax arguments to this function. The mapping of values within this interval into [-1, 1] is done as follows:
x = x - (min + max)/2)/((max - min)/2) | (1.12) |
When the functional is evaluated via f(), the input values are first tranformed in the above way, and then the series is evaluated using the given coefficients. This is assuming the input value is within the interval of interest.
The behavior of the function when the value is outside the interval of interest is configurable via the ooimode. The choices are as follows:
The default out-of-interval mode is constant.
- cheb := dfs.chebyshev(2, [2, 3, 4]) - cheb.state() [type=9, order=2, ndim=1, npar=3, params=[2 3 4] , masks=[T T T] , mode=[interval=[-1 1] , default=0, intervalMode=constant]] - cheb.f([0, 0.5, 1, 2, 5]) [-2 1.5 9 0 0] - cheb := dfs.chebyshev(2, [2, 3, 4], xmin=0, xmax=2, ooimode='extrap') [type=9, order=2, ndim=1, npar=3, params=[2 3 4] , masks=[T T T] , mode=[interval=[0 2] , default=0, intervalMode=extrapolate]] - cheb.state() - cheb.f([0, 0.5, 1, 2, 5]) [3 -1.5 -2 9 138]