Post Reply 
Looking for TVM formulas
04-05-2014, 09:58 PM (This post was last modified: 04-05-2014 10:22 PM by Dieter.)
Post: #24
RE: Looking for TVM formulas
(04-04-2014 10:12 PM)Dave Britten Wrote:  3. Five "solve" routines - Three of these are direct solutions (PV, PMT, FV), and the other two prepare...
4. ...The numeric solver - A straight port of the HP 20S solver, with a couple changes specific to this progra. It chokes on overflows trying to solve for n or i% in the Susan example,

Hm, why do you think that there is no direct solution for n and an iterative approach is required?

Consider the basic TVM formula you already posted:

PV * (1 + i)n + PMT * ((1 + i)n – 1)) * ((1 / i) + B) + FV = 0

Then
(1 + i)n – 1 = –(PV + FV) / (PMT * (1 / i + B) + PV)

And thus, using ln1+x for best accuracy:

n = ln1+x(–(PV + FV) / (PMT * (1 / i + B) + PV)) / ln1+x(i)

Or a bit more formal:

\(\large n  =  ln (1 - \frac{PV + FV}{PV + PMT (\frac{1}{i} + B)})  :  ln (1 + i)\)

Try the Susan example:

(1+i)n – 1 = (–(0 + -333783,35)) / ( 0,01 * (1/3,567351598 E-9 + 0) + 0) = 333783,35 / 2803200 = 0,1190722567

ln1+x(0,1190722567) / ln1+x(3,567351598 E-9) = 31536000

Dieter
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Looking for TVM formulas - Dave Britten - 03-31-2014, 11:21 PM
RE: Looking for TVM formulas - Jeff_Kearns - 04-01-2014, 10:40 AM
RE: Looking for TVM formulas - Jeff_Kearns - 04-01-2014, 07:37 PM
RE: Looking for TVM formulas - Dieter - 04-02-2014, 12:21 PM
RE: Looking for TVM formulas - Dieter - 04-02-2014, 07:23 PM
RE: Looking for TVM formulas - Dieter - 04-06-2014, 07:46 PM
RE: Looking for TVM formulas - Dieter - 04-09-2014, 01:36 PM
RE: Looking for TVM formulas - Dieter - 04-02-2014, 07:40 PM
RE: Looking for TVM formulas - Dieter - 04-03-2014, 01:22 PM
RE: Looking for TVM formulas - Jeff_Kearns - 04-04-2014, 09:44 PM
RE: Looking for TVM formulas - Dieter - 04-05-2014 09:58 PM



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