FILTLAN  1.0a
Functions
Chebyshev Polynomials

Functions

Vector ExpandNewtonPolynomialInChebyshevBasis (Real aa, Real bb, const Vector &a, const Vector &x)
 Translate the coefficients of a Newton polynomial to the coefficients in a basis of the ‘translated’ (scale-and-shift) Chebyshev polynomials. More...
 
Real PolynomialEvaluationInChebyshevBasis (const Vector &c, Real z0, Real aa=-1.0, Real bb=1.0)
 Evaluate P(z) at z=z0, where P(z) is a polynomial expanded in a basis of the ‘translated’ (i.e. scale-and-shift) Chebyshev polynomials. More...
 
Real PiecewisePolynomialEvaluationInChebyshevBasis (const Matrix &pp, const Vector &intv, Real z0, bool basisTranslated=true)
 Evaluate P(z) at z=z0, where P(z) is a piecewise polynomial expanded in a basis of the (optionally translated, i.e. scale-and-shift) Chebyshev polynomials for each interval. More...
 
Real PiecewisePolynomialInnerProductInChebyshevBasis (const Matrix &pp, const Matrix &qq, const Vector &intervalWeights)
 Compute the weighted inner product of two piecewise polynomials expanded in a basis of ‘translated’ (i.e. scale-and-shift) Chebyshev polynomials for each interval. More...
 
Matrix PiecewisePolynomialInChebyshevBasisMultiplyX (const Matrix &pp, const Vector &intv)
 compute Q(z) = z*P(z), where P(z) and Q(z) are piecewise polynomials expanded in a basis of ‘translated’ (i.e. scale-and-shift) Chebyshev polynomials for each interval. More...
 

Detailed Description

Function Documentation

◆ ExpandNewtonPolynomialInChebyshevBasis()

Vector ExpandNewtonPolynomialInChebyshevBasis ( Real  aa,
Real  bb,
const Vector &  a,
const Vector &  x 
)

Translate the coefficients of a Newton polynomial to the coefficients in a basis of the ‘translated’ (scale-and-shift) Chebyshev polynomials.

Parameters
a,xdefine a Newton polynomial as follows:
P(z) = a(1) + a(2)*(z-x(1)) + a(3)*(z-x(1))*(z-x(2)) + ... + a(n)*(z-x(1))*...*(z-x(n-1)).
[aa,bb]is the interval which defines the ‘translated’ Chebyshev polynomials Si(z) = Ti((z-c)/h), where c=(aa+bb)/2 and h=(bb-aa)/2, and
Ti(z) is the Chebyshev polynomial of the first kind T0(z)=1, T1(z)=z, and Ti(z)=2*z*Ti-1(z)+Ti-2(Z) for i>=2.
Returns
A vector q containing the Chebyshev coefficients, such that P(z) = q(1)*S0(z) + q(2)*S1(z) + ... + q(n)*Sn-1(z).

◆ PiecewisePolynomialEvaluationInChebyshevBasis()

Real PiecewisePolynomialEvaluationInChebyshevBasis ( const Matrix &  pp,
const Vector &  intv,
Real  z0,
bool  basisTranslated = true 
)

Evaluate P(z) at z=z0, where P(z) is a piecewise polynomial expanded in a basis of the (optionally translated, i.e. scale-and-shift) Chebyshev polynomials for each interval.

Parameters
intvis a vector which defines the intervals. The jth interval is [intv(j), intv(j+1)).
basisTranslatedtells whether the basis of Chebyshev polynomials are translated (basisTranslated==true) or not (basisTranslated==false).
ppis a matrix of Chebyshev coefficients which defines a piecewise polynomial in a basis of the (optionally translated) Chebyshev polynomials in each interval.
The polynomial Pj(z) in the jth interval, i.e. when z is in [intv(j), intv(j+1)), is defined by the jth column of pp.
  • If basisTranslated==false, then Pj(z) = pp(1,j)*T0(z) + pp(2,j)*T1(z) + ... + pp(n,j)*Tn-1(z), where
    Ti(z) is the Chebyshev polynomial of the first kind T0(z)=1, T1(z)=z, and Ti(z)=2*z*Ti-1(z)+Ti-2(Z) for i>=2.
  • If basisTranslated==true, then Pj(z) = pp(1,j)*S0(z) + pp(2,j)*S1(z) + ... + pp(n,j)*Sn-1(z), where
    Si(z) is the ‘translated’ Chebyshev polynomial Si((z-c)/h) = Ti(z), with c = (intv(j)+intv(j+1)) / 2 and h = (intv(j+1)-intv(j)) / 2.
z0is a number at which the piecewise polynomial P(z) is evaluated.
Returns
The evaluated value of P(z) at z=z0.
Remarks
If z0 falls below the first interval, then the polynomial in the first interval will be used for evaluting P(z0).
If z0 flies over the last interval, then the polynomial in the last interval will be used for evaluting P(z0).

◆ PiecewisePolynomialInChebyshevBasisMultiplyX()

Matrix PiecewisePolynomialInChebyshevBasisMultiplyX ( const Matrix &  pp,
const Vector &  intv 
)

compute Q(z) = z*P(z), where P(z) and Q(z) are piecewise polynomials expanded in a basis of ‘translated’ (i.e. scale-and-shift) Chebyshev polynomials for each interval.

P(z) and Q(z) are stored as matrices of Chebyshev coefficients pp and qq, respectively.

Parameters
intvis a vector which defines the intervals. The jth interval is [intv(j), intv(j+1)).
ppis a matrix of Chebyshev coefficients which defines the piecewise polynomial P(z).
For z in the jth interval [intv(j), intv(j+1)), P(z) equals Pj(z) = pp(1,j)*S0(z) + pp(2,j)*S1(z) + ... + pp(n,j)*Sn-1(z).
Returns
A matrix qq of Chebyshev coefficients which defines the piecewise polynomial Q(z).
For z in the jth interval [intv(j), intv(j+1)), Q(z) equals Qj(z) = qq(1,j)*S0(z) + qq(2,j)*S1(z) + ... + qq(n,j)*Sn-1(z).
Remarks
Here Si(z) is the ‘translated’ Chebyshev polynomial in the jth interval, with Si((z-c)/h) = Ti(z), c = (intv(j) + intv(j+1))/2, h = (intv(j+1) - intv(j))/2,
where Ti(z) is the Chebyshev polynomial of the first kind, T0(z) = 1, T1(z) = z, and Ti(z) = 2*z*Ti-1(z) - Ti-2(Z) for i>=2.
Returns
The matrix of coefficients qq which represents Q(z) = z*P(z).

◆ PiecewisePolynomialInnerProductInChebyshevBasis()

Real PiecewisePolynomialInnerProductInChebyshevBasis ( const Matrix &  pp,
const Matrix &  qq,
const Vector &  intervalWeights 
)

Compute the weighted inner product of two piecewise polynomials expanded in a basis of ‘translated’ (i.e. scale-and-shift) Chebyshev polynomials for each interval.

Parameters
intervalWeightsdefines the interval weights; intervalWeights(j) is the weight of the jth interval.
ppis a matrix of Chebyshev coefficients which defines the piecewise polynomial P(z).
For z in the jth interval, P(z) equals Pj(z) = pp(1,j)*S0(z) + pp(2,j)*S1(z) + ... + pp(n,j)*Sn-1(z).
qqis a matrix of Chebyshev coefficients which defines the piecewise polynomial Q(z).
For z in the jth interval, Q(z) equals Qj(z) = qq(1,j)*S0(z) + qq(2,j)*S1(z) + ... + qq(n,j)*Sn-1(z).
Remarks
Here Si(z) is the ‘translated’ Chebyshev polynomial in that interval [aa,bb], Si((z-c)/h) = Ti(z), c = (aa+bb))/2, h = (bb-aa)/2,
where Ti(z) is the Chebyshev polynomial of the first kind, T0(z) = 1, T1(z) = z, and Ti(z) = 2*z*Ti-1(z) - Ti-2(Z) for i>=2.

The (scaled) jth interval inner product is defined by <Pj,Qj> = ( $\pi$/2) * [ pp(1,j)*qq(1,j) + sumk pp(k,j)*qq(k,j) ],
which comes from the property <T0,T0>= $\pi$, <Ti,Ti>= $\pi$/2 for i>=1, and <Ti,Tj>=0 for i $\neq$j.

Returns
The weighted inner product is <P,Q> = sumj [ intervalWeights(j) * <Pj,Qj> ].
Remarks
For unit weights, pass an empty vector of intervalWeights (i.e. of length 0).

◆ PolynomialEvaluationInChebyshevBasis()

Real PolynomialEvaluationInChebyshevBasis ( const Vector &  c,
Real  z0,
Real  aa = -1.0,
Real  bb = 1.0 
)

Evaluate P(z) at z=z0, where P(z) is a polynomial expanded in a basis of the ‘translated’ (i.e. scale-and-shift) Chebyshev polynomials.

Parameters
cis a vector of Chebyshev coefficients which defines the polynomial P(z) = c(1)*S0(z) + c(2)*S1(z) + ... + c(n)*Sn-1(z), where
Si(z) is the ‘translated’ Chebyshev polynomial Si((z-c)/h) = Ti(z), with c = (aa+bb) / 2 and h = (bb-aa) / 2.
[aa,bb]is the interval which defines the ‘translated’ Chebyshev polynomials Si(z) = Ti((z-c)/h), where c=(aa+bb)/2 and h=(bb-aa)/2, and
Ti(z) is the Chebyshev polynomial of the first kind T0(z)=1, T1(z)=z, and Ti(z)=2*z*Ti-1(z)+Ti-2(Z) for i>=2.
z0is a number at which the piecewise polynomial P(z) is evaluated.
Returns
The evaluated value of P(z) at z=z0.