Documente Academic
Documente Profesional
Documente Cultură
Saharudin Haron
Page 4 - 1
Page 4 - 3
a11 a 21 a31 a n1
a11x1 + a12x2 + a13x3 + .. + a1nxn = c1 a21x1 + a22x2 + a23x3 + .. + a2nxn = c2 a31x1 + a32x2 + a33x3 + .. + a3nxn = c3 : : : : : : an1x1 + an2x2 + an3x3 + .. + annxn = cn
a11 a 21 a31 a n1
c1 c2 c3 c4
Page 4 - 5
A) Forward elimination a) To eliminate the first unknown, x1, from the second through the nth row/eqn. - row/eqn (1) is called the pivot equation, and a11 is called pivot element.
a11 a 21 a31
c1 (1) c 2 ( 2) c3 (3)
a11
the prime ' indicates that the elements have been modified.
Page 4 - 6
b) To eliminate the second unknown, x2, from the third through the nth row/eqn. - row/eqn (2') is called the pivot equation.
a11
(2'a) (3'')
a12 a22
the double prime '' indicates that the elements have been modified twice.
Page 4 - 7
the result x3 can be back-substituted into eqn (2') and (1) to solve for x2 and x1.
a23 x3 ) / a22 x2 = ( c2 x1 = (c1 a12 x2 a13 x3 ) / a11
Page 4 - 8
Use Nave Gauss elimination to solve the following equations. x1 + x2 x3 = -3 6x1 + 2x2 + 2x3 = 2 -3x1 + 4x2 + x3 = 1
Page 4 - 9
Gauss-Jordan Elimination
Steps of Gauss-Jordan Elimination (ex. 3 unknowns in 3 equations).
a)
Change the value of a11 to 1 and eliminate the other elements in the first column. a11 a 21 a31 a12 a22 a32 a13 a23 a33 c1 (1) c 2 ( 2) c3 (3)
1 a12 0 a 22 0 a32
(1) c1 ( 2) c2 c3 (3)
(1) x 1/a11 (1') x a21 (2) (1'a) (1') x a31 (3) (1'b)
the prime ' indicates that the elements have been modified.
Page 4 - 10
b) Change the value of a'22 to 1 and eliminate the other elements in the second column. 1 a12 0 a 22 0 a32 a13 a23 a33 (1) c1 ( 2) c2 c3 (3)
1 0 a13 0 1 a 23 0 0 a33
(2') x 1/a'22 (2'') x a'12 (1') (2''a) (2'') x a'32 (3') (2''b)
the double prime '' indicates that the elements have been modified twice.
Page 4 - 11
c)
Change the value of a''33 to 1 and eliminate the other elements in the third column. 1 0 a13 0 1 a 23 0 0 a33 (1) c1 (2) c2 c3 (3)
(3'') x 1/a''33 (3) x a''13 (1'') (3a) (3) x a''23 (2'') (3b)
the triple prime indicates that the elements have been modified three times.
Page 4 - 12
d) The value of the unknowns can be determined directly without the back substitution step as in the nave gauss elimination. (1) 1 0 0 c1 0 1 0 c (2) 2 (3) 0 0 1 c3 1 0 0 x1 c1 0 1 0 x = c 2 2 c3 0 0 1 x3
x1 = c1 x2 = c2 x3 = c3
Page 4 - 13
a11x1 + a12x2 + a13x3 + .. + a1nxn = c1 a21x1 + a22x2 + a23x3 + .. + a2nxn = c2 a31x1 + a32x2 + a33x3 + .. + a3nxn = c3 : : : : : : an1x1 + an2x2 + an3x3 + .. + annxn = cn c a x a13 x 3 L a1n x n x1 = 1 12 2 a11
x3 = c3 a31 x1 a32 x2 L a3n xn a33 x2 = xn = c2 a21 x1 a23 x3 L a2 n xn a22 cn an 2 x2 an 3 x3 L anm xm ann
Page 4 - 14
x1 =
x2 = x3 =
Second Iteration
a ,i
x ij xi j 1 = 100% < s j xi
convergence criteria where j and j -1 are the present and previous iterations
Page 4 - 15
Gauss Seidel
(assignment in class)
Use the Gauss Seidel method to solve the following equations (s = 5 %). 17x1 - 2x2 - 3x3 = 500 -5x1 + 21x2 - 2x3 = 200 -5x1 - 5x2 + 22x3 = 30
Page 4 - 16
(2 m3/s)(c2) (5 m3/s)(c1) R1
(3 m3/s)(c3)
(5 m /s)(c1)
Figure 1.0
500 g/s
(7 m3/s)(c1)
Page 4 - 17