Learn R Programming

capn (version 2.0.0)

chebbasisgen: Generate Unidimensional Chebyshev Polynomial Basis

Description

Compute the monomial basis of Chebyshev polynomials for given unidimensional nodes \(s_{i}\) over a bounded interval \([a, b]\).

Usage

chebbasisgen(nodes, npol, a, b, dorder = NULL)

Value

A numeric matrix of dimension \(m \times n\), where \(m\) is the number of nodes and \(n = npol\), containing the Chebyshev polynomial basis (Vandermonde matrix) or its derivatives.

Arguments

nodes

A numeric vector of Chebyshev nodes \(s_{i}\) (an array of nodes in the capn package).

npol

An integer specifying the number of polynomials (\(n\) polynomials correspond to degree \(n-1\)).

a

The lower bound of the interval \([a, b]\).

b

The upper bound of the interval \([a, b]\).

dorder

Order of the partial derivative of the basis. The default NULL returns the basis itself. If dorder = 1, the first derivative is returned. Higher-order derivatives can be requested with dorder >= 2.

Details

Suppose there are \(m\) Chebyshev nodes over a bounded interval \([a, b]\):

\(s_{i} \in [a, b],\) for \(i = 1, 2, \ldots, m\).

These nodes are normalized to the standard Chebyshev domain \([-1, 1]\) as:

\(z_{i} = \frac{2(s_{i} - a)}{b - a} - 1\).

With normalized Chebyshev nodes, the recurrence relations for Chebyshev polynomials are:

\(T_{0}(z_{i}) = 1\),
\(T_{1}(z_{i}) = z_{i}\), and
\(T_{n}(z_{i}) = 2 z_{i} T_{n-1}(z_{i}) - T_{n-2}(z_{i})\).

The interpolation (Vandermonde) matrix of Chebyshev polynomials of degree up to \(n-1\) with \(m\) nodes, \(\Phi_{mn}\), is:

\( \Phi_{mn} = \left[ \begin{array}{ccccc} 1 & T_{1}(z_{1}) & \cdots & T_{n-1}(z_{1})\\ 1 & T_{1}(z_{2}) & \cdots & T_{n-1}(z_{2})\\ \vdots & \vdots & \ddots & \vdots\\ 1 & T_{1}(z_{m}) & \cdots & T_{n-1}(z_{m}) \end{array} \right] \).

Derivatives of the basis are computed using the identity:

\((1 - z_{i}^{2}) T'_{n}(z_{i}) = n \left[ T_{n-1}(z_{i}) - z_{i} T_{n}(z_{i}) \right].\)

Further technical details on Chebyshev polynomial bases can be found in Amparo et al. (2007) and Miranda and Fackler (2002).

References

Amparo, Gil, Javier Segura, and Nico Temme (2007). Numerical Methods for Special Functions. Cambridge: Cambridge University Press.

Fenichel, Eli P. and Joshua K. Abbott. (2014). Natural Capital: From Metaphor to Measurement. Journal of the Association of Environmental Economists, 1(1/2), 1--27. tools:::Rd_expr_doi("10.1086/676034")

Miranda, Mario J. and Paul L. Fackler (2002). Applied Computational Economics and Finance. Cambridge: MIT Press.

See Also

chebnodegen

Examples

Run this code
## Reef-fish example: see Fenichel and Abbott (2014)
data("GOM")
param <- GOM$param
nodes <- chebnodegen(
  param$nodes,
  param$lowerK,
  param$upperK
)

## Chebyshev polynomial basis
chebbasisgen(nodes, 20, 0.1, 1.5)

## First derivative of the Chebyshev polynomial basis
chebbasisgen(nodes, 20, 0.1, 1.5, dorder = 1)

Run the code above in your browser using DataLab