Post Reply 
Solve w/ HP-41 Formula Eval Module
07-17-2017, 04:39 PM (This post was last modified: 06-01-2023 06:18 AM by Ángel Martin.)
Post: #1
Solve w/ HP-41 Formula Eval Module
Hardly a new invention, yet the Secant method acquires a new and simplified dimension on the HP-41 using the Formula_Eval module. Welcome to the new FOCAL, or the FOCAL$ as somebody suggested it could be called.

Here's the code. Use initial guesses in Y, X with the formula in ALPHA
Set flag 10 if you want to see the succesive iterations .

Code:
01  LBL "SV$"
02  STO$ (00)
03  LBL 00
04  EVALZ
05  X<>Y
06  EVALT
07  "Y-Z*(Y-X)/(Z-T)"
08  EVAL$
09  FS? 10
10  VIEW X(3)
11  RCL$  (00)
12  X#Y?
13  GTO 00
14  END

It uses R00-R03 to store the formula expression.

As listed it uses all 9 decimal places to determine the equal condition. You can change it using RND statements as usual - in case the convergence fails for oscillations. Many other refinements are also possible, but I thought you'd like to see the "sketch" version first.

Doesn't get any shorter or easier, as any BASIC programmer knows ;-)

"To live or die by your own sword one must first learn to wield it aptly."
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Solve w/ HP-41 Formula Eval Module - Ángel Martin - 07-17-2017 04:39 PM



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