(11C) TVM for HP-11C
|
12-03-2020, 08:53 PM
(This post was last modified: 12-04-2020 01:41 PM by Albert Chan.)
Post: #9
|
|||
|
|||
RE: (11C) TVM for HP-11C
(12-03-2020 05:53 PM)bshoring Wrote: If I understand correctly, this program uses a modified Newton method to solve. Yes ! Let a = (PV+FV)/(-PMT), using cash-flow sign-convention (results of post#3, LBL A) We can interpret it as number of payments, if interest rate is zero. Case FV=0: a*i/(1-k) = 1 → f(i) = a*i - (1-k) = 0 → f'(i) = a - k*n/(1+i) Code: function pv_i(n, a, i) Case PV=0: a*i/(K-1) = 1 → f(i) = a*i - (K-1) = 0 → f'(i) = a - K*n/(1+i) Code: function fv_i(n, a, i) Iterations were setup with Newton's method. But, denominator is not quite f'(i), resulting in better correction. lua> g = pv_i(12, 5000/500) -- guess_i = 0.030555555555555558 lua> g(), g(), g() 0.02922075497755343 0.02922854050171087 0.029228540769134212 lua> g = fv_i(12, 5000/400) -- guess_i = 0.00749063670411985 lua> g(), g(), g() 0.007390656157378769 0.007390622804155507 0.007390622804147247 |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 7 Guest(s)