Interchangable Solutions using Formula EVAL Module
|
07-28-2017, 10:00 PM
(This post was last modified: 07-31-2017 04:55 AM by gjmcclure.)
Post: #1
|
|||
|
|||
Interchangable Solutions using Formula EVAL Module
The Interchangable Solutions Module (INTSOLN.MOD) when combined with the SIROM Module is a nice way to solve equations, and quite a few examples are given. I have rewritten a couple sections of the SLV+ routine to allow it to use the SV$ program in the Formula EVAL Module (currently EVAL_1E.MOD).
Here is the new LIBSV$ routine (Solve equation from library) and an example using Ohm's Law for the equation to solve: Quote:01 LBL "LIBSV$" Notice that the variable to solve must be replaced with X, and that the variables (max of 5 allowed) are automatically put into a thru e (buffer 7). It is a little more complicated to enter the user equation, but much clearer on how it is being solved. RAW files for the above program are attached. Greg |
|||
07-30-2017, 10:27 PM
(This post was last modified: 07-31-2017 04:58 AM by gjmcclure.)
Post: #2
|
|||
|
|||
RE: Interchangable Solutions using Formula EVAL Module
After posting LIBSV$ above I took another look at it and realized I didn't like having to have a different equation for each variable to be solved. Going back to the original SLV+ from the Interchangable Solutions, I realized that FROOT still needs to be called. But a couple things can be done to make equation entry easier... so here is the revised routines.
FROOT can either be from SIROM or from SMATH modules. In fact you can still use the SLV+ from interchangeable solutions, but I added a couple labels to allow entry of a different equation (LBL F), and easy exit with restore of user key assignments (LBL J). However, the user equations need to be written differently to take advantage of EVAL$. Here are the revised routines: Quote:01 LBL "SLVEQ$" I have included a ZIP file with the above TXT file and RAW files. As you can see, setting up the user equation is easier (just one line for EVAL$ to use). Use a thru e for the 5 parameters, use right_side - left_side for the equation to evaluate with EVAL$. Be sure to add XEQ "2B7" before doing EVAL$ to insure a thru e are filled in. Greg |
|||
08-10-2017, 02:32 PM
Post: #3
|
|||
|
|||
RE: Interchangable Solutions using Formula EVAL Module
Here is another sample equation for SLVEQ$, it solves any variable for Time Value of Money equation. Flag 0 is used to choose begin mode (set) or end mode (clear)...
Quote:01 LBL "TVM" Greg |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 2 Guest(s)