MTP 290 - Problem Set 4
(1) Write a MATLAB script to solve the linear system Ax = b, where A is an
invertible diagonal matrix. Taking A = diag(1, 2, 3) and b = [1, 1, 1]T , solve
for x.
(2) Write MATLAB code to implement the forward substitution method to
solve the linear system Ax = b, where A is a non-singular lower triangular
matrix. Use it to solve for x if A and b are given as follows:
0 1
1 0 0
A=@ 1 1 0 A
3 0.5 1
and b = [1, 2, 1]T .
(3) Write a MATLAB script for implementing the backward substitution method
to solve the system Ax = b, where A is a non-singular upper triangular ma-
trix. Use this code to solve for x if A and b are as follows:
0 1
1 1 3
A=@ 0 2 3 A
0 0 6.5
and b = [1, 7, 6.5]T .
(4) Implement Gauss elimination method for solving a system of linear equa-
tions Ax = b, where A is a non-singular matrix.
(5) Use Gauss elimination method to solve
4x1 + x2 x3 = 2
5x1 + x2 + 2x3 = 4
6x1 + x2 + x3 = 6.
(6) Consider
0 1
10 7 0
A=@ 3 2.099 6 A.
5 1 5
Find the determinant of A using Gauss elimination method.
(7) Use of Gauss elimination method on the coefficient matrix
0 1
25 c 1
A = @ 64 a 1 A .
144 b 1
reduces it to
0 1
25 5 1
B=@ 0 4.8 1.56 A .
0 0 0.7
What is the determinant of A?
(8) The following data is given for the velocity of the rocket as a function of
time. To find the velocity at t = 21s, you are asked to use a quadratic
polynomial, v(t) = at2 + bt + c to approximate the velocity profile.
1
2
t(s) 0 14 15 20 30 35
v(t)m/s 0 227.04 362.78 517.35 602.97 901.67
The correct set of equations that will find a, b and c are
225a + 15b + c = 362.78
400a + 20b + c = 517.35
900a + 30b + c = 602.97.
Find the velocity at t = 21s.
(9) Implement the Gauss elimination method with partial pivoting to solve a
system of linear equations Ax = b, where A is a non-singular matrix.
(10) Solve the following linear system by Gauss elimination method and Gauss
elimination method with partial pivoting.
x+y+z = 3
x + 2y + 2z = 5
3x + 4y + 4z = 12.
(11) Apply the modified solver implemented in Problem 9 to solve the following
system. Further check the di↵erence between the computed solution x and
the result of MATLAB built in solver A\b.
x1 + x2 + x4 = 2
2x1 + x2 x3 + x4 = 1
4x1 x2 2x3 + 2x4 = 0
3x1 x2 x3 + x4 = 3.
(12) Implement Gauss Jordan method to solve a system of linear equations Ax =
b, where A is a non-singular matrix.
(13) Redo the problem 5 and 10 using Gauss-Jordan method.