Solving Linear Systems of Equations

Slides:



Advertisements
Similar presentations
5.4 Basis And Dimension.
Advertisements

Rules of Matrix Arithmetic
Algebraic, transcendental (i.e., involving trigonometric and exponential functions), ordinary differential equations, or partial differential equations...
Section 4.6 (Rank).
Chapter 4 Systems of Linear Equations; Matrices Section 6 Matrix Equations and Systems of Linear Equations.
Systems of Linear Equations
Lecture 9: Introduction to Matrix Inversion Gaussian Elimination Sections 2.4, 2.5, 2.6 Sections 2.2.3, 2.3.
Dan Witzner Hansen  Groups?  Improvements – what is missing?
Matrices and Systems of Equations
Ch 7.3: Systems of Linear Equations, Linear Independence, Eigenvalues
Chapter 2 Matrices Definition of a matrix.
7 Linear Algebra: Matrices, Vectors, Determinants. Linear Systems
MOHAMMAD IMRAN DEPARTMENT OF APPLIED SCIENCES JAHANGIRABAD EDUCATIONAL GROUP OF INSTITUTES.
Boot Camp in Linear Algebra Joel Barajas Karla L Caballero University of California Silicon Valley Center October 8th, 2008.
化工應用數學 授課教師: 郭修伯 Lecture 9 Matrices
Arithmetic Operations on Matrices. 1. Definition of Matrix 2. Column, Row and Square Matrix 3. Addition and Subtraction of Matrices 4. Multiplying Row.
Applications of matrices and determinants
Copyright © Cengage Learning. All rights reserved. 7.6 The Inverse of a Square Matrix.
Chapter 1 Section 1.2 Echelon Form and Gauss-Jordan Elimination.
1 Operations with Matrice 2 Properties of Matrix Operations
1 Chapter 2 Matrices Matrices provide an orderly way of arranging values or functions to enhance the analysis of systems in a systematic manner. Their.
5  Systems of Linear Equations: ✦ An Introduction ✦ Unique Solutions ✦ Underdetermined and Overdetermined Systems  Matrices  Multiplication of Matrices.
Matrix Solution of Linear Systems The Gauss-Jordan Method Special Systems.
1.3 Matrices and Matrix Operations.
Math Dept, Faculty of Applied Science, HCM University of Technology
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Introduction to MATLAB 7 for Engineers William J. Palm.
Chapter 10 Review: Matrix Algebra
Compiled By Raj G. Tiwari
Introduction to MATLAB for Engineers, Third Edition William J. Palm III Chapter 8 Linear Algebraic Equations PowerPoint to accompany Copyright © 2010.
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. A Concise Introduction to MATLAB ® William J. Palm III.
Section 4.1 Using Matrices to Represent Data. Matrix Terminology A matrix is a rectangular array of numbers enclosed in a single set of brackets. The.
1 資訊科學數學 14 : Determinants & Inverses 陳光琦助理教授 (Kuang-Chi Chen)
 Row and Reduced Row Echelon  Elementary Matrices.
Square n-by-n Matrix.
Copyright © 2011 Pearson, Inc. 7.3 Multivariate Linear Systems and Row Operations.
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Introduction to MATLAB 7 for Engineers William J. Palm.
1.3 Matrices and Matrix Operations. Definition A matrix is a rectangular array of numbers. The numbers in the array are called the entries in the matrix.
Copyright © 2013, 2009, 2005 Pearson Education, Inc. 1 5 Systems and Matrices Copyright © 2013, 2009, 2005 Pearson Education, Inc.
Matrices CHAPTER 8.1 ~ 8.8. Ch _2 Contents  8.1 Matrix Algebra 8.1 Matrix Algebra  8.2 Systems of Linear Algebra Equations 8.2 Systems of Linear.
10.4 Matrix Algebra 1.Matrix Notation 2.Sum/Difference of 2 matrices 3.Scalar multiple 4.Product of 2 matrices 5.Identity Matrix 6.Inverse of a matrix.
Computing Eigen Information for Small Matrices The eigen equation can be rearranged as follows: Ax = x  Ax = I n x  Ax - I n x = 0  (A - I n )x = 0.
Elementary Linear Algebra Anton & Rorres, 9 th Edition Lecture Set – 02 Chapter 2: Determinants.
Chapter 3 Determinants Linear Algebra. Ch03_2 3.1 Introduction to Determinants Definition The determinant of a 2  2 matrix A is denoted |A| and is given.
5.5 Row Space, Column Space, and Nullspace
Section 2.3 Properties of Solution Sets
Examples of linear transformation matrices Some special cases of linear transformations of two-dimensional space R 2 are illuminating:dimensional Dimoffree.svgDimoffree.svg‎
Chapter 6 Systems of Linear Equations and Matrices Sections 6.3 – 6.5.
Introduction to MATLAB 7
Arab Open University Faculty of Computer Studies M132: Linear Algebra
10.4 Matrix Algebra 1.Matrix Notation 2.Sum/Difference of 2 matrices 3.Scalar multiple 4.Product of 2 matrices 5.Identity Matrix 6.Inverse of a matrix.
Copyright ©2015 Pearson Education, Inc. All rights reserved.
Section 1.7 Linear Independence and Nonsingular Matrices
Matrices and Matrix Operations. Matrices An m×n matrix A is a rectangular array of mn real numbers arranged in m horizontal rows and n vertical columns.
2.5 – Determinants and Multiplicative Inverses of Matrices.
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,
Chapter 5 Chapter Content 1. Real Vector Spaces 2. Subspaces 3. Linear Independence 4. Basis and Dimension 5. Row Space, Column Space, and Nullspace 6.
Boot Camp in Linear Algebra TIM 209 Prof. Ram Akella.
Matrices, Vectors, Determinants.
1 SYSTEM OF LINEAR EQUATIONS BASE OF VECTOR SPACE.
10.4 Matrix Algebra. 1. Matrix Notation A matrix is an array of numbers. Definition Definition: The Dimension of a matrix is m x n “m by n” where m =
Copyright © Cengage Learning. All rights reserved. 8 Matrices and Determinants.
Matrices Introduction.
7.3 Linear Systems of Equations. Gauss Elimination
5 Systems of Linear Equations and Matrices
Linear independence and matrix rank
Systems of First Order Linear Equations
Lial/Hungerford/Holcomb/Mullins: Mathematics with Applications 11e Finite Mathematics with Applications 11e Copyright ©2015 Pearson Education, Inc. All.
Matrices and Matrix Operations
7.5 Solutions of Linear Systems:
Presentation transcript:

Solving Linear Systems of Equations Computational Considerations general solution to a system particular solutions: Square systems Overdetermined systems Underdetermined systems

Computational Considerations One of the most important problems in technical computing is the solution of simultaneous linear equations. In matrix notation, this problem can be stated as follows; say by 1-by-1 matrix: 7x = 21 Does it have a unique solution? The answer is yes… x= 3 1-by-1 example.

Computational Considerations The solution is not ordinarily obtained by computing the inverse of 7, that is 7-1 = 0.142857..., and then multiplying 7-1 by 21. This would be more work and, if 7-1 is represented to a finite number of digits, less accurate. Similar considerations apply to sets of linear equations with more than one unknown;

Computational Considerations MATLAB uses the division terminology familiar in the scalar case to describe the solution of a general system of simultaneous equations; i.e.; X = A\B denotes the solution to the matrix Equation AX = B X = B/A denotes the solution to the matrix equation XA = B You can think of "dividing" both sides of the equation AX = B or XA = B by A. The coefficient matrix A is always in the "denominator

Computational Considerations The dimension compatibility conditions for X = A\B require the two matrices A and B to have the same number of rows. The solution X then has the same number of columns as B and its row dimension is equal to the column dimension of A. For X = B/A, the roles of rows and columns are interchanged.

Computational Considerations In practice, linear equations of the form AX = B occur more frequently than those of the form XA = B. Consequently, backslash is used far more frequently than slash.

Computational Considerations The coefficient matrix A need not be square. If A is m-by-n, there are three cases. m = n Square system. Seek an exact solution. m > n Over determined system. Find a least squares solution. m < n Underdetermined system. Find a basic solution with at most m nonzero components.

Computational Considerations The backslash operator employs different algorithms to handle different kinds of coefficient matrices. The various cases, which are diagnosed automatically by examining the coefficient matrix, include: Permutations of triangular matrices Symmetric, positive definite matrices Square, nonsingular matrices Rectangular, over determined systems Rectangular, underdetermined systems

General Solution The general solution to a system of linear equations AX = b describes all possible solutions. You can find the general solution by: Solving the corresponding homogeneous system AX = 0. Do this using the null command, by typing null(A). This returns a basis for the solution space to AX = 0. Any solution is a linear combination of basis vectors. Finding a particular solution to the non-homogeneous system AX = b. You can then write any solution to AX = b as the sum of the particular solution to AX = b, from step 2, plus a linear combination of the basis vectors from step 1.

Square Systems The most common situation involves a square coefficient matrix A and a single right-hand side column vector b. Nonsingular Coefficient Matrix: If the matrix A is nonsingular, the solution, x = A\b, is then the same size as b. For example,

Example MatLab A = pascal(3); u = [3; 1; 4]; x = A\u 10 -12 5 It can be confirmed that A*x is exactly equal to u.

Square Matrix If A and B are square and the same size, then X = A\B is also that size. B = magic(3); X = A\B X = 19 -3 -1 -17 4 13 6 0 -6 It can be confirmed that A*X is exactly equal to B.

Coefficient Matrix Both of these examples have exact, integer solutions. This is because the coefficient matrix was chosen to be pascal(3), which has a determinant equal to one. A later section considers the effects of roundoff error inherent in more realistic computations.

Singular Coefficient Matrix A square matrix A is singular if it does not have linearly independent columns. If A is singular, the solution to AX = B either does not exist, or is not unique. The backslash operator, A\B, issues a warning if A is nearly singular and raises an error condition if it detects exact singularity.

Example Singular Coefficient P = pinv(A)*b P is a pseudoinverse of A. If AX = b does not have an exact solution, pinv(A) returns a least- squares solution. For example, A = [ 1 3 7 -1 4 4 1 10 18 ] is singular, as you can verify by typing det(A) ans =

Exact Solutions. For b =[5;2;12], the equation AX = b has an exact solution, given by: pinv(A)*b ans = 0.3850 -0.1103 0.7066 You can verify that pinv(A)*b is an exact solution by typing A*pinv(A)*b

Verification Example b =[5;2;12]; A = [ 1 3 7;-1 4 4; 1 10 18]; >> A*pinv(A)*b ans = 5.0000 2.0000 12.0000

Least Squares Solutions. On the other hand, if b = [3;6;0], then AX = b does not have an exact solution. In this case, pinv(A)*b returns a least squares solution. If you type:

Least Square Solution b = [3;6;0]; >> A*pinv(A)*b ans = -1.0000 4.0000 2.0000 you do not get back the original vector b.

Has it got exact solution? You can determine whether AX = b has an exact solution by finding the row reduced echelon form of the augmented matrix [A b]. To do so for this example, enter: > rref([A b]) ans = 1.0000 0 2.2857 0 0 1.0000 1.5714 0 0 0 0 1.0000 Since the bottom row contains all zeros except for the last entry, the equation does not have a solution. In this case, pinv(A) returns a least-squares solution.