Interpretation of Results
In experiment 2: Solving a Systems of Linear Equations involves the use of different
matrix operations. It discusses about the special types of matrices, different matrix mathematical
operation, the techniques in evaluating system of linear equations, and the different direct and
iterative methods in solving linear equation.
It has four objectives for the experiment; by understanding the matrix operation, learning
how to solve linear equations using the software of MATLAB, learning how to apply the direct
methods in evaluating linear equations using MATLAB, and lastly, is to understand the iterative
method in solving linear equations using the software.
During the experiment, the students were assigned to solve items consisting of given
unknown variables with the use of direct and iterative methods to obtain its values. For the first
given problem, using the direct methods, 13v+3x+4y-5z=-6; 6v+22x-8y+9z=96;
10v+11x+34y+13z=312; 14v+15x+16y+46z=416.
The first method that has been used is the method of inverse of a matrix. It starts with
letting a variable to a matrix containing the coefficients of the equations. From the results, the
matrix has let A=[13 3 4 -5; 6 22 -8 9; 10 11 34 13; 14 15 16 46]. These are the coefficients of
the equations excluding the constants of it. For the constants, the code is to let C=[-6; 96; 31;
416], which are the constants of the given equations. For the next step, the inverse of the matrix
should be obtained so the code is to let B=Inv(A), where it displays on the screen another matrix
containing the inverse of the matrix A. Lastly, in the process of getting the inverse of a matrix,
the inverse matrix and the constants must be multiplied so the code is to let D=B*C to get their
product. The results for every variable are shown where v is -0.9709, x with a value of 4.3207, y
containing a value of 5.8040, and a value of 5.9113 for the variable z.
For the next direct method, the method of Cramer’s rule, it is a process of having two
matrices and getting the determinant of both. The first matrix contains the same
numbers/coefficients of the equations, while for the second matrix is by obtaining the values in a
column way and replacing the given column by the constants. For the first variable v, it is to let
A=[13 3 4 -5; 6 22 -8 9; 10 11 34 13; 14 15 16 46] and let C=det(A) to obtain the determinant of
the first matrix. For the second matrix, the code is to let B=[-6 96 312 416; 3 22 11 15; 4 -8 34
16; -5 9 13 46], where the first column is replaced by the constants since v is the first variable.
The next code is to let D=det(B) to obtain the determinant of the second matrix and determine its
quotient with the first determinant. So lastly, the code is to let E=D/C to divide the second
determinant and first determinant to obtain the value of variable v. For the next steps, the
processes are still the same, it only differs on the replacement of constants on which column
depending on the variable. Since the next is variable x, the second matrix would be having
constants for the 2nd column. Lastly, the variable y for the third column and the last variable z
have the constants on the 4th column.
The simplest direct method is the gauss-jordan elimination method. It is by letting X=[13
3 4 -5 -6; 6 22 -8 9 96; 10 11 34 13 312; 14 15 16 46 416] and apply the code of >>rref(X). It
would constantly display the values for each unknown variable.
In comparison to the direct methods, the iterative methods contain longer process because
of obtaining the values until the nth iteration where the error of it would become zero. On the
first step of the process, it would assume that all the unknown variables are all zero. Then as
the process flow, the recent values computed for every process of the iteration process would
then be substituted into the succeeding equations. For the entire method, it would repeat the same
process until it reached the objective of being accurate and having the amount of error reaching
to zero. For the second given problem, it took 27 iterations before achieving the value of the
unknowns with an error of zero in all variables.
For all the methods done on direct and iterative process, it can be concluded that the
codes and answers are answered correctly since every method come up with the same answers.
Conclusion
The experiment 2: Solving a Systems of Linear Equation has been helpful for the student
as it have discussed different methods on solving linear equations using the software of
MATLAB.
The student have also met the objectives of the experiment and able to perform different
commands on utilizing MATLAB. It can be concluded that determining the unknown values of
the variables in equations have been made easier and convenient as the student have learned the
way of using MATLAB with regards to the commands used on solving the given problems.
The student had also learned the direct and iterative methods used on solving linear
equations based from the results of the experiment. The direct methods containing the inverse of
a matrix, Cramer’s rule, Gauss-Jordan Elimination Method, and the LU Decomposition. For the
iterative method, it includes the iteration method and the Gauss-Siedel method.
References
Experiment 2: Solving a Systems of Linear Equations (Laboratory Manual)
www.mathworks.com (MATLAB)
www.cimss.ssec.wisc.edu