Post Reply 
(11C) Solve for [i] given [n] [PMT] [FV]
04-15-2018, 05:49 PM
Post: #7
RE: (11C) Solve for [i] given [n] [PMT] [FV]
(04-14-2018 06:59 PM)Dieter Wrote:  Why don't you simply take the usual approach with one single TVM equation which includes both PV and FV so that the interest rate can be calculated the same way for either case.

I now have tried such a progam. Caveat: this is experimental code with some room for improvement. But it seems to work.

Code:
001  LBL A
002  STO 1
003  RTN
004  LBL C
005  STO 3
006  RTN
007  LBL D
008  STO 4
009  RTN
010  LBL E
011  STO 5
012  RTN
013  LBL B
014  RCL 4
015  RCL 5
016  +
017  RCL 1
018  RCL 3
019  x
020  +
021  RCL 1
022  1
023  -
024  RCL 5
025  x
026  RCL 1
027  1
028  +
029  RCL 4
030  x
031  -
032  /
033  2
034  x
035  STO 2
036  x=0?
037  GTO 2
038  LBL 1
039  RCL 4
040  RCL 5
041  +
042  RCL 2
043  1
044  +
045  STO 6
046  RCL 1
047  y^x
048  STO 7
049  1
050  -
051  /
052  RCL 4
053  +
054  RCL 4
055  RCL 5
056  +
057  RCL 1
058  x
059  RCL 2
060  x
061  RCL 7
062  x
063  RCL 6
064  /
065  RCL 7
066  1
067  -
068  x^2
069  /
070  -
071  X<>Y
072  RCL 2
073  x
074  RCL 3
075  +
076  X<>Y
077  /
078  STO-2
079  RCL 2
080  /
081  EEX
082  6
083  x
084  INT
085  x≠0?
086  GTO 1
087  LBL 2
088  RCL 2
089  EEX
090  2
091  x
092  RTN
093  LBL 0
094  CLX
095  STO 1
096  STO 2
097  STO 3
098  STO 4
099  STO 5
100  FIX 2
101  RTN

Feel free to insert a PSE after line 078 or 080.
You may also include a loop counter that cancels the iteration after, say, 12 loops.

- This program uses the well-known sign convention. So for your above examples enter PMT with negative sign.
- GSB 0 initializes the program and clears the relevant registers.
- [A] stores n
- [B] calculates i
- [C] stores PMT
- [D] stores PV
- [E] stores FV

Initialize with GSB 0 first.
Enter n, PMT, PV and FV with the respective keys in any order.
Press [B] to solve for i.

The initial guess for i is calculated this way:

Code:
           PV + n*PMT + FV
i0 = 2 * ———————————————————
         PV*(n+1) - FV*(n-1)

Now try it and see what you get.

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


Messages In This Thread
RE: (11C) Solve for [i] given [n] [PMT] [FV] - Dieter - 04-15-2018 05:49 PM



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