Question 1192827: Evaluate the equations below using the Gauss-seidel Method, at-least 5 iterations.
3x + 2y + 4z = 12
x + 5y + 2z = -9
7x + 2y + z = 5
Found 2 solutions by Edwin McCravy, greenestamps: Answer by Edwin McCravy(20056) (Show Source):
You can put this solution on YOUR website!
To do this efficiently you need something like a not too old TI-84
calculator, and to learn how to store a number for a letter, and
how to scroll up to bring back expressions you have previously used,
so you won't have to type them in but once.
Rearrange the equations, if possible, so that
1. the equation that comes 1st is one which has its
x-coefficient greater in absolute value than either
its y-coefficient or its z-coefficient.
2. the equation that comes 2nd is one which has its
y-coefficient greater in absolute value than either
its x-coefficient or its z-coefficient.
3. the equation that comes 3rd is one which has its
z-coefficient greater in absolute value than either
its x-coefficient or its y-coefficient.
In other words, the largest coefficient in each equation
is on the diagonal.
Solve the first for x, the second for y, and the third for z
Iteration| x | y | z |
1 | 0.0000| 0.0000| 0.0000|
2 | 0.7143|-1.9429| 3.4357|
3 | 0.7786|-3.3300| 4.0811|
4 | 1.0827|-3.6490| 4.0125|
5 | 1.1836|-3.6417| 3.9331|
6 | 1.1848|-3.6011| 3.9120|
Start out with all 0's for the first iteration.
Substitute (x,y,z)=(0,0,0) in the equation for x, get x=0.7143.
Substitute (x,y,z)=(0.7143,0,0) in the equation for y, get y=-1.9429.
Substitute (x,y,z)=(0.7143,-1.9429,0) in the equation for z, get z=-3.4357.
That's the end of the 2nd iteration. Now we begin the 3rd iteration.
Substitute (x,y,z)=(0.7143,-1.9429,-3.4357) in the equation for x,
get 0.7786.
etc., etc.
The actual solution using the methods of 2nd year algebra, gives:
You can see that the iterations are getting closer and closer to
the actual solutions.
Edwin
Answer by greenestamps(13200) (Show Source):
You can put this solution on YOUR website!
3x + 2y + 4z = 12
x + 5y + 2z = -9
7x + 2y + z = 5
I have to admit that this method is new to me; I have never run across it before. Thanks for submitting a question that lets me learn something new.
After viewing a couple of online videos, it appears the method is well defined.
(1) Rearrange the equations so that the system is in "diagonally dominant" form:
-----------------------------------------------------------
NOTE: See the response from tutor @Edwin for a description of "diagonally dominant form"....
-----------------------------------------------------------
7x + 2y + z = 5
x + 5y + 2z = -9
3x + 2y + 4z = 12
(2) Solve the first equation for x; the second for y; and the third for z:
[1] x=(5-2y-z)/7
[2] y=(-9-x-2z)/5
[3] z=(12-3x-2y)/4
(3) Choose random starting values x(0), y(0), and z(0) for the three variables.
(4) Use the most recent values of y and z in [1] to compute the next iteration of x;
(5) Use the most recent values of x and z in [2] to compute the next iteration of y;
(6) Use the most recent values of x and y in [3] to compute the next iteration of z;
(7) Repeat (4) to (6) until the desired number of iterations have been made.
The calculations are impossible by hand; and they are extremely awkward using a calculator. However, they are quite easy to perform using a spreadsheet program.
Here is a description of how to do that.
Make column A the iteration number: A1=0, A2=1, ..., A6=5 (since you are doing 5 iterations).
Columns B, C, and D will be the iterated values of x, y, and z. Put your initial random guesses (iteration 0) in row 1: B1=0; C1=0; D1=0. (you can use any numbers there....)
Cell B2 will contain the first iteration of x, using equation [1] and the most recent values of variables y and z: B2=(5-2*C1-D1)/7.
Cell C2 will contain the first iteration of y, using equation [2] and the most recent values of variables x and z: C2=(-9-B2-2*C1)/5.
Cell D2 will contain the first iteration of z, using equation [3] and the most recent values of variables x and y: D2=(12-3*B2-2*C2)/4
Now for the beauty of excel....
To compute the remaining iterations 2 through 5, simply copy the formulas in cells B2 to D2 down into rows 3 through 6 by highlighting cells B2 to D2 and using ctrl-D to drag those formulas into the other rows.
I don't know how to copy the results of my excel file here, so I will recreate it....
iteration x y z
0 0 0 0
1 0.714286 -1.94286 3.435714
2 0.778571 -3.33 4.081071
3 1.082704 -3.64897 4.012457
4 1.18364 -3.64171 3.933125
5 1.192899 -3.61183 3.91124
So the solution after 5 iterations is
(1.192899, -3.61183, 3.91124)
The exact solution is (122/103, -371/103, 403/103)
which to several decimal places is
(1.184466, -3.60194, 3.912621)
Note if you do this exercise in excel on your own and continue for about 14 iterations, the solutions will be exact to 5 or 6 decimal places.
|
|
|