ChebPoints | R Documentation |
ChebPoints(N, interval)
evaluates N
chebpoints on the given interval [a,b]
.
ChebPoints(N, interval)
N |
number of chebpoints required. |
interval |
vector containing lower and upper bound of interval. |
Function returns N
chebpoints on the given interval.
Ver.: 16-Sep-2018 21:16:55 (consistent with Matlab CharFunTool v1.3.0, 24-Jul-2017 10:06:48).
Other Utility Function:
ChebCoefficients()
,
ChebPolyValues()
,
ChebPoly()
,
ChebValues()
,
GammaLog()
,
GammaMultiLog()
,
GammaMulti()
,
GammaZX()
,
Hypergeom1F1MatApprox()
,
Hypergeom1F1Mat()
,
Hypergeom2F1Mat()
,
Hypergeom2F1()
,
HypergeompFqMat()
,
InterpChebValues()
,
hypergeom1F1()
,
interpBarycentric()
## EXAMPLE 1
# Barycentric interpolant of the Sine function on (-pi,pi)
domain<-c(-pi,pi)
x <- ChebPoints(32, c(-pi, pi))
f <- list(sin(x[[1]]))
xNew <- seq(from = -pi,
to = pi,
length.out = 201)
fNew <- interpBarycentric(x[[1]], f[[1]], xNew)[[2]]
fCheb<-InterpChebValues(f,xNew,domain)
fTrue<-sin(xNew)
plot(
x[[1]],
f[[1]],
type = "p",
xlab = "",
ylab = "",
main = "",
pch = 20,
col = "red",
cex = 1.5
)
lines(xNew, fNew, col = "blue", lwd = 2)
print(list(
"fTrue"=fTrue,
"fCheb"=fCheb,
"xNew" = xNew,
"fNew" = fNew,
"sin(xNew)" = sin(xNew)
))
## EXAMPLE 2
#Integral of the Sine function on the interval (0,pi)
domain<-c(0,pi)
x<-ChebPoints(32,domain)
f<-list(sin(x[[1]]))
Itrue<-2
Icalc<-t(x[[2]])%*%f[[1]]
print(list(
"Itrue"=Itrue,
"Icalc"=Icalc
))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.