0% found this document useful (0 votes)
21 views2 pages

Iterative Methods

Uploaded by

nickcondelosano
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
21 views2 pages

Iterative Methods

Uploaded by

nickcondelosano
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

NUMERICAL SOLUTIONS TO CE PROBLEMS

Solving Systems of Linear Equations


______________________________________________________________________________________________________________________________________________________________

ITERATIVE METHODS Iteration 0 1 2


9 + (1) − (1) 11 13
The goal of iterative approaches is to discover values that satisfy a system of linear equations or matrices within an x 1 9 + (− ) − ( ) 𝟑𝟏
=𝟑 9 3 =
acceptable range of error. The final value would be known through the repeating of steps or iteration. 3 3 𝟐𝟕
−17 − (1) + 7(1) 𝟏𝟏 13
−17 − (3) + 7 ( ) 𝟑𝟏
• JACOBI METHOD y 1
9
=−
𝟗
3 =
9 𝟐𝟕
In order to properly perform an iterative method using the Jacobi Method, certain conditions must be met: 11
25 − 2(1) + 3(1) 𝟏𝟑 25 − 2(3) + 3 (− )
z 1 = 9 = 𝟐𝟑
1. It must be linear 6 𝟑 6 𝟗
2. The matrix must be a square matrix.
3. The matrix must be diagonally dominant. This means that every number from the diagonal of a matrix
must be greater than or equal to the sum of the magnitude of the other numbers from their respective Plugging in the fractions would give a more accurate next value. If we try to continue this process, we can get the
row. And at least one of the diagonal numbers must be greater than the sum of the magnitude of its following values in decimals:
respective row. Iteration 3 4 5 ... 32 33
x 2.530864198 1.537722908 2.303612254 ... 1.999888668 2.000082863
Let’s have the following as an example: y -0.02880658 1.219478738 0.513641213 ... 1.000118811 0.999911431
𝐸𝑞. 1: 3𝑥 − 𝑦 + 𝑧 = 9 𝟑 −1 1 𝑥 9 z 4.358024691 3.308641975 4.263831733 ... 3.999870221 4.000096516
𝐸𝑞. 2: 𝑥 + 9𝑦 − 7𝑧 = −17 (1 𝟗 −7) (𝑦) = (−17)
𝐸𝑞. 3: 2𝑥 − 3𝑦 + 6𝑧 = 25 2 −3 𝟔 𝑧 25
From the table, we can observe that at the 33rd iteration, the values for x, y, and z are converging to values of 2, 1,
We must first make sure that the matrix is diagonally dominant. and 4 respectively. This can be easily done using computer software as this is time-consuming to do by hand.
For R1, |-1|+1=2<3 Checking if the values satisfy the equations
For R2, 1+|-7|=8<9
𝐸𝑞. 1: 3(2) − (1) + (4) = 9 (𝑜𝑘)
For R3, 2+|-3|=5<6 𝐸𝑞. 2: (2) + 9(1) − 7(4) = −17(𝑜𝑘)
𝐸𝑞. 3: 2(2) − 3(1) + 6(4) = 25(𝑜𝑘)
This means it is diagonally dominant.
Next, we isolate each variable which have the diagonal numbers as coefficients: We can also use the actual values computed in the iteration and we can use the computed value to know the error.
9+𝑦−𝑧
𝐹𝑟𝑜𝑚 𝐸𝑞. 1: 𝑥 =
3
−17 − 𝑥 + 7𝑧
𝐹𝑟𝑜𝑚 𝐸𝑞. 2: 𝑦 =
9
25 − 2𝑥 + 3𝑦
𝐹𝑟𝑜𝑚 𝐸𝑞. 3: 𝑧 =
6
Next step is to choose a starting point or value. In this example we will use 1 for all variables. We will first substitute
the starting value for all equations, then the resulting value will be the new values to plug in for the next iteration
NUMERICAL SOLUTIONS TO CE PROBLEMS
Solving Systems of Linear Equations
______________________________________________________________________________________________________________________________________________________________

• GAUSS-SEIDEL METHOD Try Solving This


This method is similar to the Jacobi Method, but during iteration, the resulting values are used by the other equations Using the Jacobi Method and the Gauss-Seidel Method, compute the values of the unknowns at the fifth iteration
in that same iteration. To better understand this, we will use the same previous example. The difference is on the using a starting value of 0 for all variables for the following system of equations:
way the values are plugged in.
8𝑥 + 𝑦 − 2𝑧 = 23
9+𝑦−𝑧 −𝑥 + 2𝑦 + 𝑧 = 5
𝐹𝑟𝑜𝑚 𝐸𝑞. 1: 𝑥 =
3 3𝑥 + 2𝑦 − 5𝑧 = 5
−17 − 𝑥 + 7𝑧
𝐹𝑟𝑜𝑚 𝐸𝑞. 2: 𝑦 =
9
25 − 2𝑥 + 3𝑦
𝐹𝑟𝑜𝑚 𝐸𝑞. 3: 𝑧 =
6

Iteration 0 1 2
9 + (1) − (1) 13 22
x 1 9 + (− ) − ( ) 𝟒𝟔
𝑥= =𝟑 𝑥= 9 9 =
3 3 𝟐𝟕
−17 − (3) + 7(1) 𝟏𝟑 46 22
−17 − ( ) + 7 ( )
y 1 𝑦= =− 𝑦= 27 9 = − 𝟒𝟑
9 𝟗 9 𝟐𝟒𝟑
13 46 43
25 − 2(3) + 3(− ) 25 − 2 ( ) + 3 (− )
z 1 𝑧= 9 = 𝟐𝟐 𝑧= 27 243 = 𝟖𝟓𝟑
6 𝟗 6 𝟐𝟒𝟑

We can observe that after finding the value for x, this value is then used to find the y value, and this y value is
plugged in to find the z value along with the previously resulting x value. For the second iteration, the values
plugged in to find x were the results in the previous iteration, this process will then repeat. By doing so, the value
for each variable can be observed to be reaching a number:

Iteration 3 4 5 6 7 8
x 1.770919 1.915308 1.979019 1.997217 2.000473 2.000468
y 0.644566 0.930577 0.997291 1.004695 1.002495 1.000795
z 3.898643 3.99352 4.005639 4.003275 4.00109 4.000242

From the table, we can observe that the solutions for the equation are approaching 2, 1, and 4 for x, y, and z
respectively, similar to the previous example.

You might also like