222
18 Chebyshev Polynomials
The output arguments are the class object “obj” and an array of the polynomial
coefficients “C”. The rows run from degree equal to 0 up to the maximum value n,
and the columns are from right to left the coefficient to x 0 , x 1 , · · · x n . The object
“obj” comes with properties “polycoef”, a table of the polynomial coefficients,
“polynorm”, a vector of the norm, “polyint”, the normalization interval (value either
[−1, +1] or [0, 1] for the shifted Chebyshev polynomials, and “info”, with the
information about the kind of polynomial.
The Class chebyx
The SPECFUNPHYS class chebyx returns the polynomial values by choosing
one of the computational methods listed above. The syntax is [obj, P] =
chebyx(n, x, wcheby, wcom, grtrafo) with input arguments “n”, the
maximum degree of the Chebyshev polynomial; “x”, the position at which the
polynomials shall be evaluated (optional with default values −1 · · · + 1 for
Chebyshev polynomials and 0 · · · 1 for shifted Chebyshev polynomials). “wcheby”
to select the polynomial in quest with default value “T”; for the possible values see
chebypoly. “wcom” (optional) serves for selecting the computational method for
the polynomial evaluation. Default value is “rec”, and the evaluation is based on
the recurrence equations; for “direct” or “d” the evaluation is based on Eqs. (18.11)
and for “2F1” the evaluation is based on the representation of the polynomials via
Gauss hypergeometric functions, Eqs. (18.13). Whereas for convenience the shifted
Chebyshev polynomials can be evaluated by selecting the corresponding name (see
chebypoly above), general shifted polynomials, Eq. (18.7), can be computed with
the help of the optional input argument “grtrafo” a two-component real vector of the
scaling interval [a, b].
Example, see Fig. 18.2:
% Visualization of T(x) scaled versus non-scaled
n = 3;
% polynomial degree
x = linspace(-0.5,1.5);
% position for
%
evaluation
gr = [-0.5,1.5];
% scaling interval
% the non-scaled polynomial:
yT = chebyx(n, x, ’T’, ’d’).value;
% scaled with respect to gr:
yTgr = chebyx(n,x,’T’, ’d’, gr).value;
figure, plot(x,yT,x,yTgr), shg
legend(’T’, ’T-s’)
The output arguments are the class object “obj” and an array of the polynomial
values “C”. The object comes with the properties “value”, the polynomial values and
C = obj.value. “z”, the position at which the function was evaluated, “degree”,
the input value n (degree of the polynomial) and “info” with information about the
evaluation method and the Chebyshev polynomial.
18 Chebyshev Polynomials
The output arguments are the class object “obj” and an array of the polynomial
coefficients “C”. The rows run from degree equal to 0 up to the maximum value n,
and the columns are from right to left the coefficient to x 0 , x 1 , · · · x n . The object
“obj” comes with properties “polycoef”, a table of the polynomial coefficients,
“polynorm”, a vector of the norm, “polyint”, the normalization interval (value either
[−1, +1] or [0, 1] for the shifted Chebyshev polynomials, and “info”, with the
information about the kind of polynomial.
The Class chebyx
The SPECFUNPHYS class chebyx returns the polynomial values by choosing
one of the computational methods listed above. The syntax is [obj, P] =
chebyx(n, x, wcheby, wcom, grtrafo) with input arguments “n”, the
maximum degree of the Chebyshev polynomial; “x”, the position at which the
polynomials shall be evaluated (optional with default values −1 · · · + 1 for
Chebyshev polynomials and 0 · · · 1 for shifted Chebyshev polynomials). “wcheby”
to select the polynomial in quest with default value “T”; for the possible values see
chebypoly. “wcom” (optional) serves for selecting the computational method for
the polynomial evaluation. Default value is “rec”, and the evaluation is based on
the recurrence equations; for “direct” or “d” the evaluation is based on Eqs. (18.11)
and for “2F1” the evaluation is based on the representation of the polynomials via
Gauss hypergeometric functions, Eqs. (18.13). Whereas for convenience the shifted
Chebyshev polynomials can be evaluated by selecting the corresponding name (see
chebypoly above), general shifted polynomials, Eq. (18.7), can be computed with
the help of the optional input argument “grtrafo” a two-component real vector of the
scaling interval [a, b].
Example, see Fig. 18.2:
% Visualization of T(x) scaled versus non-scaled
n = 3;
% polynomial degree
x = linspace(-0.5,1.5);
% position for
%
evaluation
gr = [-0.5,1.5];
% scaling interval
% the non-scaled polynomial:
yT = chebyx(n, x, ’T’, ’d’).value;
% scaled with respect to gr:
yTgr = chebyx(n,x,’T’, ’d’, gr).value;
figure, plot(x,yT,x,yTgr), shg
legend(’T’, ’T-s’)
The output arguments are the class object “obj” and an array of the polynomial
values “C”. The object comes with the properties “value”, the polynomial values and
C = obj.value. “z”, the position at which the function was evaluated, “degree”,
the input value n (degree of the polynomial) and “info” with information about the
evaluation method and the Chebyshev polynomial.
