Project 3.4 a manufacturer wishes to purchase a piece of equipment that costs Su
ID: 3348437 • Letter: P
Question
Project 3.4 a manufacturer wishes to purchase a piece of equipment that costs Suppose $40,000. He plans to borrow the money from a bank and pay off the loan in 10 years in 120 equal payments. The annual interest rate is 69%. Each month the interest charged will be on the unpaid balance of the loan. He wishes to dete linear equations 76Numerical and Analytical Methods with MATLAB Let x, - the amount in the jth payment that goes toward paying off the pal. Then the equation describing the jth payment is princi whet his monthly payment will he. This problem can tbe solved by a system (P3.Aa) where M-the monthly payment. borrowesd Pm the amount /- the monthly interest rate annual interese rate/12. The total number of unknowns is 121 (120 values and AD. Applying Equat on PS.4a) to each month gives 120 equations. One additional equation is P3.4b) Develop a computer program that will 1. Ask the user to enter from the keyboard the amount of the loan (P), the 2. Ser up the system of linear equations, using Aas the coefficient matr S. Solve the system of linear equations in MATLAB annual interest rate. I, and the time period, Y, in years. the system of linear equations. The n represents the equation number an represents the coefficient of x in that equation. Set i21M d m 4. Print out" table consisting of four columns. The first column should be. month number, the second column the monthly payment, t the amount of the monthly payment that goes toward paying pal, and the fourth column the interest payment for that mont he third columnExplanation / Answer
Matlab code:txt format
filr name: monthlypayment.m
format short g
P=input('ammount of the loan(P) ');
i=input('annual interest rate(I in %) ');
Y=input('number of years(Y) ');
y=12*Y;%number of monthly installment
I=i/1200;%monthly interest rate I=i/12 and as 'i' in percent so I=i/1200
%%Coefficient matrix A(n,m), where n=no. of equation and m=no. of
%%coefficient of x
A=zeros(y+1,y+1);
%%Solution matrix B(y+1,1), where B=[x1,x2,x3,----,x120,M]'
B=zeros(y+1,1);
%%Matrix C(y+1,1)=right hand side coefficient of system of linear equation
C=zeros(y+1,1);
%%Plugin coefficient of system of linear equation in matrix A
A(1,1)=1;
A(:,y+1)=-1;
A(y+1,:)=1;
A(y+1,y+1)=0;
for i=2:1:y
for j=1:1:i
if(i==j)
A(i,j)=1;
else
A(i,j)=-I;
end
end
end
%Plugin right hand side coefficient of system of
%linear equation in matrix C
C(:,1)=-P*I;
C(y+1,1)=P;
%%solution of system of linear equation, B=inv(A)*C or AC
B=AC;
%%Monthly payment,M
M=zeros(1,y);
M(1,:)=B(y+1,1);
%%ammount of payment that goes towards paying off the principle,X
X=zeros(1,y);
for i=1:1:y
X(i)=B(i);
end
%%interest payment for the month
int_pay_mont=M-X;
%%---display result
srno=1:1:y;
result=[srno' M' X' int_pay_mont']
Output:
>> monthlypayment
ammount of the loan(P)
40000
annual interest rate(I in %)
6
number of years(Y)
10
result =
1 444.08 244.08 200
2 444.08 245.3 198.78
3 444.08 246.53 197.55
4 444.08 247.76 196.32
5 444.08 249 195.08
6 444.08 250.25 193.84
7 444.08 251.5 192.59
8 444.08 252.75 191.33
9 444.08 254.02 190.06
10 444.08 255.29 188.79
11 444.08 256.56 187.52
12 444.08 257.85 186.23
13 444.08 259.14 184.95
14 444.08 260.43 183.65
15 444.08 261.73 182.35
16 444.08 263.04 181.04
17 444.08 264.36 179.72
18 444.08 265.68 178.4
19 444.08 267.01 177.07
20 444.08 268.34 175.74
21 444.08 269.69 174.4
22 444.08 271.03 173.05
23 444.08 272.39 171.69
24 444.08 273.75 170.33
25 444.08 275.12 168.96
26 444.08 276.5 167.59
27 444.08 277.88 166.2
28 444.08 279.27 164.82
29 444.08 280.66 163.42
30 444.08 282.07 162.02
31 444.08 283.48 160.61
32 444.08 284.89 159.19
33 444.08 286.32 157.76
34 444.08 287.75 156.33
35 444.08 289.19 154.89
36 444.08 290.64 153.45
37 444.08 292.09 151.99
38 444.08 293.55 150.53
39 444.08 295.02 149.07
40 444.08 296.49 147.59
41 444.08 297.97 146.11
42 444.08 299.46 144.62
43 444.08 300.96 143.12
44 444.08 302.47 141.62
45 444.08 303.98 140.1
46 444.08 305.5 138.58
47 444.08 307.03 137.06
48 444.08 308.56 135.52
49 444.08 310.1 133.98
50 444.08 311.65 132.43
51 444.08 313.21 130.87
52 444.08 314.78 129.3
53 444.08 316.35 127.73
54 444.08 317.93 126.15
55 444.08 319.52 124.56
56 444.08 321.12 122.96
57 444.08 322.73 121.36
58 444.08 324.34 119.74
59 444.08 325.96 118.12
60 444.08 327.59 116.49
61 444.08 329.23 114.85
62 444.08 330.88 113.21
63 444.08 332.53 111.55
64 444.08 334.19 109.89
65 444.08 335.86 108.22
66 444.08 337.54 106.54
67 444.08 339.23 104.85
68 444.08 340.93 103.15
69 444.08 342.63 101.45
70 444.08 344.35 99.737
71 444.08 346.07 98.015
72 444.08 347.8 96.285
73 444.08 349.54 94.546
74 444.08 351.28 92.798
75 444.08 353.04 91.042
76 444.08 354.81 89.276
77 444.08 356.58 87.502
78 444.08 358.36 85.72
79 444.08 360.15 83.928
80 444.08 361.96 82.127
81 444.08 363.76 80.317
82 444.08 365.58 78.498
83 444.08 367.41 76.67
84 444.08 369.25 74.833
85 444.08 371.09 72.987
86 444.08 372.95 71.132
87 444.08 374.82 69.267
88 444.08 376.69 67.393
89 444.08 378.57 65.509
90 444.08 380.47 63.617
91 444.08 382.37 61.714
92 444.08 384.28 59.802
93 444.08 386.2 57.881
94 444.08 388.13 55.95
95 444.08 390.07 54.009
96 444.08 392.02 52.059
97 444.08 393.98 50.099
98 444.08 395.95 48.129
99 444.08 397.93 46.149
100 444.08 399.92 44.159
101 444.08 401.92 42.16
102 444.08 403.93 40.15
103 444.08 405.95 38.131
104 444.08 407.98 36.101
105 444.08 410.02 34.061
106 444.08 412.07 32.011
107 444.08 414.13 29.95
108 444.08 416.2 27.88
109 444.08 418.28 25.799
110 444.08 420.37 23.707
111 444.08 422.48 21.606
112 444.08 424.59 19.493
113 444.08 426.71 17.37
114 444.08 428.85 15.237
115 444.08 430.99 13.092
116 444.08 433.14 10.937
117 444.08 435.31 8.7717
118 444.08 437.49 6.5952
119 444.08 439.67 4.4077
120 444.08 441.87 2.2094
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.