Learn R Programming

capn (version 2.0.0)

chebnodegen: Unidimensional Chebyshev Nodes

Description

Generate unidimensional Chebyshev nodes over a bounded interval.

Usage

chebnodegen(n, a, b)

Value

A numeric vector of length \(n\) containing Chebyshev nodes.

Arguments

n

An integer specifying the number of nodes.

a

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

b

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

Details

A polynomial approximant \(s_{i}\) over a bounded interval \([a, b]\) is constructed using Chebyshev nodes as:

\( s_{i} = \frac{b + a}{2} + \frac{b - a}{2} \cos \left( \frac{n - i + 0.5}{n} \pi \right) \) for \(i = 1, 2, \ldots, n\).

Further details can be found in Miranda and Fackler (2002, p.~119).

References

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

Examples

Run this code
## 10 Chebyshev nodes in [-1, 1]
chebnodegen(10, -1, 1)

## 5 Chebyshev nodes in [1, 5]
chebnodegen(5, 1, 5)

Run the code above in your browser using DataLab