|To TVM or not to TVM?|
Message #37 Posted by Dieter on 29 July 2011, 1:46 p.m.,
in response to message #36 by gene wright
In fact we now got a proposal for a better TVM routine in the 34s. Maybe there's an even better solution - let me think one step further:
Mathematically, the TVM equation usually does not require any guesses at all to solve for one of their variables. This is because for PV, FV, PMT and N there are more or less simple closed form solutions that do not require any guessing - if you want to know the value for an annual payment, simply calculate it directly. The interest rate is the only exception here - for this case there is no explicit solution, so the Solver is required for an iterative approach. This leads to the Solver numerically solving the TVM equation for the interest rate i, which in turn requires two guesses given by the user.
In other words, providing a TVM equation is only useful for this single case, i.e. when the interest rate is unknown. This is where the 34s differs from the way other HPs work:
The 35s, for example, also can store such an equation in order to solve for any of its variables. The essential point here is the ability of the 35s to solve for all variables (except i) without any interaction of the user. No initial guesses are required as the user wants to solve for PMT, FV or other values, and the result shows up immediately because it is calculated directly by the 35s. The solver built into this device is able to realize that every variable (except i) shows up only once in the TVM equation, so that it can solve directly for this variable by rearranging the equation. No guesses required. Only if it's the interest rate that has to be solved for, it has to rely on an iterative approach, requiring two guesses.
This is what makes the difference between a "sophisticated solver" like the one in the 35s and a purely numeric solver like the one in the 34s (and 34C, 15C etc.). The more "intelligent" version like the one in the 35s is a nice example for using the solver with not more than just one single equation, even in cases where an explicit solution exists - the calculator will return this explicit solution without any initial guesses or more or less time-consuming iterations.
On devices where such a solution is not possible, I think it's much better to code the direct solution for every single variable. So does the TVM program in the HP-41 standard pac: variables like PV, FV, PMT and N are evaluated directly, while the interest rate is calculated by iteration. A first estimate is set by the program, the user does not have to care about this.
So, what's the use of an TVM equation in the 34s? It is nice for determining the interest rate, using the built-in solver, after the user has provided two initial guesses. Simply because there is no other way to solve for this variable. For all other cases a simple direct solution exists - but since the current approach uses the iterative solver in these cases as well, the user has to enter two estimates for each and every variable - and hope that they are good enough to lead to the correct result.
That's why I think the TVM equation does not make much sense in the 34s. As opposed to calculators with more sophisticated solvers like the 35s. For other devices, I think four routines with the explicit solutions of the four variables are a far better solution. So I would recommend to either omit the TVM equation completely, or, if this functionality is really required, provide the four direct solutions. If you dislike both suggestions, at least there should be a clear hint in the manual and the given example, pointing out that using the TVM equation does not only require calling the solver but also two initial guesses. No, I do not think that "this is obvious because it applies to every call of the solver anyway". Just to be sure. ;-)