Post Reply 
Equation Library Using the Formula Evaluation ROM
08-08-2017, 09:25 PM (This post was last modified: 09-22-2017 09:23 PM by mfleming.)
Post: #1
Equation Library Using the Formula Evaluation ROM
[Image: uc?export=view&id=0Bwt5Q_LizRq6NGFLbWh5YzlLekU]

One of the first applications I thought of after the announcement of Greg McClure and Angel Martins Formula Evaluation ROM was an Equation Library similar to that of the HP48. Since the ROM can evaluate symbolic expressions, and one example used in the manual was solving an expression for an unknown variable, then why not create a program that could access, display and solve a collection of such expressions?

Thanks to assistance from Greg and Angel, that possibility is incorporated in the EQNLIB program and manual attached here. An initial library of twelve equations is provided, but additional equations can be easily added to the library. The program allows you to scroll through the equations by name or expression, select one of interest, and then use a menu to set variable values and solve for unknowns.

In addition to the manual that contains code listings, an accompanying ZIP file contains the .RAW files for the main EQNLIB program and support programs. Use the RAW files to try out the Equation Library in a compatible emulator like V41 or go41cx. For V41 add the Formula Evaluation 1F MOD file to your configuration. For go41cx, use one of the MOD files Greg has posted in the forum thread HP-41 Android AMC OSX Module CAT1.

Use the INIEQN program to initialize the library in extended memory and APPEQN to add your own equations. Another auxiliary program, SAR (Search and Replace), has proved useful enough during development to include the code listing here. The program can be used to search for and replace strings in an extended memory text file. Very helpful when entering formula special characters in a text file if you don't have Angel's patched ED program handy!

Code:

1    LBL “SAR”
2    “FNAME?”
3    AON
4    PMTA
5    LBL “SAR$”    'Entry point when filename is in Alpha
6    ASTO 02
7    0
8    SEEKPTA
9    “SERCH?”
10    AON
11    PMTA
12    ASTO 00
13    “RPLCE?”
14    AON
15    PMTA
16    AOFF
17    ASTO 01
18    LBL 00
19    CLA
20    ARCL 00
21    POSFL
22    X<0?
23    GTO 01
24    ALENG
25    DELCHR
26    CLA
27    ARCL 01
28    INSCHR
29    RDN
30    GTO 00
31    LBL 01
32    CLA
33    ARCL 02
34    RDN
35    END

Enjoy!
~Mark

================================================

Update: September 8, 2017

The updated version of the Equation Library is now supplied as a MOD and ROM file! This new version offers the ability to use a pair of formulas in a complex equation that can't fit the 24 character limit of a single formula. Greg supplies a nice example using the TVM equation that benefits from the expanded capability.

The manual also expands on directions to use the Formula Evaluation ROM-based Equation Library with the V41 and go41cx/cxt emulators. More information is also provided on creating your own custom library of equations.

Attached is revision B of the Equation Library manual plus a zip file containing the MOD and ROM files for the library. In addition, the previously mentioned MOD file for go41 by Greg McClure is also included for convenience.


Attached File(s) Thumbnail(s)
   

.pdf  An Equation Library Using the Formula Evaluation ROM revB.pdf (Size: 379.07 KB / Downloads: 40)
.zip  EQNLIB_RevB.zip (Size: 35.11 KB / Downloads: 20)

Remember kids, "In a democracy, you get the government you deserve."
Find all posts by this user
Quote this message in a reply
08-08-2017, 10:07 PM
Post: #2
RE: Equation Library Using the Formula Evaluation ROM
Congratulations Mark on a nice application of the EVAL ROM! I have been using it and find it very useful to solve for equations I use. The documentation is nice, and I always appreciate it when source code is part of the documentation.

Good job, and I look forward to future software endeavors from you!
Find all posts by this user
Quote this message in a reply
Post Reply 




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