Project 2 - Root Solving to Find the Interest Rate on a Loan

On installment loans, the formula below is used to solve for one of the four variables A,i,P and N given values for the remaining three.

A is the monthly payment, P is the loan amount, i is the monthly interest rate (decimal value) and N is the duration of the loan (in months). When the interest rate is unknown, it can be obtained by finding the appropriate root of the function

Write a MATLAB program using the Bisection or False Position Method to find the interest rate on a loan. The program should request from the user the values of P, A, N. The initial bracket is iL = 0 and iU = 1. The iterations should stop when the magnitude of the approximate relative error is less than 0.1%. The final output should contain the method used in addition to:

Inputs:

P (loan amount)

A (monthly payment)

N (loan period in months)

Outputs:

i (computed monthly interest using format short in MATLAB)

IA (annualized interest rate, in percent, using format short in MATLAB)

n (number of iterations required)

a) P = $250,000.   A = $1750.   N = 360 months

b) P = $40,000.     A = $950.     N = 60 months

c) P = $15,000.     A = $700.    N = 36 months