(11C) TVM for HP-11C
|
12-08-2020, 03:05 PM
Post: #16
|
|||
|
|||
RE: (11C) TVM for HP-11C
(12-07-2020 06:55 PM)Albert Chan Wrote: lua> i2 = 1.001*i1 -- p1<0, i1 is a bit low We can avoid thinking about direction, and how much adjustment, for i2 If zero interest, npmt = (pv+fv)/n + pmt, we can use this to get i2 lua> n, pv, pmt, fv = 36, 30000, -550, -15000 lua> i1 = guess_i(n, pv, pmt, fv) lua> p1 = npmt(n, i1, pv, pmt, fv) lua> function secant(x1,y1,x2,y2) return x1 - y1/(y2-y1)*(x2-x1) end lua> i2 = secant(i1, p1, 0, (pv+fv)/n + pmt) lua> p2 = npmt(n, i2, pv, pmt, fv) lua> i3 = secant(i2, p2, i1, p1) lua> table.foreachi({i1,i2,i3}, print) 1 0.005804795434882038 2 0.005805075946792827 3 0.005805072819418476 |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 4 Guest(s)