Post Reply 
Improving the solver experience on the 41C
02-16-2016, 10:19 AM (This post was last modified: 02-16-2016 10:42 AM by Ángel Martin.)
Post: #2
RE: Improving the solver experience on the 41C
Very nice improvement on Stefan Vorkoetter's program; here's my proposal using the data entry flag F22 to re-write your SLV routine as follows:

Code:

1    LBL "SLV+
2    "F. NAME?"
3    AON
4    STOP
5    AOFF
6    ASTO 06
7    LBL 01
8    SF 05
9    XEQ IND 06
10    CF 22
11    PROMPT
12    GTO 01
13    LBL A
14    1
15    GTO 02
16    LBL B
17    2
18    GTO 02
19    LBL C
20    3
21    GTO 02
22    LBL D
23    4
24    GTO 02
25    LBL E
26    5
27    LBL 02
28    FC? 22
29    GTO 00
30    X<>Y
31    STO IND Y
32    GTO 01
33    LBL 00
34    STO 00
35    1
36    1 E-99
37    "a^b=?"
38    PROMPT
39    CLA
40    ARCL 06
41    CF 05
42    FROOT
43    STOP
44    GTO 01
45    END

Only 45 steps are needed, and a bunch of bytes are saved as well. Also no need to use [SHIFT] to determine the unknown - so it's standard with the other solvers, like the TMV$. So you'll enter all the knowns and then press the soft-key corresponding to the unknown to trigger the SOLVE process. BTW I've used FROOT from the SandMath instead..

Writing an MCODE equation solver has always lured me but I guess I don't know enough to tackle the job.

BTW - There's one ROM image I prepared a while ago that deals with this very same subject; it's called "Interchangeable Solutions" and contains the FOCAL programs of the same name available at TOS? (written by Humbert Hans Suarez, from the User's Program Library Europe, REF#01475C). It's a tad more complex but quite flexible in the number of variables and governing equations.

"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
RE: Improving the solver experience on the 41C - Ángel Martin - 02-16-2016 10:19 AM



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