Answer to Question #210746 in MatLAB for Rama

Question #210746

Write a MATLAB code to solve the following difference equations by z-transform and display the solutions by stem plots:

3) A bank account gives an interest rate of 5% compounded monthly. If you invest initially Rs .1000 and add Rs. 10 every month. How much money do you have after 5 years?


1
Expert's answer
2021-06-27T14:10:07-0400


syms p(n) z
r = (5/100)/12
Pr=1000
u=10
assume(n>=0 & in(n,'integer'))
f = Pr*((p(n+1) - p(n) - r*p(n)) ) - u
fZT = ztrans(f,n,z)
syms pZT
fZT = subs(fZT,ztrans(p(n),n,z),pZT)
pZT = solve(fZT,pZT)
pSol = iztrans(pZT,z,n);
pSol = simplify(pSol)
pSol = subs(pSol,[p(0) p(1)],[1 2])

nValues = 1:60;
pSolValues = subs(pSol,n,nValues);
pSolValues = double(pSolValues);
pSolValues = real(pSolValues);
stem(nValues,pSolValues)
title('Compounded Amount Plot')
xlabel('Month (n)')
ylabel('Compounded AMount p(n)')
grid on






Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS