UNIT-5_MATLAB PROGRAMMING_QUESTION BANK_SOLUTION
UNIT-5_MATLAB PROGRAMMING_QUESTION BANK_SOLUTION
UNIT-5_MATLAB PROGRAMMING_QUESTION BANK_SOLUTION
2.Elimination Method
The elimination method of solving a system of linear equations algebraically is the most widely used
method out of all the methods to solve linear equations. In the elimination method, we eliminate any one
of the variables by using basic arithmetic operations and then simplify the equation to find the value of
the other variable. Then we can put that value in any of the equations to find the value of the variable
eliminated.
Course Code: 20EC0454 R20
The above matrix is the resulting matrix. Hence convert the above matrix in equation form to get the
values of x, y, z.
The final equations are as follows,
x+y+z=4
3y + 2z = 4
Course Code: 20EC0454 R20
7y = 0
From this set, we can automatically observe that the value of the variable y is equal to 0. Now by using
this knowledge to substitute it on the second equation to solve for z, and then substitute both y and z
values on the first equation to solve for x.
1.y = 0
2.30 + 2z = 4
2z = 4
z=2
3.x + y + z = 4
x+0+2=4
x = 4-2
x=2
And the final solution for the set is:
x=2;
y=0;
z=2;
Hence it is solved.
3.MATRIX METHOD-Cramers Method
Cramer’s Rule is used to find the unknowns in the given system of linear equations. Cramer’s Rule is the
most commonly used formula for finding the solution for the given system of linear equations in matrix
form. Cramer’s Rule uses the concept of the determinant to find its solution.
Cramer’s Rule Formula
Cramer’s Rule Formula is used to solve the system of equations in the form
AX = B
where,
A is the coefficient matrix
B is the column matrix of constants
X is the column matrix of unknowns
Course Code: 20EC0454 R20
1 b Solve the following equations, using the matrix inverse method. [L3][CO1][6M]
2x1 + 9x2 =5
3x1 - 4x2 =7
Solution:
A is a square matrix and so we can find its determinant.
det (A) = 1 (45 - 48) - 2 (36 - 42) + 3 (32 - 35)
= -3 + 12 - 9
=0
So ρ (A) ≠ order of the matrix. i.e., ρ (A) ≠ 3.
Now, we will see whether we can find any non-zero minor of order 2.
So there exists a minor of order 2 (or 2 × 2) which is non-zero. So the rank of A, ρ (A) = 2.
3 a Write MATLAB script using left division method to solve the following set of [L1][CO4][6M]
equations.
5 x1 - 3 x2 = 21
7 x1 - 2 x2 = 36
3 b For what cases left division method gives error? Explain. [L2][CO5][6M]
6 b The following table shows how many hours reactors A and B need to [L4][CO1][6M]
produce 1 ton each of the chemical products 1, 2, and 3. The two reactors
are available for 40 and 30 hr per week, respectively. Determine how many
tons of each product can be produced each week.
Hours Product 1 Product 2 Product 3
Reactor A 5 3 3
Reactor B 3 3 4
7 b Solve the following equations and discuss the solution for two cases: [L3][CO3][6M]
c = 9 and c =10.
x1 + x2 = 1
x1 + 2 x2 = 3
x1 + 5 7x2 = c
8 a Explain how least square method is helpful to solve over determined Systems. [L2][CO1][6M]
8 b Solve the following equations, using the matrix inverse method. [L1][CO3][6M]
3x1 - 4x2 = 5
6x1 + 8x2 = 2
9 a Discuss in brief about: a) Under determined system b) over determined system. [L2][CO4][6M]
9 b List the different methods of transfer functions in MATLAB with examples. [L1][CO1][6M]