(11C) TVM for HP-11C
|
05-10-2022, 09:35 PM
(This post was last modified: 05-15-2022 02:46 PM by Albert Chan.)
Post: #17
|
|||
|
|||
RE: (11C) TVM for HP-11C
(12-05-2020 01:05 AM)Albert Chan Wrote: From thread: Fun math algorithms: I noticed exact definition of C, if we take away N*I/2, it turned to even function (of N) XCas> C := I*N/(1 - (1+I)^-N) XCas> simplify(C - C(N=-N)) → N*I XCas> series(C - N*I/2, I, 0, 3, polynom) // even powers of N, as expected 1 + I/2 + (-1+N^2)/12*I^2 + (1-N^2)/24*I^3 If we define Ce = C - I*N/2, we avoided thinking of "backward in time" with negative (N,PMT) Quoted C(d) dropped the term I^2/12, we might as well put it back in. XCas> Ce := 1 + I/2 + (N^2-1)/12*I^2 // truncated O(I^3) terms XCas> NPMT := (Ce+N*I/2)*PV + (Ce-N*I/2)*FV + N*PMT XCas> factor(e2r(NPMT,I)); // quadratic coefficients, for I [(N^2-1)*(FV+PV)/12, (-FV*N+N*PV+FV+PV)/2 , N*PMT+FV+PV] Only difference with previous version is N^2 replaced by (N^2-1) Code: function guess_i(n, pv, pmt, fv) -- cash-flow sign convention Examples shown in this thread, estimated rate slightly improved. With updated guess_i(n, pv, pmt, fv): lua> guess_i(12, 5000, -500, 0) -- OP example 0.029209500177242102 lua> guess_i(12, 0, -400, 5000) -- OP example 0.007391057003072031 lua> guess_i(36, 30000, -550, -15000) -- car lease example 0.0058048457798059476 |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 3 Guest(s)