Please use Simulink from Matlab to solve, how do I set this up in simulink? Supp
ID: 664507 • Letter: P
Question
Please use Simulink from Matlab to solve, how do I set this up in simulink?
Suppose that you deposit some money in a bank that pays interest at an annual rate r. The value of the investment at any time, t, is S(t). If the interest is compounded continuously we can use a simple differential equation to describe the investment growth. The rate of change of the investment, dS/dt, is the interest rate, r, times the value of the investment, So dS/dt = rS and we can assume an initial value, S(0) = S0. If r =8% and S0 = $1000, use MATLAB to determine the investment value after 10 years.Explanation / Answer
CONCEPT:
Matlab for the Compound Interest
CODE:
So= 1000; //intial amount in $
r = 0.08; //interest rate
n = 12; //number of months
time = 10; //time given it as 10
S(t) = comp_int(So, r, n, t)l;//making a function call
S(t)=So*(1+r/n)^(n*t); //invoked function