Numerical Solution of Linear Equations

Slides:



Advertisements
Similar presentations
Rules of Matrix Arithmetic
Advertisements

Chapter 2 Solutions of Systems of Linear Equations / Matrix Inversion
Chapter: 3c System of Linear Equations
Algebraic, transcendental (i.e., involving trigonometric and exponential functions), ordinary differential equations, or partial differential equations...
Solving Linear Systems (Numerical Recipes, Chap 2)
Autar Kaw Benjamin Rigsby Transforming Numerical Methods Education for STEM Undergraduates.
SOLVING SYSTEMS OF LINEAR EQUATIONS. Overview A matrix consists of a rectangular array of elements represented by a single symbol (example: [A]). An individual.
Rayan Alsemmeri Amseena Mansoor. LINEAR SYSTEMS Jacobi method is used to solve linear systems of the form Ax=b, where A is the square and invertible.
Lecture 9: Introduction to Matrix Inversion Gaussian Elimination Sections 2.4, 2.5, 2.6 Sections 2.2.3, 2.3.
Numerical Algorithms Matrix multiplication
Major: All Engineering Majors Author(s): Autar Kaw
Special Matrices and Gauss-Siedel
Goldstein/Schnieder/Lay: Finite Math & Its Applications, 9e 1 of 86 Chapter 2 Matrices.
ECIV 301 Programming & Graphics Numerical Methods for Engineers Lecture 20 Solution of Linear System of Equations - Iterative Methods.
ECIV 301 Programming & Graphics Numerical Methods for Engineers Lecture 14 Elimination Methods.
Special Matrices and Gauss-Siedel
ECIV 520 Structural Analysis II Review of Matrix Algebra.
Finite Mathematics & Its Applications, 10/e by Goldstein/Schneider/SiegelCopyright © 2010 Pearson Education, Inc. 1 of 86 Chapter 2 Matrices.
Chapter 5 Determinants.
Arithmetic Operations on Matrices. 1. Definition of Matrix 2. Column, Row and Square Matrix 3. Addition and Subtraction of Matrices 4. Multiplying Row.
Copyright © Cengage Learning. All rights reserved. 7.6 The Inverse of a Square Matrix.
Major: All Engineering Majors Author(s): Autar Kaw
Chapter 8 Objectives Understanding matrix notation.
Chapter 10 Review: Matrix Algebra
Computer Engineering Majors Authors: Autar Kaw
Systems and Matrices (Chapter5)
9/7/ Gauss-Siedel Method Chemical Engineering Majors Authors: Autar Kaw Transforming.
Advanced Computer Graphics Spring 2014 K. H. Ko School of Mechatronics Gwangju Institute of Science and Technology.
Engineering Analysis ENG 3420 Fall 2009 Dan C. Marinescu Office: HEC 439 B Office hours: Tu-Th 11:00-12:00.
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1 Chapter 11.
ΑΡΙΘΜΗΤΙΚΕΣ ΜΕΘΟΔΟΙ ΜΟΝΤΕΛΟΠΟΙΗΣΗΣ 4. Αριθμητική Επίλυση Συστημάτων Γραμμικών Εξισώσεων Gaussian elimination Gauss - Jordan 1.
10/17/ Gauss-Siedel Method Industrial Engineering Majors Authors: Autar Kaw
Chapter 3 Solution of Algebraic Equations 1 ChE 401: Computational Techniques for Chemical Engineers Fall 2009/2010 DRAFT SLIDES.
Chemical Engineering Majors Author(s): Autar Kaw
10/26/ Gauss-Siedel Method Civil Engineering Majors Authors: Autar Kaw Transforming.
Lecture 7 - Systems of Equations CVEN 302 June 17, 2002.
Chapter 5 MATRIX ALGEBRA: DETEMINANT, REVERSE, EIGENVALUES.
Elliptic PDEs and the Finite Difference Method
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1 Part 3- Chapter 12 Iterative Methods.
Gaussian Elimination Electrical Engineering Majors Author(s): Autar Kaw Transforming Numerical Methods Education for.
Linear Systems – Iterative methods
Chapter 8 Matrices and Determinants Matrix Solutions to Linear Systems.
Chapter 9 Gauss Elimination The Islamic University of Gaza
Gaussian Elimination Industrial Engineering Majors Author(s): Autar Kaw Transforming Numerical Methods Education for.
Gaussian Elimination Mechanical Engineering Majors Author(s): Autar Kaw Transforming Numerical Methods Education for.
Mechanical Engineering Majors Authors: Autar Kaw
2/26/ Gauss-Siedel Method Electrical Engineering Majors Authors: Autar Kaw
Linear Systems Numerical Methods. 2 Jacobi Iterative Method Choose an initial guess (i.e. all zeros) and Iterate until the equality is satisfied. No guarantee.
LEARNING OUTCOMES At the end of this topic, student should be able to :  D efination of matrix  Identify the different types of matrices such as rectangular,
3/6/ Gauss-Siedel Method Major: All Engineering Majors Author: دکتر ابوالفضل رنجبر نوعی
Gaussian Elimination Civil Engineering Majors Author(s): Autar Kaw Transforming Numerical Methods Education for STEM.
Autar Kaw Benjamin Rigsby Transforming Numerical Methods Education for STEM Undergraduates.
Numerical Methods. Introduction Prof. S. M. Lutful Kabir, BRAC University2  One of the most popular techniques for solving simultaneous linear equations.
MTH108 Business Math I Lecture 20.
Iterative Solution Methods
Chapter: 3c System of Linear Equations
ECE 3301 General Electrical Engineering
Spring Dr. Jehad Al Dallal
Solving Systems of Linear Equations: Iterative Methods
Gauss-Siedel Method.
Numerical Analysis Lecture12.
Autar Kaw Benjamin Rigsby
Metode Eliminasi Pertemuan – 4, 5, 6 Mata Kuliah : Analisis Numerik
Numerical Analysis Lecture14.
Numerical Analysis Lecture13.
Numerical Analysis Lecture10.
Chapter 11 Chapter 11.
Numerical Analysis Lecture11.
Linear Algebra Lecture 16.
Ax = b Methods for Solution of the System of Equations:
Presentation transcript:

Numerical Solution of Linear Equations Lecture 2 Chapter 3 Numerical Solution of Linear Equations

Linear System of Equations In matrix–vector notation

Numerical methods for the solution of the systems of linear equations Direct Methods Cramer rule Gauss elimination Iterative Methods Jacobi Gauss-Siedel

1- Iterative Methods start with an initial guess of the solution vector X(0), and then repeatedly refine the solution until a certain convergence criterion is reached. Advantages : have significant computational advantages if the coefficient matrix is very large and sparsely populated (most coefficients are zero). Disadvantages: less efficient than their direct counterparts due to the large number of iterations required.

Jacobi Method The Jacobi method is an algorithm for determining the solutions of a system of linear equations with largest absolute values in each row and column dominated by the diagonal element.

Definition: The square nonsingular matrix A is called diagonally dominant if the sum of the absolute values of its elements on the main diagonal is greater than or equal to the sum of the absolute values of the remaining elements of the analyzed row of the matrix, i.e., Example: Checking if the coefficient matrix is diagonally dominant

Steps of Jacobi Method: Rearrange system to be diagonally dominant. Start with an initial vector We determine the unknowns x1, x2, and x3 from the first, second, and third equation, respectively:

Perform series of consecutive iterations (k) as in step 3 until the solution converges to an exact solution, i.e., In general:

Example: Solve by Jacobi method: Start with solution guess , and start iterating on the solution

keep on going until the desired level of accuracy is achieved

Iterative convergence • Is the (k+1)th solution better than the kth solution? • Iterative process can be convergent/divergent A sufficient condition to ensure convergence is that the matrix is diagonally dominant A poor first guess will prolong the iterative process but will not make it diverge if the matrix is such that convergence is assured. Therefore better guesses will speed up the iterative process

Criteria for ascertaining convergence • Absolute convergence criteria • Where ε a user specified tolerance or accuracy • The absolute convergence criteria is best used if you have a good idea of the magnitude of the xi‘s Relative convergence criteria • This criteria is best used if the magnitude of the ‘s are not known. • There are also problems with this criteria if

Solution: Rearrange the system to be diagonally dominant as the following:

Determine the unknowns x1, x2, and x3 from the first, second, and third equation, respectively:

Continuing this procedure, you obtain the sequence of approximations shown in the following table

Because the last two rows in the table are identical, we can conclude that to three significant digits the solution is

Gauss-Siedel Method The Gauss–Seidel method is similar to the Jacobi method except that the computation of xi(k) uses only the elements of X(k) that have already been computed, and only the elements of X(k-1) that have yet to be advanced to iteration (k).

Example 4 Solve previous Example using the Gauss–Seidel method Start with you obtain the following new value for x1 Now that you have a new value for x1 , however, use it to compute a new value for x2 That is,

So the first approximation is Continued iterations produce the sequence of approximations shown in the following table. Note that after only six iterations of the Gauss-Seidel method, you achieved the same accuracy as was obtained with eight iterations of the Jacobi method.

Vectors, Functions, and Plots in Matlab

Enter a matrix into Matlab with the following syntax: Also enter a vector u: > u = [ 1 2 3 4]’ To multiply a matrix times a vector Au use *: A*u Now enter another matrix B using: > B = [3 2 1; 7 6 5; 4 3 2] You can multiply a matrix by a scalar: > 2*A Adding matrices A + A will give the same result: > A + A You can even add a number to a matrix: > A + 3 . . . . . .. . . . . . . . .. . . . . . . .% This should add 3 to every entry of A.

Special matrices: N = ones(5,5) O=zeros(2,2) I=eye(3) D=diag(A) Inv(A)

Jacobi method in matrix form If we write D, L, and U for the diagonal, strict lower triangular and strict upper triangular and parts of A, respectively, then Jacobi’s Method can be written in matrix-vector notation as

Programing of Jacobi method function x=Jacobi(A,b,n,x0) L=tril(A,-1) U=triu(A,1) d=diag(A) B=-(U+L); g=b; for i=1:n x=(B*x0+g)./d x0=x; end

a- Using \ operator in Matlab. Assignment 1 1- Solve the system a- Using \ operator in Matlab. b- Using Jacobi method. Start with x(0) = (0, 0), complete a table like the one below,

2-a) Express the Gauss-Siedel method in matrix form, (upper, lower, and diagonal). 2-b) Write a computer program that applies the Gauss-Siedel method, then solve the previous system of linear equations.

Summary Iterative methods: 1- Jacobi method 2- Gauss-Siedel method Iterative convergence diagonally dominant Matlab programming Assignment1

End of Chapter 3