BarycentricInterpolation.BarycentricInterpolation
— ModuleBarycentricInterpolation
This package implements the Barycentric formula for polynomial interpolation on equispaced points and Chebyshev points of the first and second kind. The formulae used are taken from the paper of Berrut and Trefethen, SIAM Review,
Additional Barycentric weights for Legendre points are taken from the paper of Wang, Huybrechs, and Vandewalle, Mathematics of Computation, 83 (290) 2893-2914, 2014.
Other packages that may be of interest are FastGaussQuadrature and ApproxFun.
Written by David A.W. Barton (david.barton@bristol.ac.uk) 2016-2021 and licensed under the MIT license https://opensource.org/licenses/MIT
BarycentricInterpolation.degree
— Methoddegree(poly)
Return the degree of the polynomial specified.
BarycentricInterpolation.differentiation_matrix
— Methoddifferentiation_matrix(poly::AbstractPolynomial)
Return the differentiation matrix at the nodes of the polynomial specified.
P = Chebyshev2{5}()
D = differentiation_matrix(P)
Now dy/dx ≈ D*y
at the nodes of the polynomial.
BarycentricInterpolation.interpolate
— Methodinterpolate(poly::AbstractPolynomial, y₀, [x])
Return the value of y(x)
given that y(nodes(poly)) = y₀
. If the value of x
is not provided, return a function y(x)
that evaluates the interpolant at any x
.
BarycentricInterpolation.interpolation_matrix
— Methodinterpolation_matrix(poly::AbstractPolynomial, x)
Return the interpolation matrix from the nodes of poly
to the point(s) x
. For example :
P = Chebyshev2{5}()
x = range(-1, stop=1, length=10)
M = interpolation_matrix(P, x)
Now y(x) ≈ M*y₀
given that `y(nodes(poly)) = y₀.
BarycentricInterpolation.nodes
— Functionnodes(poly)
Return the nodes for the specified orthogonal polynomials.
BarycentricInterpolation.nodes_weights
— Functionnodes_weights(poly)
Return the nodes and weights of the polynomial specified.
BarycentricInterpolation.weights
— Functionweights(poly)
Return the Barycentric weights for the specified orthogonal polynomials.