(15C) Yet Another Time Value of Money Program
|
08-14-2023, 03:05 AM
(This post was last modified: 08-14-2023 05:29 PM by HobbitJack.)
Post: #1
|
|||
|
|||
(15C) Yet Another Time Value of Money Program
Note for Moderators: I may have accidentally posted this thread twice due to a misclick on my part. This is the correct version.
This is yet another program for the purpose of solving TVM (Time Value of Money) problems on the HP-15C. I believe this program fills a middle ground between other TVM programs, in terms of size and functionality. Whereas other programs are either large and involve many, many labels, or are fairly small and are unable to solve full TVM problems for each variable without significant manipulation, this program is able to solve the TVM equation (specifically, the equation given in the HP-15CE edition of the Advanced Functions Handbook) for any of the five variables -- that is, N (the number of payment and compounding periods), %i (the interest rate per payment/compounding period, in percent), PV (the present value, that is, the amount gained or lost at the start of the first payment/compounding period), PMT (the constant payment made in or out each payment/compounding period), or FV (the future value of the loan or investment, when the final period/payment is made). This program's benefits over existing solutions can be summed up as follows: - Fairly Small: This program requires only 43 program steps and 52/53 bytes (8 registers + 3/44 bytes; depends on number of label used) of program memory to remain stored. The user can also strip out program steps 019-030 (inclusive) to save extra memory, if the End/Begin behavior option is not viewed as needed or memory is at a premium. - Uses Few Resources: This program only uses one label when not in use, and only requires one more when actively being used, and only uses the 5 registers (R0-R4) used to store the TVM variables, and only uses one Flag variable (Flag 7) in read only to read End/Begin behavior - Versatile: This program is able to solve for all 5 TVM variables through the same loader program structure. It also can use Flag variable 7 to set End/Begin behavior. This program has a number of minor drawbacks compared to other similar programs. These are as follows: - Requires a Loader Program: A loader program, of 4 instructions and 4-6 bytes (depending on label used to store the loader program and main program) is required to be used to solve for any variable. This loader program will be given below but is simple enough and can be intuitively remembered without memorization given a familiarity with the functionality of the program and the solver. - Less Intuitive Operation: This program requires the memorization of which registers refer to which TVM variables, and is also less intuitive in that solving for a variable requires changing the STO instruction in the loader program, rather than merely changing which button is pressed. These are in the same order as the buttons are on the HP-12C, so it is hoped that users with familiarity with that system will have less difficulty migrating to this program. USAGE: Key Number of Payment Periods into R0, Percent Interest Rate per Payment Period into R1, Present Value into R2, Per-Period Payment into R3, and Future Value into R4. Store 0 for the unknown. Create a program with a label, a sto instruction into the register for the unknown variable, a gsb instruction to the label of the program in memory, and a rtn instruction. key in initial guess (not always necessary), clear Flag 7 for End and set Flag 7 for Begin, and use SOLVE on your loader program. Note that the label used for the GSB instruction in the loader program should match the label used for the main program, and that the register for the STO instruction should match the register for the variable for which you wish to solve. MAIN PROGRAM: Code:
LOADER PROGRAM: Code:
Video game modder and amateur world builder. Also calculator collector. |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)