Lab 7
Lab 7
I. Introduction
The other term for Gauss-Seidel method is Liebmenn method or method of successive
displacement. It is an iterative method that is used to solve linear system of equations.
Its name is from Carl Friedrich Gauss and Philipp Ludwig von Seidel, both German
mathematicians. It is similar to the Jacobi method.
Using this method, the convergence is only guaranteed if the matrix is symmetric and
positive definite it is diagonally dominant. However, this can be applied to any matrix
given that the elements in the diagonal are non-zero. It is the most commonly used
iterative method. Iteration is defined as the process of constructing a sequence that
solves a system of linear equations through approximate methods. This is done to
obtain the values of the roots system with the specified accuracy being the limits of the
sequence of some vectors [7]. It is an alternative to elimination methods.
Here the system[A]{X}={B} is reshaped by solving the first equation for x1, the
second equation for x2, and the third for x3, … and nth equation for xn. We will limit
ourselves to a 3x3 set of equations.
Now we can start the solution process by choosing guesses for the x’s. A simple way
to obtain initial guesses is to assume that they are zero. These zeros can be
substituted into x1 equation to calculate a new x1=b1/a11.
New x1 is substituted to calculate x2 and x3. The procedure is repeated until the
convergence criterion is satisfied:
II. Objectives
At the end of the activity, the students are expected to:
1. Recall the Gauss-Seidel Method in solving system of linear equations; and
2. Demonstrate on how to use GNU Octave in solving problems using Gauss-Seidel
Method.
III. Materials/Equipment
Computer with a full version of GNU Octave installed
IV. Procedure
1. Start the GNU Octave as instructed at the start of Laboratory Exercise 1 Part IV.
P a g e 51 | 70
2. Given the following problem [8], create an m-file to solve for the required values using
Gauss-Seidel Method. Write the code in Part V.1.
𝑣(𝑡) = 𝑎1 𝑡 2 + 𝑎2 𝑡 + 𝑎3 , 5 ≤ 𝑡 ≤ 12
Solution:
Using a matrix template of the form:
P a g e 52 | 70
At the end of first iteration, the values of a1, a2 and a3 are 3.6720, -7.8510 and -155.36,
respectively. The maximum absolute relative approximate error is 125.47%.
Try different initial guess to arrive at the true solution. Write the true values of a1, a2
and a3 in Part V.2.
P a g e 53 | 70
V. Observation Matrix
Instructions: Put your observations and calculated values in the space provided
1.
Gauss-Seidel Method
P a g e 54 | 70
Gauss-Seidel Method (Cont.)
2.
Gauss-Seidel Method
P a g e 55 | 70
VI. Guide Questions
In this part, please provide your answers to the guide questions in the space provided.
P a g e 56 | 70