Mathematics II
Mathematics II
ASSIGNMENT
Prepared by:
Misbaah Naz
2020A7PS0232U
Submitted to:
Dr.Priti Bajpayee
Date Submitted:
29/4/21
ACKNOWLEDGMENT
2. Questions
a. Codes
b. Output
3. Conclusions
4. Bibliography
MATLAB
MATLAB (Matrix laboratory) is a proprietary multi-
paradigm programming language and numeric
computing environment developed by MathWorks and
designed by Cleve Moler. It’s also used for
matrix manipulations, plotting of functions and data,
implementation of algorithms, creation of user interfaces,
and interfacing with programs written in other languages.
where,
the elements to the left of the dotted line are the
coefficients of x, y and z of system of equations[(A)].
the elements to the right of the dotted line are the
constants of system of equations[(B)].
Augmented matrix is then reduced to RREF resulting as
1 0 0 e
0 1 0 f
0 0 1 g
Giving x = e
y=f
z=g
Solutions of Linear System of Equations
1. If r(A) ≠ r(A:B),
then system has no solutions.
0 2 -2 -1 0
RREF of matrix is as follows
1 0 0 -1/2 0
0 1 0 -1 0
0 0 1 -1/2 0
We can conclude that the general solution are
x = k/2, y = k, z = k/2, w = k
where k is arbitrary. If k=2 then,
x = 1,
y = 2,
z = 1,
w = 2.
Therefore the balanced equation is
CH4 + 2O2 → CO2 + 2H2O
Questions
1. For given system of linear equations, find general
solution using Gauss-Jordan Elimination.
x + 2y + z = 9
2x + 2y – z = 2
3x – y + 2z = 9
Code:
Output:
Therefore,
x=1, y=2, z=4
r(A)=r(A:B)=n(3)
system has unique solution ; unique solution:(1,2,4).
Graph:
2. For given system of linear equations, find general
solution using Gauss-Jordan Elimination.
3x + y + 2z = 6
X + y +z + w =6
2x + y – z = 3
Code:
Output :
Code:
Output :
Code:
Output :
r(A) = r(A:B) = n
therefore the system has unique solution.
The general solution : (3.4, -1.4, -1.8)
Graph:
CONCLUSIONS
This assignment helped in connecting theoretical
knowledge to practical applications. Through this
assignment many functions of MATLAB have been
learned and realized it’s ability in solving system of linear
equations.
We can solve the equations manually through row
operations giving the same solution. But MATLAB
provides solutions more accurately and less time
consuming.
BIBLOGRAPHY
MATLAB Software
Wikipedia
Elementary Linear Algebra with Supplemental
Applications, Howard Anton and Chris Rorres,11th
Edition.
Youtube