NAG Library Function Document
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 .
||nag_ode_bvp_ps_lin_quad_weights (Integer n,
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 .
Trefethen L N (2000) Spectral Methods in MATLAB SIAM
n – IntegerInput
On entry: , where the number of grid points is .
w – doubleOutput
On exit: the Clenshaw–Curtis quadrature weights,
, for .
fail – NagError *Input/Output
The NAG error argument (see Section 3.6
in the Essential Introduction).
6 Error Indicators and Warnings
Dynamic memory allocation failed.
On entry, argument had an illegal value.
On entry, .
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
The accuracy should be close to machine precision.
8 Parallelism and Performance
A real array of length is internally allocated.
This example approximates the integral using Clenshaw–Curtis weights and a -point Chebyshev Gauss–Lobatto grid on .
10.1 Program Text
Program Text (d02uyce.c)
10.2 Program Data
Program Data (d02uyce.d)
10.3 Program Results
Program Results (d02uyce.r)