16 Point Gaussian Quadrature for the HP-41C/CV/CX (updated)
|
11-09-2023, 09:23 PM
(This post was last modified: 11-15-2023 10:42 PM by Namir.)
Post: #1
|
|||
|
|||
16 Point Gaussian Quadrature for the HP-41C/CV/CX (updated)
16 Point Gaussian Quadrature for the HP-41C/CV/CX (updated)
This program is a slightly enhanced version of the one posted by Tony Udell. The program includes LBL 00 that initializes the values for the quadrature nodes and weights. I have also remapped the memory registers into a contiguous sequence from 00 to 19. You can download the .raw program file by clicking here. To use the program: 1) Press [A] to perform a regular integration between A and B. The program prompts you for the values of A and B. Enter these values and press [R/S] to calculate the integral. 2) Press [B] to perform a special integration between A and infinity. The program prompts you for the value of A. Enter the value and press [R/S] to calculate the integral. Notes: 1) Label "FX" (also label E) is where you enter the statements to evaluate the integrated function. 2) The program automatically calls subroutine at LBL 00 to initialize the nodes and weights for the quadrature. Memory Map ========== Code: R00 = integral Program Listing ============ Code: 01 LBL "A-B" Example 1 ========= To calculate the integral of 1/x from 1 to 2 (which is equal to ln(2)): 1. In program mode insert the command 1/x after LBL E and make sure it is followed by RTN. 2. In run mode (user mode on) clear flag 1 using [f][CF][0][1]. Skip this step if you are not running the program the first time. 3. Press the [A] key. 4. The program prompts you to enter the value of "a". Enter 1 and press the [R/S] key. 5. The program prompts you to enter the value of "b". Enter 2 and press the [R/S] key. 6. The program displays 0.69315 (FIX 9 displays 0.693147181) as the value of the integral. Example 2 ======== To calculate the integral of exp(-x)*x^0.8 from 0 to inifinity (which is equal to gamma(1.8)): 1. In program mode insert the commands CHS, EXP, LASTX, CHS, 0.8, Y^X and, * after LBL E and make sure it is followed by RTN. 2. In run mode (user mode on) clear flag 1 using [f][CF][0][1]. Skip this step if you are not running the program the first time. 3. Press the [A] key. 4. The program prompts you to enter the value of "a". Enter 0 and press the [R/S] key. 5. The program displays 0.93138 (FIX 9 displays 0.931378447) as the value of the integral. |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 10 Guest(s)