Solving Linear Systems 1 Review We start with a review of vectors and matrices and matrix-matrix and matrixvector multiplication and other matrix and

Size: px
Start display at page:

Download "Solving Linear Systems 1 Review We start with a review of vectors and matrices and matrix-matrix and matrixvector multiplication and other matrix and"

Transcription

1 Solving Linear Systems 1 Review We start with a review of vectors and matrices and matrix-matrix and matrixvector multiplication and other matrix and vector operations. Vectors operations and norms: Let x =[x 1 ;x ; ;x n ] t and y =[y 1 ;y ; ;y n ] t Then x + y =[x 1 + y 1 ;x + y ; ;x n + y n ] x =[ x 1 ; x ; ; x n ] t >>x = [1,,,-]; >>y = [,,,1]; >> x+y [ -] >> *x [,,,-10] Norms of vectors jjxjj 1 = jx 1 j + jx j + + jx n j jjxjj 1 = max(jx 1 j; jx j; ; jx n j) jjxjj = p x 1 + x + + x n jjxjj p =(x p 1 + xp + + xp n) 1=p Properties of norms (i) jjxjj 0 1

2 (ii) jjxjj =0, x =0 (iii) jjx + yjj» jjxjj + jjyjj (iv) jj xjj = j jjjxjj Matrix operations and norms Let us consider two matrices A = a 11 a 1m... B = a n1 a nm b 11 b 1m... : b n1 b nm The matrices A and B have n rows and m columns. If n = m, A and B are square matrices, otherwise they are rectangular matrices. We define the following matrix operations C = A + B, c ij = a ij + b ij C = A, c ij = a P ij n C = AB, c ij = a k=1 ikb kj AB = BA in general C = A t, c ij = a ji A = A t in general Determinant of square matrices for n =1,det(A) =a 11 for n =,det(a) =a P 11 a a 1 a 1 n for n>; det(a) = a j=1 ij( 1) i+j M ij where M ij is the determinant of the matrix obtained by deleting the i th row and j th column det(ab) =det(a)det(b) det(a t )=det(a) det( A) = n det(a) det(a) = 0 if and only if A is singular, i.e., A does not have aninverse matrix A has an inverse A 1 if and only if AA 1 = A 1 A = I

3 where I is the n n identity matrix. Direct methods for solving linear systems We start with an example x 1 +x x = 1 x 1 x +x + x = -1 x 1 +x 1x 8x = 1 x 1 + x + x = 1 The matrix formulation can be written as x 1 x x x = An upper-triangular system: x 1 x x x = 0 8 Use the backward substitution to solve the system starting from the last equation 1. Equation, x = 8 yields x =. Equation, x +x = with x = yields x =0. Equation, x + x = 0, yields x =1. Equation 1, x 1 + x + x = yields x 1 =1. A lower-triangular system x 1 x x x = 1 Use forward substitution to solve the system

4 1. Equation 1, x 1= yields x 1 = 1. Equation, x 1 + x = yields x = 1. Equation, x 1 + x = 1 yields x =0. Equation, x 1 +x x =, yields x =0 Matlab program for backward substitution function [x]=backward(u,b) %Input: U an upper triangular nxn matrix % b a vector of length n %Ouput: x a vector of length n solution to Ux = b % [n,m] = size(b); x(n,:) = b(n,:)/u(n,n); for i = n-1:-1:1 x(i,:) = (b(i,:) - U(i,i+1:n)*x(i+1:n,:)')/U(i,i); Matlab program for forward substitution function [x]=forward(l,b) %input: L a lower triangular n x n matrix % b a nxm matrix %output: x a n x m matrix solution of Lx=b % [n,m] = size(b); x(1,:) = b(1,:)/l(1,1); for i = :n x(i,:) = (b(i,:) - L(i,1:i-1)*x(1:i-1,:))/L(i,i);.1 Naive Gaussian elimination Gaussian elimination helps transform a general system Ax = b into an equivalent, i.e., have the same solution as Ax = b, upper-triangular system Ux = ~ b. using the operations (i) E j $ E j j E i ; j =0 (ii)e j $ E i (row interchanges) General form

5 a 11 x 1 + a 1 x + + a 1n x n = b 1 a 1 x 1 + a x + + a n x n = b.. a n1 x 1 + a n x + + a nn x n = b n into upper triangular system u 11 x 1 + u 1 x + + u 1n x n = ~ b 1 u x + + u n x n = ~ b... unnxn = ~ bn Let us start with an example: x 1 x x x = 1 Step 1 in Gaussian elimination: E 1 E E 1! E E E 1! E E + E 1! E x 1 x x x = 1 8 Step in Gaussian elimination: E 1 E E E! E E +E! E x 1 x x x = 1 1 Step : will make the a = 0 which is already the case. In practice we just do it to avoid checking for zero entries. Solve the resulting system using backward substitution

6 1. Equation, 1x = 1 yields x =1. Equation, x +1x = 1 yields x =0. Equation, x x x = yields x =. Equation 1, x 1 + x +x = yields x = 1. Matlab program for Gaussian elimination with no pivoting function [x]=gausselim(a,b) %Input: A is a nxn matrix % B is a nxm matrix %Output: x is nxm matrix solution of Ax=b % [n,m] = size(b); for i = 1:n for j = i+1:n c = A(j,i)/A(i,i); A(j,i:n) = A(j,i:n) - c*a(i,i:n); b(j,1:m) = b(j,1:m) - c*b(i,1:m); x = backward(a,b); Breakdown of Gaussian elimination: Consider the following example: x 1 x x = We write the system using an augmented matrix formulation and perform Gaussian elimination Step 1:

7 E 1 E E1! E E E 1! E Step : Cannot use E to eliminate x from equation E. E E! E will not eliminate x from E. Instead we interchange the rows E $ E to obtain E 1 E! E E! E Now we use the backward substitution algorithm to compute the solution x 1 =; x =1; x =1. Stability of Gaussian elimination and pivoting strategies Let us consider the example: ffl 1. 1+ffl. with exact solution x 1 =1; x =1. Set ffl =10 8 and apply Gaussian elimination with four significant digits in the decimal system to obtain E 1 1 ffl 1. 1+ffl E E 1 =ffl! E Rounding-off leads to the system ffl Solving leads to the incorrect answer x 1 = 0 and x =1.

8 Now if we interchange E 1 and E prior to applying Gaussian elimination we obtain E! E 1. E 1! E ffl ffl Gaussian elimination leads to the system. 0 1 ffl=. 1 ffl= Rounding-off yields Finally, we obtain the correct solution x 1 =1,x =1. In the first system the problem was caused by the division by a small number. Row interchanges that uses largest possible pivot and help reduce of effect of round-off errors. Next we will discuss several pivoting strategies. Partial pivoting We consider the general system in augmented form a 11 a 1 a 1n. b 1 a 11 a 1 a 1n. b..... b n a 11 a 1 a 1n. b 1 Step1: (i)select smallest p such that ja p;1 j = max n i=1 ja i;1j (ii) Interchange rows p and 1 (iii) Perform Gaussian elimination E j j E 1! E j, j = a j1 =a 11 j =; n. Step : (i) Select p such that ja p; j = max n j= ja jj, where a i;j are the updated entries. (ii) Interchange rows p and. 8

9 (iii) Perform elimination E j j E! E j, j = a j =a j =; ; n. Step i: (i) Select p such that ja p;i j = max n j=i ja jij (ii) Interchange rows p and i. (iii) Perform elimination E j j E i! E j, j = a ji =a ii j = i +1; n. Let us apply Gaussian with partial pivoting to the following system Step 1: since ja 1 j > ja 11 j; ja 1 j,interchange rows three and one to obtain Applying Gaussian elimination leads to E 1! E E1=! E E E1=! E Step : = 1=.. 1= 0 = =. 1= Since ja j > ja j,interchange rows two and three to obtain 1 0 = = Using Gaussian elimination to obtain.. 1= 0 = 1=.. 1= 9

10 E 1! E E1=! E E E1=! E 1 0 = =.. 1= 0 0 =.. = Now apply the backward substitution algorithm to computer solution x 1 =1,x =1,x = 1 and IP =[; 1; ]. Remark: Partial pivoting can be fooled by a wrong scaling of the equations. For instance, if we multiply the first equation in the system (??) by10 =ffl we obtain a new system =ffl. (1+e)10 =ffl. 1 Partial pivoting results in using the first equation to perform Gaussian elimination. This will lead again to incorrect results for small values of ffl =ffl 0 =ffl. (1 + e)10 =ffl. 1 (1+ffl)=ffl We may remedy this problem using scaled-column pivoting where we (i) compute the weights s i = max n j=1 ja i;jj from the original matrix At i th Gaussian step we (ii) compute the smallest integer p such that ja p;i j=s i = max n j=i ja j;ij=s j (iii) interchange rows p and i (iii) Apply Gaussian elimination Number of operations for Gaussian elimination solving Ax = b a 1;1 a 1;n. a 1;n a n;1 a n;n. a n;n+1 Number of operations in step i: Λ= : (n i)+(n i) Λ (n i +1)=(n i) Λ (n i +) 10

11 ± : (n i) Λ (n i +1) In order to compute the total number of operations we will need the following identities: P m j=1 1=m P m j=1 j = m(m +1)= P m j=1 j = m Λ (m +1)Λ (m +1)= (the proof is obtained using induction) There for the total number of Λ and / is nx i=1 (n i)(n i +)=(n + n) The total number of + and n 1 X i=1 n 1 X i=1 X n 1 (n +1) j=1 =(n +n n)= ß n =; for n>>1: X n 1 i + (n i)(n i +1)=(n n)= ß n =; n>>1 The number of operation for backward substitution is as follows P Λ= : n j j=1 =(n + n)= P ± : n 1 j j=1 =(n n)= The total solution cost: Λ= : n =+n n= + : n + n = n= Additional cost for partial pivoting: P n 1 j=1 j =(n 1)n= Remarks: (i) Cost of a comparison is comparable to cost of an addition (ii) Cost of a multiplication and division is greater that that of an addition( not true in matlab) (iii) Gaussian elimination is the most expensive part of the computation (iv) Backward substitution cost ß n = Λ = and ß n = ±. i=1 i 11

12 . Solving systems with multiple right-hand sides Consider m systems with same matrix and multiple right-hand sides. If all the right-hand sides are available at once we may use an augmented matrix formulation and apply Gaussian elimination at once and solve m upper-triangular systems as described below a 1;1 a 1;n. b 1;1 b 1;m a n;1 a n;n. b n;1 b n;m We illustrate the procedure with partial pivoting on the example Step 1 : interchange rows 1 and and apply Gaussian elimination = 1= 1=. 1 0 = 1= =. 0 0 = 8= 1=.. 0 Step : Apply Gaussian elimination with no row interchanges = 1= 1= = 1=. 1= = Step : no row interchanges 1

13 = 1= 1= = Using backward substitution we obtain = = X1 =[ 1; ; 0; 1] and X =[8=9; 19=9; 1=; =1] Inverse of matrix A To compute the inverse of a matrix A we need to solve the n systems AX = I, where I is the n n identity matrix. Now let us consider the augmented matrix [A : I] for the following example Step 1: interchange row 1 and and apply Gaussian elimination = 1= = 0 = = Step : interchange row and 1 0 = =. 1 0 = = 0 0 =. = 1 = We use backward substitution to solve the system and obtain A 1 = =1 1=1 =1 =1 =1 =1 1=1 = = 1

14 Computational Cost: Gaussian elimination and backward substitution: Λ= :n = n=, (n = +n =+n =) + :n = n =+n= Matrix factorization Theorem: If A is strictly diagonally dominant, i.e., ja i;i j > P n j=1;j=i ja i;jj, for i = 1; ; n, then the Gaussian elimination with pivoting is stable with respect to round-off errors. Example of a diagonally dominant matrix LU Factorization Theorem: If Gaussian elimination can applied to a matrix A without row interchanges then we can find a lower triangular matrix L and an upper triangular matrix U such that A = LU. First, we illustrate the procedure by the example: Step 1: no row interchanging Step : Step : 1

15 U = Thus, L = The reader may check that LU = A. Applications Solving Ax = b is equivalent to solving LUx = b by setting Ux = z and (i) first solve Lz = b (ii) then solve Ux = z A general algorithm for LU factorization Doolitle factorization where l i;i =1; i =1; ;n u 1;j = a 1;j ; j =1; ;n for k =1 n P 1 k 1 u k;k =(a k;k P l j=1 k;ju j;k )=l k;k k 1 l j;k =(a j;k P l i=1 j;iu i;k )=u k;k ; j =1; k 1 k 1 u k;j =(a k;j l i=1 k;iu i;j )=l k;k ;j = k +1; n Crout factorization Set u i;i =1,i P =1; n k 1 l k;k =(a k;k P l j=1 k;ju j;k )=u k;k k 1 l j;k =(a j;k P l i=1 j;iu i;k )=u k;k ; j = k +1; n k 1 u k;j =(a k;j l i=1 k;iu i;j )=l k;k ; j = k +1; n Program for LU factorization with no row interchanges function [L,U]=mylu(A) 1

16 %function computes the lu factorization of A with no pivoting %input: A %output: L a lower triangular matrix % U an upper triangular matrix % [n,m] = size(a); U(1,:) = A(1,:); d = zeros(1,n); L = diag(d+1,0); for i = 1:n-1 L(i+1:n,i) = A(i+1:n,i)/U(i,i); for j = i+1:n A(j,i:n) = A(j,i:n) - L(j,i)*U(i,i:n); U(i+1,i+1:n) = A(i+1,i+1:n);. LU factorization with row interchanges Theorem: If A is a non singular matrix then there exist a lower triangular matrix L, an upper triangular matrix U and a permutation matrix P (obtained by interchanging rows of the identity) such that LU = PA We illustrate the procedure on an example U = L = P = Step 1: interchange row 1 and and apply Gaussian elimination to obtain U = 1 0 1= = 0 L = = P = Step : interchange rows and and apply Gaussian elimination U = = L ~ = P = = 1= L = L ~ + I = = 1= 1 where LU = PA. In order to solve Ax = b we multiply the system by P to obtain PAx = Pb which leads to LUx = Pb. 1

17 We solve the system by solving (i) Lz = Pb (ii) Ux = z For instance, we solve Ax =[; 0; ] 0 = b by computing (i) Pb =[; ; 0] (ii) Lz = Pb yields z =[; ; 9=] 0 (iii) Ux = z leads to x =[ 1; 1; 1] 0. Matlab program for Lu factorization with partial pivoting function [L,U,P,mperm]=mylupiv(A) %PA=LU factorization with partial pivoting %input: matrix A %output: L lower triangular matrix % U upper triangular % P permutation matrix % mperm number of row interchanges % [n,m] = size(a); P = eye(n); U(1,:) = A(1,:); d = ones(1,n); L = zeros(n); mperm = 0; for i = 1:n-1 [mx,p]=max(abs(a(i:n,i))); p = p-1+i; if (p ~= i) mperm = mperm + 1; % rows interchanges in A tmp=a(p,i:n); A(p,i:n)=A(i,i:n); A(i,i:n)=tmp; % rows interchanges in L tmp= L(i,1:i-1); L(i,1:i-1)=L(p,1:i-1); L(p,1:i-1) = tmp; % rows interchanges in P tmp=p(p,:); P(p,:)=P(i,:); P(i,:)=tmp; U(i,i:n) = A(i,i:n); 1

18 % % compute l factors L(i+1:n,i) = A(i+1:n,i)/U(i,i); %Gaussian elimination for j = i+1:n A(j,i:n) = A(j,i:n) - L(j,i)*U(i,i:n); U(n,n) = A(n,n); L = L+diag(d); I. Determinant ofa The method of co-factors requires n! operations, for instance, for n = 100, we need operations. Thus, on a machine with 10 1 flops it will take10 18 years to compute the determinant of A. On the other-hand, using LU factorization it will take less than a second to compute the determinant as det(a) =det(l) Λ det(u) =(Π n i=1 l i;i)(π n i=1 u i;i) =Π n i=1 u i;i In general when PA = LU det(a) =( 1) m (Π n i=1 l i;i)(π n i=1 u i;i) =( 1) m (Π n i=1 u i;i), m is the numberofrow interchanges during Gaussian elimination. II. Solving Ax = b. The LU factorization is useful for solving Ax = b if all right-hand sides are not known at the beginning of the computation.. LU factorization of special matrices Symmetric positive matrices Theorem: If A is a symmetric positive matrix, i.e., x 0 Λ Ax > 0, for all x = 0, there exist a lower triangular matrix L such that A = L Λ L t Theorem: A symmetric matrix A is positive definite matrix if and only if det(a k ) > 0 for k =1; ; n, where A k = a 1;1 a 1;k..... a k;1 a k;k 18

19 Cholesky Factorization for i =1; ; n l i;i = q a i;i P i 1 k=1 l i;k l j;i =(a j;i P i 1 k=1 l j;kl i;k )=l i;i ; j = i +1; n Applications In order to solve Ax = LL t x = b we solve (i) Lz = b (ii) L t x = z Remarks (i) Cholesky factorization costs ß n = operations, i.e., half the cost of the regular LU factorization. (ii) It is stable with respect to round-off errors. (iii) Square root is expensive use A = LDL t, l i;i =1. Let us consider an example >[L,p] = chol(a) A = One may check that det(a 1 )=> 0 det(a )=8 => 0 det(a) = 00 > 0 and A 0 = A. Then A is a positive definite matrix with L = Matlab program for Cholesky factorization 19

20 function U = mychol(a) %function computes Cholesky factorization %input: matrix A positive definite % %output: U an upper matrix such as U'U=A % [n,m]=size(a); L(:,1) = A(:,1)/sqrt(A(1,1)); for i=:n nz = max([i-1,0]); nz L(i,i) =sqrt(a(i,i) - norm(l(i,1:nz),)^); for j=i+1:n L(j,i) = (A(j,i) - L(j,1:i-1)*L(i,1:i-1)')/L(i,i); U = L'; Tridiagonal matrices We consider the tridiagonal matrix where a i;j =0ifji jj > 1. a 11 a 1; 0 0 a 1 a a a a an 1;n 0 0 a n;n 1 a nn Gaussian elimination can be applied to factor this matrix as A = LU very efficientlyusing only O(n) operations where u 11 u 1; 0 0. l L =. 0 l u u.. 0 U = u un 1;n 0 0 l n;n u nn Algorithm: u 11 = a 11 ; u 1 = a 1 l 1 = a 1 =a 11 0

21 fori =; ; n u i;i = a ii l i;i 1 Λ u i 1;i ; u i;i+1 = a i;i+1 l i+1;i = a i+1;i =u i;i u n;n = a n;n l n;n 1 Λ u n 1;n Banded matrices Matlab program for banded matrices function [L,U]=mylu(A,nl,nu) %Lu factorization with no pivoting %input: A matrix % nl number of lower diagonals % nu number of upper diagonals %output: L lower triangular matrix % U upper triangular matrix % [n,m] = size(a); U = zeros(n); U(1,1:min(n,1+nu)) = A(1,1:min(1+nu,n)); d = zeros(1,n); L = diag(d+1,0); for i = 1:n-1 L(i+1:min(i+nl,n),i) = A(i+1:min(i+nl,n),i)/U(i,i); for j = i+1:min(i+nl,n) A(j,i:min(i+nu,n)) = A(j,i:min(i+nu,n)) - L(j,i)*U(i,i:min(i+nu,n)); U(i+1,i+1:min(i+1+nu,n)) = A(i+1,i+1:min(i+1+nu,n));. Sensitivity to errors in data and stability If we start with an error in the data for instance in A or b what is the error in x, where Ax = b. Let the exact problem be Ax = b. Let an approximate problem be A~x = b + ~ b and subtract the approximate problem from the exact problem to obtain A(x ~x) = ~ b 1

22 which can be written as (x ~x) =A 1 ~ b Taking the norm of both sides we obtain jj(x ~x)jj = jja 1 ~ bjj The relative error leads to jj(x ~x)jj jjxjj = jjbjjjja 1 ~ bjj jjxjjjjbjj» jjbjjjja 1 jjjj~ bjj jjxjjjjbjj Using and leads to jj(x ~x)jj jjxjj jja 1 ~ bjj»jja 1 jjjj ~ bjj: jjbjj = jjaxjj» jjajjjjxjj = jja 1 jjajj jj ~ bjj jjjbjj =»(A)jj ~ bjj jjbjj ; where»(a) =jja 1 jjajj is the condition number. Noting that ~ b = b A~x = r we can write jj(x ~x)jj jjxjj»»(a) jjrjj jjjbjj which gives a relationship between the residual and the relative error in the solution. Remarks 1.»(A)» 1. if»(a) >> 1 the system is ill-conditioned. if»(a) = O(1) the system is well conditioned. Small errors in b for ill-conditioned systems result in large errors in x Example: Consider the following matrix A =

23 jjajj 1 = ; jja 1 jj 1 =1: 10 leads to»(a) =jjajj 1 jja 1 jj 1 =:8 10 For instance if jj ~ bjj 1 =jjbjj 1 =10, then jjx ~xjj1 jjxjj1 ß :8: Now, if we assume the approximate problem to be (A + ~ A)~x = b + ~ b; then we can prove that jj(x ~x)jj jjxjj =»(A) ψ! jj Ajj ~ jjajj + jj~ bjj + O(jj Ajj ~ ) : jjjbjj Example in matlab >A = [ +10^(-1) 1; 1]; >b = [ + ^(-1); ]; >A b Iterative refinement Algorithm This algorithm is useful for ill-conditioned systems (»(A) >> 1). 1. Perform LU = PA with t digits. Solve LUx 0 = Pb. Compute r 0 = b Ax 0 using t digits (double precision). Solve LUx c = Pr 0. update x 0 as x 0 = x 0 + xc. if jjx c jj <fflstop else go to

24 Remarks: (i) If machine zero is u =10 d and» 1 (A) =10 q and using double precision to compute b Ax the x 0 has approximately min(d; k Λ (d q)) correct digits where k is the iteration number in the refinement algorithm Thus for instance when k =1,x has min(d; d q) correct digits when k =,x has min(d; (d q)) correct digits (ii) each iteration costs O(n ) operations not including the LU factorization. Example: Using the decimal system with t= significant digits we solve»»» 0:980:9 x1 0: = 0:090: x 0:10 Using the LU factorization we obtain»» :11 1:99 X 0 = X :1 1 = X :99 1 =» :00 :00

Direct Methods for Solving Linear Systems. Simon Fraser University Surrey Campus MACM 316 Spring 2005 Instructor: Ha Le

Direct Methods for Solving Linear Systems. Simon Fraser University Surrey Campus MACM 316 Spring 2005 Instructor: Ha Le Direct Methods for Solving Linear Systems Simon Fraser University Surrey Campus MACM 316 Spring 2005 Instructor: Ha Le 1 Overview General Linear Systems Gaussian Elimination Triangular Systems The LU Factorization

More information

1 Multiply Eq. E i by λ 0: (λe i ) (E i ) 2 Multiply Eq. E j by λ and add to Eq. E i : (E i + λe j ) (E i )

1 Multiply Eq. E i by λ 0: (λe i ) (E i ) 2 Multiply Eq. E j by λ and add to Eq. E i : (E i + λe j ) (E i ) Direct Methods for Linear Systems Chapter Direct Methods for Solving Linear Systems Per-Olof Persson persson@berkeleyedu Department of Mathematics University of California, Berkeley Math 18A Numerical

More information

Gaussian Elimination and Back Substitution

Gaussian Elimination and Back Substitution Jim Lambers MAT 610 Summer Session 2009-10 Lecture 4 Notes These notes correspond to Sections 31 and 32 in the text Gaussian Elimination and Back Substitution The basic idea behind methods for solving

More information

Linear Algebraic Equations

Linear Algebraic Equations Linear Algebraic Equations 1 Fundamentals Consider the set of linear algebraic equations n a ij x i b i represented by Ax b j with [A b ] [A b] and (1a) r(a) rank of A (1b) Then Axb has a solution iff

More information

The Solution of Linear Systems AX = B

The Solution of Linear Systems AX = B Chapter 2 The Solution of Linear Systems AX = B 21 Upper-triangular Linear Systems We will now develop the back-substitution algorithm, which is useful for solving a linear system of equations that has

More information

COURSE Numerical methods for solving linear systems. Practical solving of many problems eventually leads to solving linear systems.

COURSE Numerical methods for solving linear systems. Practical solving of many problems eventually leads to solving linear systems. COURSE 9 4 Numerical methods for solving linear systems Practical solving of many problems eventually leads to solving linear systems Classification of the methods: - direct methods - with low number of

More information

MATH 3511 Lecture 1. Solving Linear Systems 1

MATH 3511 Lecture 1. Solving Linear Systems 1 MATH 3511 Lecture 1 Solving Linear Systems 1 Dmitriy Leykekhman Spring 2012 Goals Review of basic linear algebra Solution of simple linear systems Gaussian elimination D Leykekhman - MATH 3511 Introduction

More information

CHAPTER 6. Direct Methods for Solving Linear Systems

CHAPTER 6. Direct Methods for Solving Linear Systems CHAPTER 6 Direct Methods for Solving Linear Systems. Introduction A direct method for approximating the solution of a system of n linear equations in n unknowns is one that gives the exact solution to

More information

Direct Methods for Solving Linear Systems. Matrix Factorization

Direct Methods for Solving Linear Systems. Matrix Factorization Direct Methods for Solving Linear Systems Matrix Factorization Numerical Analysis (9th Edition) R L Burden & J D Faires Beamer Presentation Slides prepared by John Carroll Dublin City University c 2011

More information

Engineering Computation

Engineering Computation Engineering Computation Systems of Linear Equations_1 1 Learning Objectives for Lecture 1. Motivate Study of Systems of Equations and particularly Systems of Linear Equations. Review steps of Gaussian

More information

Linear Algebra Section 2.6 : LU Decomposition Section 2.7 : Permutations and transposes Wednesday, February 13th Math 301 Week #4

Linear Algebra Section 2.6 : LU Decomposition Section 2.7 : Permutations and transposes Wednesday, February 13th Math 301 Week #4 Linear Algebra Section. : LU Decomposition Section. : Permutations and transposes Wednesday, February 1th Math 01 Week # 1 The LU Decomposition We learned last time that we can factor a invertible matrix

More information

Gaussian Elimination for Linear Systems

Gaussian Elimination for Linear Systems Gaussian Elimination for Linear Systems Tsung-Ming Huang Department of Mathematics National Taiwan Normal University October 3, 2011 1/56 Outline 1 Elementary matrices 2 LR-factorization 3 Gaussian elimination

More information

CS412: Lecture #17. Mridul Aanjaneya. March 19, 2015

CS412: Lecture #17. Mridul Aanjaneya. March 19, 2015 CS: Lecture #7 Mridul Aanjaneya March 9, 5 Solving linear systems of equations Consider a lower triangular matrix L: l l l L = l 3 l 3 l 33 l n l nn A procedure similar to that for upper triangular systems

More information

Computational Methods. Systems of Linear Equations

Computational Methods. Systems of Linear Equations Computational Methods Systems of Linear Equations Manfred Huber 2010 1 Systems of Equations Often a system model contains multiple variables (parameters) and contains multiple equations Multiple equations

More information

LINEAR SYSTEMS (11) Intensive Computation

LINEAR SYSTEMS (11) Intensive Computation LINEAR SYSTEMS () Intensive Computation 27-8 prof. Annalisa Massini Viviana Arrigoni EXACT METHODS:. GAUSSIAN ELIMINATION. 2. CHOLESKY DECOMPOSITION. ITERATIVE METHODS:. JACOBI. 2. GAUSS-SEIDEL 2 CHOLESKY

More information

Solving Linear Systems Using Gaussian Elimination. How can we solve

Solving Linear Systems Using Gaussian Elimination. How can we solve Solving Linear Systems Using Gaussian Elimination How can we solve? 1 Gaussian elimination Consider the general augmented system: Gaussian elimination Step 1: Eliminate first column below the main diagonal.

More information

2.1 Gaussian Elimination

2.1 Gaussian Elimination 2. Gaussian Elimination A common problem encountered in numerical models is the one in which there are n equations and n unknowns. The following is a description of the Gaussian elimination method for

More information

LU Factorization a 11 a 1 a 1n A = a 1 a a n (b) a n1 a n a nn L = l l 1 l ln1 ln 1 75 U = u 11 u 1 u 1n 0 u u n 0 u n...

LU Factorization a 11 a 1 a 1n A = a 1 a a n (b) a n1 a n a nn L = l l 1 l ln1 ln 1 75 U = u 11 u 1 u 1n 0 u u n 0 u n... .. Factorizations Reading: Trefethen and Bau (1997), Lecture 0 Solve the n n linear system by Gaussian elimination Ax = b (1) { Gaussian elimination is a direct method The solution is found after a nite

More information

Chapter 2. Solving Systems of Equations. 2.1 Gaussian elimination

Chapter 2. Solving Systems of Equations. 2.1 Gaussian elimination Chapter 2 Solving Systems of Equations A large number of real life applications which are resolved through mathematical modeling will end up taking the form of the following very simple looking matrix

More information

Today s class. Linear Algebraic Equations LU Decomposition. Numerical Methods, Fall 2011 Lecture 8. Prof. Jinbo Bi CSE, UConn

Today s class. Linear Algebraic Equations LU Decomposition. Numerical Methods, Fall 2011 Lecture 8. Prof. Jinbo Bi CSE, UConn Today s class Linear Algebraic Equations LU Decomposition 1 Linear Algebraic Equations Gaussian Elimination works well for solving linear systems of the form: AX = B What if you have to solve the linear

More information

LU Factorization. Marco Chiarandini. DM559 Linear and Integer Programming. Department of Mathematics & Computer Science University of Southern Denmark

LU Factorization. Marco Chiarandini. DM559 Linear and Integer Programming. Department of Mathematics & Computer Science University of Southern Denmark DM559 Linear and Integer Programming LU Factorization Marco Chiarandini Department of Mathematics & Computer Science University of Southern Denmark [Based on slides by Lieven Vandenberghe, UCLA] Outline

More information

MATH2210 Notebook 2 Spring 2018

MATH2210 Notebook 2 Spring 2018 MATH2210 Notebook 2 Spring 2018 prepared by Professor Jenny Baglivo c Copyright 2009 2018 by Jenny A. Baglivo. All Rights Reserved. 2 MATH2210 Notebook 2 3 2.1 Matrices and Their Operations................................

More information

Numerical Linear Algebra

Numerical Linear Algebra Numerical Linear Algebra Direct Methods Philippe B. Laval KSU Fall 2017 Philippe B. Laval (KSU) Linear Systems: Direct Solution Methods Fall 2017 1 / 14 Introduction The solution of linear systems is one

More information

Scientific Computing

Scientific Computing Scientific Computing Direct solution methods Martin van Gijzen Delft University of Technology October 3, 2018 1 Program October 3 Matrix norms LU decomposition Basic algorithm Cost Stability Pivoting Pivoting

More information

Roundoff Analysis of Gaussian Elimination

Roundoff Analysis of Gaussian Elimination Jim Lambers MAT 60 Summer Session 2009-0 Lecture 5 Notes These notes correspond to Sections 33 and 34 in the text Roundoff Analysis of Gaussian Elimination In this section, we will perform a detailed error

More information

Linear System of Equations

Linear System of Equations Linear System of Equations Linear systems are perhaps the most widely applied numerical procedures when real-world situation are to be simulated. Example: computing the forces in a TRUSS. F F 5. 77F F.

More information

A Review of Matrix Analysis

A Review of Matrix Analysis Matrix Notation Part Matrix Operations Matrices are simply rectangular arrays of quantities Each quantity in the array is called an element of the matrix and an element can be either a numerical value

More information

Numerical Methods - Numerical Linear Algebra

Numerical Methods - Numerical Linear Algebra Numerical Methods - Numerical Linear Algebra Y. K. Goh Universiti Tunku Abdul Rahman 2013 Y. K. Goh (UTAR) Numerical Methods - Numerical Linear Algebra I 2013 1 / 62 Outline 1 Motivation 2 Solving Linear

More information

AMS526: Numerical Analysis I (Numerical Linear Algebra)

AMS526: Numerical Analysis I (Numerical Linear Algebra) AMS526: Numerical Analysis I (Numerical Linear Algebra) Lecture 12: Gaussian Elimination and LU Factorization Xiangmin Jiao SUNY Stony Brook Xiangmin Jiao Numerical Analysis I 1 / 10 Gaussian Elimination

More information

Numerical Analysis FMN011

Numerical Analysis FMN011 Numerical Analysis FMN011 Carmen Arévalo Lund University carmen@maths.lth.se Lecture 4 Linear Systems Ax = b A is n n matrix, b is given n-vector, x is unknown solution n-vector. A n n is non-singular

More information

Linear Algebra. Solving Linear Systems. Copyright 2005, W.R. Winfrey

Linear Algebra. Solving Linear Systems. Copyright 2005, W.R. Winfrey Copyright 2005, W.R. Winfrey Topics Preliminaries Echelon Form of a Matrix Elementary Matrices; Finding A -1 Equivalent Matrices LU-Factorization Topics Preliminaries Echelon Form of a Matrix Elementary

More information

Numerical Linear Algebra

Numerical Linear Algebra Numerical Linear Algebra Decompositions, numerical aspects Gerard Sleijpen and Martin van Gijzen September 27, 2017 1 Delft University of Technology Program Lecture 2 LU-decomposition Basic algorithm Cost

More information

Program Lecture 2. Numerical Linear Algebra. Gaussian elimination (2) Gaussian elimination. Decompositions, numerical aspects

Program Lecture 2. Numerical Linear Algebra. Gaussian elimination (2) Gaussian elimination. Decompositions, numerical aspects Numerical Linear Algebra Decompositions, numerical aspects Program Lecture 2 LU-decomposition Basic algorithm Cost Stability Pivoting Cholesky decomposition Sparse matrices and reorderings Gerard Sleijpen

More information

1.5 Gaussian Elimination With Partial Pivoting.

1.5 Gaussian Elimination With Partial Pivoting. Gaussian Elimination With Partial Pivoting In the previous section we discussed Gaussian elimination In that discussion we used equation to eliminate x from equations through n Then we used equation to

More information

Dense LU factorization and its error analysis

Dense LU factorization and its error analysis Dense LU factorization and its error analysis Laura Grigori INRIA and LJLL, UPMC February 2016 Plan Basis of floating point arithmetic and stability analysis Notation, results, proofs taken from [N.J.Higham,

More information

Chapter 2. Solving Systems of Equations. 2.1 Gaussian elimination

Chapter 2. Solving Systems of Equations. 2.1 Gaussian elimination Chapter 2 Solving Systems of Equations A large number of real life applications which are resolved through mathematical modeling will end up taking the form of the following very simple looking matrix

More information

Computational Linear Algebra

Computational Linear Algebra Computational Linear Algebra PD Dr. rer. nat. habil. Ralf Peter Mundani Computation in Engineering / BGU Scientific Computing in Computer Science / INF Winter Term 2017/18 Part 2: Direct Methods PD Dr.

More information

Numerical Methods I Solving Square Linear Systems: GEM and LU factorization

Numerical Methods I Solving Square Linear Systems: GEM and LU factorization Numerical Methods I Solving Square Linear Systems: GEM and LU factorization Aleksandar Donev Courant Institute, NYU 1 donev@courant.nyu.edu 1 MATH-GA 2011.003 / CSCI-GA 2945.003, Fall 2014 September 18th,

More information

Linear Systems of n equations for n unknowns

Linear Systems of n equations for n unknowns Linear Systems of n equations for n unknowns In many application problems we want to find n unknowns, and we have n linear equations Example: Find x,x,x such that the following three equations hold: x

More information

Gaussian Elimination without/with Pivoting and Cholesky Decomposition

Gaussian Elimination without/with Pivoting and Cholesky Decomposition Gaussian Elimination without/with Pivoting and Cholesky Decomposition Gaussian Elimination WITHOUT pivoting Notation: For a matrix A R n n we define for k {,,n} the leading principal submatrix a a k A

More information

Solving Dense Linear Systems I

Solving Dense Linear Systems I Solving Dense Linear Systems I Solving Ax = b is an important numerical method Triangular system: [ l11 l 21 if l 11, l 22 0, ] [ ] [ ] x1 b1 = l 22 x 2 b 2 x 1 = b 1 /l 11 x 2 = (b 2 l 21 x 1 )/l 22 Chih-Jen

More information

Solving Linear Systems of Equations

Solving Linear Systems of Equations 1 Solving Linear Systems of Equations Many practical problems could be reduced to solving a linear system of equations formulated as Ax = b This chapter studies the computational issues about directly

More information

Process Model Formulation and Solution, 3E4

Process Model Formulation and Solution, 3E4 Process Model Formulation and Solution, 3E4 Section B: Linear Algebraic Equations Instructor: Kevin Dunn dunnkg@mcmasterca Department of Chemical Engineering Course notes: Dr Benoît Chachuat 06 October

More information

Linear System of Equations

Linear System of Equations Linear System of Equations Linear systems are perhaps the most widely applied numerical procedures when real-world situation are to be simulated. Example: computing the forces in a TRUSS. F F 5. 77F F.

More information

7. LU factorization. factor-solve method. LU factorization. solving Ax = b with A nonsingular. the inverse of a nonsingular matrix

7. LU factorization. factor-solve method. LU factorization. solving Ax = b with A nonsingular. the inverse of a nonsingular matrix EE507 - Computational Techniques for EE 7. LU factorization Jitkomut Songsiri factor-solve method LU factorization solving Ax = b with A nonsingular the inverse of a nonsingular matrix LU factorization

More information

Matrix Factorization and Analysis

Matrix Factorization and Analysis Chapter 7 Matrix Factorization and Analysis Matrix factorizations are an important part of the practice and analysis of signal processing. They are at the heart of many signal-processing algorithms. Their

More information

5.6. PSEUDOINVERSES 101. A H w.

5.6. PSEUDOINVERSES 101. A H w. 5.6. PSEUDOINVERSES 0 Corollary 5.6.4. If A is a matrix such that A H A is invertible, then the least-squares solution to Av = w is v = A H A ) A H w. The matrix A H A ) A H is the left inverse of A and

More information

Math 552 Scientific Computing II Spring SOLUTIONS: Homework Set 1

Math 552 Scientific Computing II Spring SOLUTIONS: Homework Set 1 Math 552 Scientific Computing II Spring 21 SOLUTIONS: Homework Set 1 ( ) a b 1 Let A be the 2 2 matrix A = By hand, use Gaussian elimination with back c d substitution to obtain A 1 by solving the two

More information

SOLVING LINEAR SYSTEMS

SOLVING LINEAR SYSTEMS SOLVING LINEAR SYSTEMS We want to solve the linear system a, x + + a,n x n = b a n, x + + a n,n x n = b n This will be done by the method used in beginning algebra, by successively eliminating unknowns

More information

Ax = b. Systems of Linear Equations. Lecture Notes to Accompany. Given m n matrix A and m-vector b, find unknown n-vector x satisfying

Ax = b. Systems of Linear Equations. Lecture Notes to Accompany. Given m n matrix A and m-vector b, find unknown n-vector x satisfying Lecture Notes to Accompany Scientific Computing An Introductory Survey Second Edition by Michael T Heath Chapter Systems of Linear Equations Systems of Linear Equations Given m n matrix A and m-vector

More information

Lecture 12 Simultaneous Linear Equations Gaussian Elimination (1) Dr.Qi Ying

Lecture 12 Simultaneous Linear Equations Gaussian Elimination (1) Dr.Qi Ying Lecture 12 Simultaneous Linear Equations Gaussian Elimination (1) Dr.Qi Ying Objectives Understanding forward elimination and back substitution in Gaussian elimination method Understanding the concept

More information

CS513, Spring 2007 Prof. Amos Ron Assignment #5 Solutions Prepared by Houssain Kettani. a mj i,j [2,n] a 11

CS513, Spring 2007 Prof. Amos Ron Assignment #5 Solutions Prepared by Houssain Kettani. a mj i,j [2,n] a 11 CS513, Spring 2007 Prof. Amos Ron Assignment #5 Solutions Prepared by Houssain Kettani 1 Question 1 1. Let a ij denote the entries of the matrix A. Let A (m) denote the matrix A after m Gaussian elimination

More information

Applied Mathematics 205. Unit II: Numerical Linear Algebra. Lecturer: Dr. David Knezevic

Applied Mathematics 205. Unit II: Numerical Linear Algebra. Lecturer: Dr. David Knezevic Applied Mathematics 205 Unit II: Numerical Linear Algebra Lecturer: Dr. David Knezevic Unit II: Numerical Linear Algebra Chapter II.2: LU and Cholesky Factorizations 2 / 82 Preliminaries 3 / 82 Preliminaries

More information

Matrix decompositions

Matrix decompositions Matrix decompositions How can we solve Ax = b? 1 Linear algebra Typical linear system of equations : x 1 x +x = x 1 +x +9x = 0 x 1 +x x = The variables x 1, x, and x only appear as linear terms (no powers

More information

Matrix decompositions

Matrix decompositions Matrix decompositions How can we solve Ax = b? 1 Linear algebra Typical linear system of equations : x 1 x +x = x 1 +x +9x = 0 x 1 +x x = The variables x 1, x, and x only appear as linear terms (no powers

More information

LU Factorization. LU Decomposition. LU Decomposition. LU Decomposition: Motivation A = LU

LU Factorization. LU Decomposition. LU Decomposition. LU Decomposition: Motivation A = LU LU Factorization To further improve the efficiency of solving linear systems Factorizations of matrix A : LU and QR LU Factorization Methods: Using basic Gaussian Elimination (GE) Factorization of Tridiagonal

More information

Matrix notation. A nm : n m : size of the matrix. m : no of columns, n: no of rows. Row matrix n=1 [b 1, b 2, b 3,. b m ] Column matrix m=1

Matrix notation. A nm : n m : size of the matrix. m : no of columns, n: no of rows. Row matrix n=1 [b 1, b 2, b 3,. b m ] Column matrix m=1 Matrix notation A nm : n m : size of the matrix m : no of columns, n: no of rows Row matrix n=1 [b 1, b 2, b 3,. b m ] Column matrix m=1 n = m square matrix Symmetric matrix Upper triangular matrix: matrix

More information

Lecture 12 (Tue, Mar 5) Gaussian elimination and LU factorization (II)

Lecture 12 (Tue, Mar 5) Gaussian elimination and LU factorization (II) Math 59 Lecture 2 (Tue Mar 5) Gaussian elimination and LU factorization (II) 2 Gaussian elimination - LU factorization For a general n n matrix A the Gaussian elimination produces an LU factorization if

More information

Math Lecture 26 : The Properties of Determinants

Math Lecture 26 : The Properties of Determinants Math 2270 - Lecture 26 : The Properties of Determinants Dylan Zwick Fall 202 The lecture covers section 5. from the textbook. The determinant of a square matrix is a number that tells you quite a bit about

More information

Review Questions REVIEW QUESTIONS 71

Review Questions REVIEW QUESTIONS 71 REVIEW QUESTIONS 71 MATLAB, is [42]. For a comprehensive treatment of error analysis and perturbation theory for linear systems and many other problems in linear algebra, see [126, 241]. An overview of

More information

Solving linear equations with Gaussian Elimination (I)

Solving linear equations with Gaussian Elimination (I) Term Projects Solving linear equations with Gaussian Elimination The QR Algorithm for Symmetric Eigenvalue Problem The QR Algorithm for The SVD Quasi-Newton Methods Solving linear equations with Gaussian

More information

Chapter 4 No. 4.0 Answer True or False to the following. Give reasons for your answers.

Chapter 4 No. 4.0 Answer True or False to the following. Give reasons for your answers. MATH 434/534 Theoretical Assignment 3 Solution Chapter 4 No 40 Answer True or False to the following Give reasons for your answers If a backward stable algorithm is applied to a computational problem,

More information

Lecture Notes to Accompany. Scientific Computing An Introductory Survey. by Michael T. Heath. Chapter 2. Systems of Linear Equations

Lecture Notes to Accompany. Scientific Computing An Introductory Survey. by Michael T. Heath. Chapter 2. Systems of Linear Equations Lecture Notes to Accompany Scientific Computing An Introductory Survey Second Edition by Michael T. Heath Chapter 2 Systems of Linear Equations Copyright c 2001. Reproduction permitted only for noncommercial,

More information

CSE 160 Lecture 13. Numerical Linear Algebra

CSE 160 Lecture 13. Numerical Linear Algebra CSE 16 Lecture 13 Numerical Linear Algebra Announcements Section will be held on Friday as announced on Moodle Midterm Return 213 Scott B Baden / CSE 16 / Fall 213 2 Today s lecture Gaussian Elimination

More information

Numerical Linear Algebra

Numerical Linear Algebra Chapter 3 Numerical Linear Algebra We review some techniques used to solve Ax = b where A is an n n matrix, and x and b are n 1 vectors (column vectors). We then review eigenvalues and eigenvectors and

More information

Linear Algebraic Equations

Linear Algebraic Equations Linear Algebraic Equations Linear Equations: a + a + a + a +... + a = c 11 1 12 2 13 3 14 4 1n n 1 a + a + a + a +... + a = c 21 2 2 23 3 24 4 2n n 2 a + a + a + a +... + a = c 31 1 32 2 33 3 34 4 3n n

More information

Linear Algebra. Matrices Operations. Consider, for example, a system of equations such as x + 2y z + 4w = 0, 3x 4y + 2z 6w = 0, x 3y 2z + w = 0.

Linear Algebra. Matrices Operations. Consider, for example, a system of equations such as x + 2y z + 4w = 0, 3x 4y + 2z 6w = 0, x 3y 2z + w = 0. Matrices Operations Linear Algebra Consider, for example, a system of equations such as x + 2y z + 4w = 0, 3x 4y + 2z 6w = 0, x 3y 2z + w = 0 The rectangular array 1 2 1 4 3 4 2 6 1 3 2 1 in which the

More information

1.Chapter Objectives

1.Chapter Objectives LU Factorization INDEX 1.Chapter objectives 2.Overview of LU factorization 2.1GAUSS ELIMINATION AS LU FACTORIZATION 2.2LU Factorization with Pivoting 2.3 MATLAB Function: lu 3. CHOLESKY FACTORIZATION 3.1

More information

Review of matrices. Let m, n IN. A rectangle of numbers written like A =

Review of matrices. Let m, n IN. A rectangle of numbers written like A = Review of matrices Let m, n IN. A rectangle of numbers written like a 11 a 12... a 1n a 21 a 22... a 2n A =...... a m1 a m2... a mn where each a ij IR is called a matrix with m rows and n columns or an

More information

Scientific Computing: An Introductory Survey

Scientific Computing: An Introductory Survey Scientific Computing: An Introductory Survey Chapter 2 Systems of Linear Equations Prof. Michael T. Heath Department of Computer Science University of Illinois at Urbana-Champaign Copyright c 2002. Reproduction

More information

CS227-Scientific Computing. Lecture 4: A Crash Course in Linear Algebra

CS227-Scientific Computing. Lecture 4: A Crash Course in Linear Algebra CS227-Scientific Computing Lecture 4: A Crash Course in Linear Algebra Linear Transformation of Variables A common phenomenon: Two sets of quantities linearly related: y = 3x + x 2 4x 3 y 2 = 2.7x 2 x

More information

Numerical Linear Algebra

Numerical Linear Algebra Numerical Linear Algebra R. J. Renka Department of Computer Science & Engineering University of North Texas 02/03/2015 Notation and Terminology R n is the Euclidean n-dimensional linear space over the

More information

Linear Systems and Matrices

Linear Systems and Matrices Department of Mathematics The Chinese University of Hong Kong 1 System of m linear equations in n unknowns (linear system) a 11 x 1 + a 12 x 2 + + a 1n x n = b 1 a 21 x 1 + a 22 x 2 + + a 2n x n = b 2.......

More information

LU Factorization. LU factorization is the most common way of solving linear systems! Ax = b LUx = b

LU Factorization. LU factorization is the most common way of solving linear systems! Ax = b LUx = b AM 205: lecture 7 Last time: LU factorization Today s lecture: Cholesky factorization, timing, QR factorization Reminder: assignment 1 due at 5 PM on Friday September 22 LU Factorization LU factorization

More information

Chapter 8 Gauss Elimination. Gab-Byung Chae

Chapter 8 Gauss Elimination. Gab-Byung Chae Chapter 8 Gauss Elimination Gab-Byung Chae 2008 5 19 2 Chapter Objectives How to solve small sets of linear equations with the graphical method and Cramer s rule Gauss Elimination Understanding how to

More information

Numerical Methods I: Numerical linear algebra

Numerical Methods I: Numerical linear algebra 1/3 Numerical Methods I: Numerical linear algebra Georg Stadler Courant Institute, NYU stadler@cimsnyuedu September 1, 017 /3 We study the solution of linear systems of the form Ax = b with A R n n, x,

More information

6 Linear Systems of Equations

6 Linear Systems of Equations 6 Linear Systems of Equations Read sections 2.1 2.3, 2.4.1 2.4.5, 2.4.7, 2.7 Review questions 2.1 2.37, 2.43 2.67 6.1 Introduction When numerically solving two-point boundary value problems, the differential

More information

Solving Linear Systems of Equations

Solving Linear Systems of Equations Solving Linear Systems of Equations Gerald Recktenwald Portland State University Mechanical Engineering Department gerry@me.pdx.edu These slides are a supplement to the book Numerical Methods with Matlab:

More information

Example: Current in an Electrical Circuit. Solving Linear Systems:Direct Methods. Linear Systems of Equations. Solving Linear Systems: Direct Methods

Example: Current in an Electrical Circuit. Solving Linear Systems:Direct Methods. Linear Systems of Equations. Solving Linear Systems: Direct Methods Example: Current in an Electrical Circuit Solving Linear Systems:Direct Methods A number of engineering problems or models can be formulated in terms of systems of equations Examples: Electrical Circuit

More information

Introduction to PDEs and Numerical Methods Lecture 7. Solving linear systems

Introduction to PDEs and Numerical Methods Lecture 7. Solving linear systems Platzhalter für Bild, Bild auf Titelfolie hinter das Logo einsetzen Introduction to PDEs and Numerical Methods Lecture 7. Solving linear systems Dr. Noemi Friedman, 09.2.205. Reminder: Instationary heat

More information

GAUSSIAN ELIMINATION AND LU DECOMPOSITION (SUPPLEMENT FOR MA511)

GAUSSIAN ELIMINATION AND LU DECOMPOSITION (SUPPLEMENT FOR MA511) GAUSSIAN ELIMINATION AND LU DECOMPOSITION (SUPPLEMENT FOR MA511) D. ARAPURA Gaussian elimination is the go to method for all basic linear classes including this one. We go summarize the main ideas. 1.

More information

Solving linear systems (6 lectures)

Solving linear systems (6 lectures) Chapter 2 Solving linear systems (6 lectures) 2.1 Solving linear systems: LU factorization (1 lectures) Reference: [Trefethen, Bau III] Lecture 20, 21 How do you solve Ax = b? (2.1.1) In numerical linear

More information

Lecture 2 Decompositions, perturbations

Lecture 2 Decompositions, perturbations March 26, 2018 Lecture 2 Decompositions, perturbations A Triangular systems Exercise 2.1. Let L = (L ij ) be an n n lower triangular matrix (L ij = 0 if i > j). (a) Prove that L is non-singular if and

More information

LINEAR ALGEBRA WITH APPLICATIONS

LINEAR ALGEBRA WITH APPLICATIONS SEVENTH EDITION LINEAR ALGEBRA WITH APPLICATIONS Instructor s Solutions Manual Steven J. Leon PREFACE This solutions manual is designed to accompany the seventh edition of Linear Algebra with Applications

More information

Next topics: Solving systems of linear equations

Next topics: Solving systems of linear equations Next topics: Solving systems of linear equations 1 Gaussian elimination (today) 2 Gaussian elimination with partial pivoting (Week 9) 3 The method of LU-decomposition (Week 10) 4 Iterative techniques:

More information

Chapter 1: Systems of linear equations and matrices. Section 1.1: Introduction to systems of linear equations

Chapter 1: Systems of linear equations and matrices. Section 1.1: Introduction to systems of linear equations Chapter 1: Systems of linear equations and matrices Section 1.1: Introduction to systems of linear equations Definition: A linear equation in n variables can be expressed in the form a 1 x 1 + a 2 x 2

More information

MATRIX ALGEBRA AND SYSTEMS OF EQUATIONS. + + x 1 x 2. x n 8 (4) 3 4 2

MATRIX ALGEBRA AND SYSTEMS OF EQUATIONS. + + x 1 x 2. x n 8 (4) 3 4 2 MATRIX ALGEBRA AND SYSTEMS OF EQUATIONS SYSTEMS OF EQUATIONS AND MATRICES Representation of a linear system The general system of m equations in n unknowns can be written a x + a 2 x 2 + + a n x n b a

More information

Gaussian Elimination -(3.1) b 1. b 2., b. b n

Gaussian Elimination -(3.1) b 1. b 2., b. b n Gaussian Elimination -() Consider solving a given system of n linear equations in n unknowns: (*) a x a x a n x n b where a ij and b i are constants and x i are unknowns Let a n x a n x a nn x n a a a

More information

lecture 2 and 3: algorithms for linear algebra

lecture 2 and 3: algorithms for linear algebra lecture 2 and 3: algorithms for linear algebra STAT 545: Introduction to computational statistics Vinayak Rao Department of Statistics, Purdue University August 27, 2018 Solving a system of linear equations

More information

Introduction to Mathematical Programming

Introduction to Mathematical Programming Introduction to Mathematical Programming Ming Zhong Lecture 6 September 12, 2018 Ming Zhong (JHU) AMS Fall 2018 1 / 20 Table of Contents 1 Ming Zhong (JHU) AMS Fall 2018 2 / 20 Solving Linear Systems A

More information

Numerical Analysis Fall. Gauss Elimination

Numerical Analysis Fall. Gauss Elimination Numerical Analysis 2015 Fall Gauss Elimination Solving systems m g g m m g x x x k k k k k k k k k 3 2 1 3 2 1 3 3 3 2 3 2 2 2 1 0 0 Graphical Method For small sets of simultaneous equations, graphing

More information

MA2501 Numerical Methods Spring 2015

MA2501 Numerical Methods Spring 2015 Norwegian University of Science and Technology Department of Mathematics MA2501 Numerical Methods Spring 2015 Solutions to exercise set 3 1 Attempt to verify experimentally the calculation from class that

More information

JACOBI S ITERATION METHOD

JACOBI S ITERATION METHOD ITERATION METHODS These are methods which compute a sequence of progressively accurate iterates to approximate the solution of Ax = b. We need such methods for solving many large linear systems. Sometimes

More information

Solution of Linear Equations

Solution of Linear Equations Solution of Linear Equations (Com S 477/577 Notes) Yan-Bin Jia Sep 7, 07 We have discussed general methods for solving arbitrary equations, and looked at the special class of polynomial equations A subclass

More information

The purpose of computing is insight, not numbers. Richard Wesley Hamming

The purpose of computing is insight, not numbers. Richard Wesley Hamming Systems of Linear Equations The purpose of computing is insight, not numbers. Richard Wesley Hamming Fall 2010 1 Topics to Be Discussed This is a long unit and will include the following important topics:

More information

9. Numerical linear algebra background

9. Numerical linear algebra background Convex Optimization Boyd & Vandenberghe 9. Numerical linear algebra background matrix structure and algorithm complexity solving linear equations with factored matrices LU, Cholesky, LDL T factorization

More information

Elementary Matrices. which is obtained by multiplying the first row of I 3 by -1, and

Elementary Matrices. which is obtained by multiplying the first row of I 3 by -1, and Elementary Matrices In this special handout of material not contained in the text, we introduce the concept of elementary matrix. Elementary matrices are useful in several ways that will be shown in this

More information

MAT 343 Laboratory 3 The LU factorization

MAT 343 Laboratory 3 The LU factorization In this laboratory session we will learn how to MAT 343 Laboratory 3 The LU factorization 1. Find the LU factorization of a matrix using elementary matrices 2. Use the MATLAB command lu to find the LU

More information

This can be accomplished by left matrix multiplication as follows: I

This can be accomplished by left matrix multiplication as follows: I 1 Numerical Linear Algebra 11 The LU Factorization Recall from linear algebra that Gaussian elimination is a method for solving linear systems of the form Ax = b, where A R m n and bran(a) In this method

More information

Linear Algebra Linear Algebra : Matrix decompositions Monday, February 11th Math 365 Week #4

Linear Algebra Linear Algebra : Matrix decompositions Monday, February 11th Math 365 Week #4 Linear Algebra Linear Algebra : Matrix decompositions Monday, February 11th Math Week # 1 Saturday, February 1, 1 Linear algebra Typical linear system of equations : x 1 x +x = x 1 +x +9x = 0 x 1 +x x

More information