(71B) Gauss-Chebyshev Quadrature
|
02-22-2016, 03:42 PM
(This post was last modified: 06-15-2017 01:43 PM by Gene.)
Post: #1
|
|||
|
|||
(71B) Gauss-Chebyshev Quadrature
This is an HP-71B program that performs the Gauss-Chebyshev Quadrature for a function f(x). This algorithm is of teh same class as the Gauss-Legendre Qudrature, except calculating the roots of the Chebyshev polynomials is MUCH easier than calculating the roots of the Legendre polynomial. Thus, you can easily specify the number of points (which is also the order of the Chebyshev polynomial) used to calculate the integral.
The program prompts you to enter A, B which define the integral limit and also prompts you for N the Chebyshev polynomial order (which is also the number of points used in the quadrature. The program displays the value of the integral, stored in variable R. The listing is: Code: 10 REM GAUSS-CHEBYSHEV QUADRATURE Line 1010 starts the calculation for the function f(x) which is stored in the variable F. Line 2010 is optional and allows you to calculate or assign the exact value of the integral and store it in the variable Y. The subroutine displays that value and also displays the % error. If calculating the exact integral is too difficult or not possible, then make line 2010 to simply contain a RETURN statement. Enjoy! Namir |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)