Post Reply 
(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
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
(11C) TVM for HP-11C - Gamo - 05-09-2019, 01:15 AM
RE: (11C) TVM for HP-11C - Gamo - 12-03-2019, 10:12 AM
RE: (11C) TVM for HP-11C - Gamo - 02-13-2020, 06:14 AM
RE: (11C) TVM for HP-11C - bshoring - 12-02-2020, 09:02 PM
RE: (11C) TVM for HP-11C - Gamo - 12-03-2020, 08:23 AM
RE: (11C) TVM for HP-11C - Dave Britten - 12-03-2020, 01:48 PM
RE: (11C) TVM for HP-11C - bshoring - 12-03-2020, 05:53 PM
RE: (11C) TVM for HP-11C - Dave Britten - 12-03-2020, 06:08 PM
RE: (11C) TVM for HP-11C - Albert Chan - 12-03-2020, 08:53 PM
RE: (11C) TVM for HP-11C - Albert Chan - 12-04-2020, 08:01 PM
RE: (11C) TVM for HP-11C - Albert Chan - 12-05-2020, 01:05 AM
RE: (11C) TVM for HP-11C - Albert Chan - 12-05-2020, 03:46 AM
RE: (11C) TVM for HP-11C - Albert Chan - 05-10-2022, 09:35 PM
RE: (11C) TVM for HP-11C - Albert Chan - 05-11-2022, 01:07 PM
RE: (11C) TVM for HP-11C - Albert Chan - 12-06-2020, 02:32 PM
RE: (11C) TVM for HP-11C - Albert Chan - 12-06-2020, 04:41 PM
RE: (11C) TVM for HP-11C - Albert Chan - 12-07-2020, 06:55 PM
RE: (11C) TVM for HP-11C - Albert Chan - 12-08-2020 03:05 PM
RE: (11C) TVM for HP-11C - Albert Chan - 05-14-2022, 12:26 PM



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