In: Economics
3. When interest is compounded continuously, the following
equation represents the growth of your savings:
P = Poert
Solve the following question in Matlab:
When interest is compounded continuously, the following equation represents the growth of your savings:
Where
P is the current balance
Po is the initial investment
r is the growth rate, expressed as a decimal fraction
t is the time invested in years.
Use the meshgrid function to determine all the possible amounts
that could be in your account at the end of 10 years given the
following initial investments ($1000, $2000, $3500, $1500, $500)
and growth or interest rates (0.15, 0.20, 0.1).
ANSWER :
MATLAB CODE :
%% Finding Final Amount Present in ACCOUNT whose interest rate
is
%% Compounded
clear
clc
P_oi = [1000 2000 3500 1500 500];% Initial amount
r = [0.15 0.2 0.1];% Interest rate
t = 10;% time period
m=1;
for i=1
for j=1:5
P_o = P_oi(i,j);
disp('Initial Investment And Differt Interest rates')
fprintf('\n Initial Investment P_o = %d\n\n',P_o);
for k = 1:3
P = P_o*exp(r(i,k)*t);
P(i,k)= P;
fprintf(' interest rate r = %f\nP after 10 years =
%d\n\n\n',r(i,k),P(i,k));
end
end
end
[P_o1,r1] = meshgrid(500:500:3500,0.05:0.05:0.35)
Q1 = P_o1*exp(r1*t);
Q = [Q1]
surf(P_o1,r1,Q)
Output :
Initial Investment And Differt Interest rates
Initial Investment P_o = 1000
interest rate r = 0.150000
P after 10 years = 4.481689e+003
interest rate r = 0.200000
P after 10 years = 7.389056e+003
interest rate r = 0.100000
P after 10 years = 2.718282e+003
Initial Investment And Differt Interest rates
Initial Investment P_o = 2000
interest rate r = 0.150000
P after 10 years = 8.963378e+003
interest rate r = 0.200000
P after 10 years = 1.477811e+004
interest rate r = 0.100000
P after 10 years = 5.436564e+003
Initial Investment And Differt Interest rates
Initial Investment P_o = 3500
interest rate r = 0.150000
P after 10 years = 1.568591e+004
interest rate r = 0.200000
P after 10 years = 2.586170e+004
interest rate r = 0.100000
P after 10 years = 9.513986e+003
Initial Investment And Differt Interest rates
Initial Investment P_o = 1500
interest rate r = 0.150000
P after 10 years = 6.722534e+003
interest rate r = 0.200000
P after 10 years = 1.108358e+004
interest rate r = 0.100000
P after 10 years = 4.077423e+003
Initial Investment And Differt Interest rates
Initial Investment P_o = 500
interest rate r = 0.150000
P after 10 years = 2.240845e+003
interest rate r = 0.200000
P after 10 years = 3.694528e+003
interest rate r = 0.100000
P after 10 years = 1.359141e+003
P_o1 =
500 1000 1500 2000 2500 3000 3500
500 1000 1500 2000 2500 3000 3500
500 1000 1500 2000 2500 3000 3500
500 1000 1500 2000 2500 3000 3500
500 1000 1500 2000 2500 3000 3500
500 1000 1500 2000 2500 3000 3500
500 1000 1500 2000 2500 3000 3500
r1 =
0.0500 0.0500 0.0500 0.0500 0.0500 0.0500 0.0500
0.1000 0.1000 0.1000 0.1000 0.1000 0.1000 0.1000
0.1500 0.1500 0.1500 0.1500 0.1500 0.1500 0.1500
0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000
0.2500 0.2500 0.2500 0.2500 0.2500 0.2500 0.2500
0.3000 0.3000 0.3000 0.3000 0.3000 0.3000 0.3000
0.3500 0.3500 0.3500 0.3500 0.3500 0.3500 0.3500
Q =
1.0e+005 *
2.3166 2.3166 2.3166 2.3166 2.3166 2.3166 2.3166
2.3166 2.3166 2.3166 2.3166 2.3166 2.3166 2.3166
2.3166 2.3166 2.3166 2.3166 2.3166 2.3166 2.3166
2.3166 2.3166 2.3166 2.3166 2.3166 2.3166 2.3166
2.3166 2.3166 2.3166 2.3166 2.3166 2.3166 2.3166
2.3166 2.3166 2.3166 2.3166 2.3166 2.3166 2.3166
2.3166 2.3166 2.3166 2.3166 2.3166 2.3166 2.3166
>>
PLOT :