UNIT-5_MATLAB PROGRAMMING_QUESTION BANK_SOLUTION

Download as pdf or txt
Download as pdf or txt
You are on page 1of 7

Course Code: 20EC0454 R20

SIDDHARTH INSTITUTE OF ENGINEERING & TECHNOLOGY


(AUTONOMOUS)
(Approved by AICTE, New Delhi& Affiliated to JNTUA, Ananthapuramu)
(Accredited by NBA for Civil, EEE, Mech., ECE & CSE)
(Accredited by NAAC with ‘A+’ Grade)
Puttur -517583, Tirupati District, A.P. (India)
QUESTION BANK WITH SOLUTION
Subject with MATLABPROGRAMMING Course & B.Tech. – CSE, CSIT
Code (20EC0454) Branch
Year & Sem IV-B.Tech.&I-Sem Regulation R20
UNIT – V
LINEAR ALGEBRAIC EQUATIONS

1 a Explain matrix methods for linear equations with example. [L2][CO2][6M]


1.Substitution Method
One of the methods to solve a system of linear equations in two variables algebraically is the "substitution
method". In this method, we find the value of any one of the variables by isolating it on one side and
taking every other term on the other side of the equation. Then we substitute that value in the second
equation.

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

3.MATRIX METHOD-Gauss Elimination Method


A system of linear equations with various unknown factors is known as a system of linear
equations. Unknown factors can be found in various equations, as we all know. To check all of the
equations that make up the system, you must find the value for the unknown factors. We can state that the
given system is a consistent independent system if there is a single solution that indicates one value for
each unknown factor. If there are several solutions, the system has an infinite number of solutions, then
we call it a consistent dependent system.
Given system of equations are as follows,
x+y+z=4
x + 4y + 3z = 8
x + 6y + 2z = 6

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

2 a Define Rank of Matrix with suitable example. [L1][CO1][6M]


The rank of a matrix is equal to the number of linearly independent rows (or columns) in it. Hence, it
cannot more than its number of rows and columns. For example, if we consider the identity matrix of
order 3 × 3, all its rows (or columns) are linearly independent and hence its rank is 3.
How to Find the Rank of a Matrix?
The rank of a matrix can be found using three methods. The most easiest of these methods is "converting
matrix into echelon form".
• Minor method
• Using echelon form
• Using normal form
Finding Rank of a Matrix by Minor Method
Here are the steps to find the rank of a matrix A by the minor method.
• Find the determinant of A (if A is a square matrix). If det (A) ≠ 0, then the rank of A = order of A.
• If either det A = 0 (in case of a square matrix) or A is a rectangular matrix, then see whether there
exists any minor of maximum possible order is non-zero. If there exists such non-zero minor, then
rank of A = order of that particular minor.
• Repeat the above step if all the minors of the order considered in the above step are zeros and then try
to find a non-zero minor of order that is 1 less than the order from the above step.
Course Code: 20EC0454 R20
Here is an example.

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.

2 b For what values of C will the following set [L2][CO4][6M]


(a) have a unique solution and
(b) Have an infinite number of solutions?
Find the relation between x1 and x2 for these solutions.
6 x1 + C x2 = 0
2 x1 + 4 x2 = 0

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]

4 a Explain the Reduced Row Echelon Form with an example. [L2][CO3][6M]

4 b The following underdetermined equation has an infinite number of solutions [L3][CO4][6M]


exist. Use the “ rref “ function to obtain the solutions.
2 x1 - 4 x2 + 5 x3 = -4
-4 x1 - 2 x2 + 3 x3 = 4
2 x1 + 6 x2 - 8 x3 = 0

5 a Explain how Cramer’s Rule performed in MATLAB? with an example. [L5][CO1][6M]


Course Code: 20EC0454 R20
5 b Find the system of Linear Equations using Cramer’s Rule. [L1][CO6][6M]
2x + y + z = 3
x–y–z=0
x + 2y + z = 0

6 a Explain Underdetermined Systems with an example. [L5][CO4][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 a Explain Overdetermined Systems with an example. [L2][CO1][6M]

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]

10 a a) Use MATLAB to solve the following equations for x, y, and z as [L4][CO3][6M]


x - 5y - 2z = 11c
6x + 3y + z = 13c
Course Code: 20EC0454 R20
7x + 3y - 5z = 10c
b) Plot the solutions for x, y, and z versus c on the same plot, for -10 ≤ c ≤10.

10 b Discuss about computational difficulties using theoretical linear algebra [L2][CO5][6M]


techniques.

You might also like