(12C+) Integration by Trapezoidal Rule
10-18-2021, 08:13 AM (This post was last modified: 10-18-2021 08:30 AM by Gamo.)
Post: #1
 Gamo Senior Member Posts: 721 Joined: Dec 2016
(12C+) Integration by Trapezoidal Rule
This program is adapted from the Sinclair Enterprise Mathematics booklet on page 28.4

Program to run Integration of a Function by Trapezoidal Rule Formula.

Example Usage:

7
∫ (X² - 5) dX
1

Start f(x) at line 46 and end with [GTO] 13
Use R0 for each X in the equation

Record Equation: [GTO] 45 [f] [P/R]

[RCL] 0 [RCL] 0 [x] 5 [-] [GTO] 13

[f] [P/R] // Goto Run Mode

To Run: [f] [PRGM] // Set to top of program line 00

1 [R/S] display -1
7 [R/S] display "running" in about 10 second then answer ≈ 84.0240

[f] 0 display answer = 84

Program:
Code:
 01 STO 0 02 CHS 03 R/S 04 + 05 EEX 06 3 07 ÷ 08 STO 2 09 0 10 STO 3 11 STO 1 12 GTO 46 13 STO 5 14 RCL 1 15 1 16 - 17 0 18 X<>Y 19 X≤Y 20 GTO 37 21 RCL 5 22 RCL 6 23 + 24 2 25 ÷ 26 RCL 2 27 x 28 STO+3 29 EEX 30 3 31 RCL 1 32 - 33 0 34 X<>Y 35 X≤Y 36 GTO 44 37 RCL 5 38 STO 6 39 RCL 2 40 STO+0 41 1 42 STO+1 43 GTO 12 44 RCL 3 45 GTO 00 46 f(x) 47 . . . xx GTO 13

Remark:
This program is best use on HP-12C+ or App Emulator.
This program setup the intervals to EEX 3 for best accuracy possible but
for slower HP-12C can be change the intervals lower to EEX 2 with less accuracy.
To change interval is on line 05,06 and 29,30

Gamo 10/2021
 « Next Oldest | Next Newest »

 Messages In This Thread (12C+) Integration by Trapezoidal Rule - Gamo - 10-18-2021 08:13 AM

User(s) browsing this thread: 1 Guest(s)