Consider a loan in the amount of P dollars to be repaid in n equal monthly installments of A dollars with interest at i per month. The unpaid balance Pk
made after the kth payment is given by
A Simulink block diagram is shown in Figure E7.17. Note that the loan amount P is the initial condition of the “Unit Delay” block and the simulation stop time is set to n.
The terms of a car loan are P = $30,000, n = 48 months, and i = 0.005 (0.5% per month). For a fixed value of monthly payment A, the unpaid balance at the end of the loan period is P48. Positive values of P48 means A is too low and the loan has not been paid off in its entirety.
A negative value of P48
implies A is too much and overpayment of the loan has occurred. The correct amount of the monthly payment A to retire the loan after the last (48th) payment is the value of A for which the unpaid balance at the end of the loan period is zero.
a. Prepare a graph of P48
vs. A, for A=$600, $625, $650, …, $800. Estimate the correct value of A to repay the loan.
b. Write your own or use MATLAB’s optimization toolbox to determine the correct A by finding the value of A, which minimizes the objective function P48.
c. Plot Pk
vs. k, k = 0, 1, 2, 3, …, 48 using the value of A found in part (b). Compare your answer for A with the correct value of A, which can be obtained from the formula.