just the maths slides number 17 5 numerical mathematics 5
play

JUST THE MATHS SLIDES NUMBER 17.5 NUMERICAL MATHEMATICS 5 - PDF document

JUST THE MATHS SLIDES NUMBER 17.5 NUMERICAL MATHEMATICS 5 (Iterative methods) for solving (simultaneous linear equations) by A.J.Hobson 17.5.1 Introduction 17.5.2 The Gauss-Jacobi iteration 17.5.3 The Gauss-Seidel iteration UNIT


  1. “JUST THE MATHS” SLIDES NUMBER 17.5 NUMERICAL MATHEMATICS 5 (Iterative methods) for solving (simultaneous linear equations) by A.J.Hobson 17.5.1 Introduction 17.5.2 The Gauss-Jacobi iteration 17.5.3 The Gauss-Seidel iteration

  2. UNIT 17.5 - NUMERICAL MATHEMATICS 5 ITERATIVE METHODS FOR SOLVING SIMULTANEOUS LINEAR EQUATIONS 17.5.1 INTRODUCTION An “iterative method” is one which is used repeat- edly until the results obtained acquire a pre-assigned de- gree of accuracy. For example, if results are required to five places of deci- mals, the number of “iterations” is continued until two consecutive iterations give the same result when rounded off to that number of decimal places. It is usually enough for the calculations themselves to be carried out to two extra places of decimals. A similar interpretation holds for accuracy which requires a certain number of significant figures . 1

  3. We shall discuss sets of simultaneous linear equations of the form a 1 x + b 1 y + c 1 z = k 1 , a 2 x + b 2 y + c 2 z = k 2 , a 3 x + b 3 y + c 3 z = k 3 . The system must be “diagonally dominant” , which, in this case, means that | a 1 | > | b 1 | + | c 1 | , | b 2 | > | a 2 | + | c 2 | , | c 3 | > | a 3 | + | b 3 | . The methods would be adaptable to a different number of simultaneous equations. 17.5.2 THE GAUSS-JACOBI ITERATION This method begins by making x the subject of the first equation, y the subject of the second equation and z the subject of the third equation. 2

  4. An initial approximation x 0 = 1 , y 0 = 1 , z 0 = 1 is substituted on the new right-hand sides to give values x = x 1 , y = y 1 and z = z 1 on the new left-hand sides. The results of the ( n + 1)-th iteration are as follows: x n +1 = 1 ( k 1 − b 1 y n − c 1 z n ) , a 1 y n +1 = 1 ( k 2 − a 2 x n − c 2 z n ) , b 2 z n +1 = 1 ( k 3 − a 3 x n − b 3 y n ) . c 3 EXAMPLES 1. Use the Gauss-Jacobi method to solve the simultaneous linear equations 5 x + y − z = 4 , x + 4 y + 2 z = 15 , x − 2 y + 5 z = 12 , obtaining x , y and z correct to the nearest integer. 3

  5. Solution x n +1 = 0 . 8 − 0 . 2 y n + 0 . 2 z n , y n +1 = 3 . 75 − 0 . 25 x n − 0 . 5 z n , z n +1 = 2 . 4 − 0 . 2 x n + 0 . 4 y n . Using x 0 = 1 , y 0 = 1 , z 0 = 1 , we obtain x 1 = 0 . 8 , y 1 = 3 . 0 , z 1 = 2 . 6 , x 2 = 0 . 72 , y 2 = 2 . 25 , z 2 = 3 . 44 , x 3 = 1 . 038 , y 3 = 1 . 85 , z 3 = 3 . 156 The results of the last two iterations both give x = 1 , y = 2 , z = 3 , when rounded to the nearest integer. In fact, these whole numbers are clearly seen to be the exact solutions. 4

  6. 2. Use the Gauss-Jacobi method to solve the simultaneous linear equations x + 7 y − z = 3 , 5 x + y + z = 9 , − 3 x + 2 y + 7 z = 17 , obtaining x , y and z correct to the nearest integer. Solution This set of equations is not diagonally dominant; but they can be rewritten as 7 y + x − z = 3 , y + 5 x + z = 9 , 2 y − 3 x + 7 z = 17 . Note: We could also interchange the first two of the original equations. 5

  7. Thus, y n +1 = 0 . 43 − 0 . 14 x n + 0 . 14 z n , x n +1 = 1 . 8 − 0 . 2 y n − 0 . 2 z n , z n +1 = 2 . 43 + 0 . 43 x n − 0 . 29 y n . Using y 0 = 1 , x 0 = 1 , z 0 = 1 , we obtain y 1 = 0 . 43 , x 1 = 1 . 4 , z 1 = 2 . 57 , y 2 = 0 . 59 , x 2 = 1 . 2 , z 2 = 2 . 91 , y 3 = 0 . 67 , x 3 = 1 . 1 , z 3 = 2 . 78 Hence, x = 1 , y = 1 , z = 3 to the nearest integer. 6

  8. 17.5.3 THE GAUSS-SEIDEL ITERATION This method differs from the Gauss-Jacobi Iteration in that successive approximations are used within each step as soon as they become available . The rate of convergence of this method is usually faster than that of the Gauss-Jacobi method. The scheme of the calculations is according to the follow- ing pattern: x n +1 = 1 ( k 1 − b 1 y n − c 1 z n ) , a 1 y n +1 = 1 ( k 2 − a 2 x n +1 − c 2 z n ) , b 2 z n +1 = 1 ( k 3 − a 3 x n +1 − b 3 y n +1 ) . c 3 7

  9. EXAMPLES 1. Use the Gauss-Seidel method to solve the simultaneous linear equations 5 x + y − z = 4 , x + 4 y + 2 z = 15 , x − 2 y + 5 z = 12 . Solution x n +1 = 0 . 8 − 0 . 2 y n + 0 . 2 z n , y n +1 = 3 . 75 − 0 . 25 x n +1 − 0 . 5 z n , z n +1 = 2 . 4 − 0 . 2 x n +1 + 0 . 4 y n +1 . The sequence of successive results is as follows: x 0 = 1 , y 0 = 1 , z 0 = 1 , x 1 = 0 . 8 , y 1 = 3 . 05 , z 1 = 3 . 46 , x 2 = 0 . 88 , y 2 = 1 . 80 , z 2 = 2 . 94 , x 3 = 1 . 03 , y 3 = 2 . 02 , z 3 = 3 . 00 Hence, x = 1 , y = 2 , z = 3 to the nearest integer. 8

  10. 2. Use the Gauss-Seidel method to solve the simultaneous linear equations: 7 y + x − z = 3 , y + 5 x + z = 9 , 2 y − 3 x + 7 z = 17 . Solution y n +1 = 0 . 43 − 0 . 14 x n + 0 . 14 z n , x n +1 = 1 . 8 − 0 . 2 y n +1 − 0 . 2 z n , z n +1 = 2 . 43 + 0 . 43 x n +1 − 0 . 29 y n +1 . The sequence of successive results is: y 0 = 1 , x 0 = 1 , z 0 = 1 , y 1 = 0 . 43 , x 1 = 1 . 51 , z 1 = 2 . 96 , y 2 = 0 . 63 , x 2 = 1 . 08 , z 2 = 2 . 71 , y 3 = 0 . 66 , x 3 = 1 . 13 , z 3 = 2 . 73 The solutions are x = 1 , y = 1 , z = 3 to the nearest integer. 9

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend