nag_ode_bvp_ps_lin_quad_weights (d02uyc) obtains the weights for Clenshaw–Curtis quadrature at Chebyshev points. This allows for fast approximations of integrals for functions specified on Chebyshev Gauss–Lobatto points on .
2 Specification
#include <nag.h>
#include <nagd02.h>
void
nag_ode_bvp_ps_lin_quad_weights (Integer n,
double w[],
NagError *fail)
3 Description
nag_ode_bvp_ps_lin_quad_weights (d02uyc) obtains the weights for Clenshaw–Curtis quadrature at Chebyshev points.
Given the (Clenshaw–Curtis) weights , for , and function values (where , for , are the Chebyshev Gauss–Lobatto points), then .
For a function discretized on a Chebyshev Gauss–Lobatto grid on the resultant summation must be multiplied by the factor .
4 References
Trefethen L N (2000) Spectral Methods in MATLAB SIAM
An internal error has occurred in this function. Check the function call and any array sizes. If the call is correct then please contact NAG for assistance.
7 Accuracy
The accuracy should be close to machine precision.
8 Parallelism and Performance
Not applicable.
9 Further Comments
A real array of length is internally allocated.
10 Example
This example approximates the integral using Clenshaw–Curtis weights and a -point Chebyshev Gauss–Lobatto grid on .