* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
Download Chapter 1 Computing Tools
Survey
Document related concepts
Capelli's identity wikipedia , lookup
Linear algebra wikipedia , lookup
System of linear equations wikipedia , lookup
Cartesian tensor wikipedia , lookup
Eigenvalues and eigenvectors wikipedia , lookup
Rotation matrix wikipedia , lookup
Symmetry in quantum mechanics wikipedia , lookup
Jordan normal form wikipedia , lookup
Four-vector wikipedia , lookup
Singular-value decomposition wikipedia , lookup
Determinant wikipedia , lookup
Matrix (mathematics) wikipedia , lookup
Non-negative matrix factorization wikipedia , lookup
Perron–Frobenius theorem wikipedia , lookup
Matrix calculus wikipedia , lookup
Transcript
Matrix Operations Chapter 7 Matrix Mathematics Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Matrix Mathematics • Matrices are very useful in engineering calculations. For example, matrices are used to: – Efficiently store a large number of values (as we have done with arrays in MATLAB) – Solve systems of linear simultaneous equations – Transform quantities from one coordinate system to another • Several mathematical operations involving matrices are important Engineering Computation: An Introduction Using MATLAB and Excel Review: Properties of Matrices • A matrix is a one-or two dimensional array • A quantity is usually designated as a matrix by bold face type: A • The elements of a matrix are shown in square brackets: Engineering Computation: An Introduction Using MATLAB and Excel Review: Properties of Matrices • The dimension (size) of a matrix is defined by the number of rows and number of columns • Examples: 3 × 3: 2×4: Engineering Computation: An Introduction Using MATLAB and Excel Review: Properties of Matrices • An element of a matrix is usually written in lower case, with its row number and column number as subscripts: • In MATLAB, an element is designated by the matrix name with the row and column numbers in parentheses: A(1,2) Engineering Computation: An Introduction Using MATLAB and Excel Matrix Operations • • • • • • Matrix Addition Multiplication of a Matrix by a Scalar Matrix Multiplication Matrix Transposition Finding the Determinant of a Matrix Matrix Inversion Engineering Computation: An Introduction Using MATLAB and Excel Matrix Addition • Vectors must be the same size in order to add • To add two vectors, add the individual elements: • Matrix addition is commutative: A+B=B+A Engineering Computation: An Introduction Using MATLAB and Excel Multiplication of a Matrix by a Scalar • To multiple a matrix by a scalar, multiply each element by the scalar: • We often use this fact to simplify the display of matrices with very large (or very small) values: Engineering Computation: An Introduction Using MATLAB and Excel Multiplication of Matrices • To multiple two matrices together, the matrices must have compatible sizes: This multiplication is possible only if the number of columns in A is the same as the number of rows in B • The resultant matrix C will have the same number of rows as A and the same number of columns as B Engineering Computation: An Introduction Using MATLAB and Excel Multiplication of Matrices • Consider these matrices: • Can we find this product? Yes, 3 columns of A = 3 rows of B • What will be the size of C? 2 X 2: 2 rows in A, 2 columns in B Engineering Computation: An Introduction Using MATLAB and Excel Multiplication of Matrices • Easy way to remember rules for multiplication: These values must match Size of Product Matrix Engineering Computation: An Introduction Using MATLAB and Excel Multiplication of Matrices • Element ij of the product matrix is computed by multiplying each element of row i of the first matrix by the corresponding element of column j of the second matrix, and summing the results • This is best illustrated by example Engineering Computation: An Introduction Using MATLAB and Excel Example – Matrix Multiplication • Find • We know that matrix C will be 2 × 2 • Element c11 is found by multiplying terms of row 1 of A and column 1 of B: Engineering Computation: An Introduction Using MATLAB and Excel Example – Matrix Multiplication • Element c12 is found by multiplying terms of row 1 of A and column 2 of B: Engineering Computation: An Introduction Using MATLAB and Excel Example – Matrix Multiplication • Element c21 is found by multiplying terms of row 2 of A and column 1 of B: Engineering Computation: An Introduction Using MATLAB and Excel Example – Matrix Multiplication • Element c22 is found by multiplying terms of row 2 of A and column 2 of B: Engineering Computation: An Introduction Using MATLAB and Excel Example – Matrix Multiplication • Solution: Engineering Computation: An Introduction Using MATLAB and Excel Practice Problems • Find C = AB Engineering Computation: An Introduction Using MATLAB and Excel Practice Problems • Find C = AB Engineering Computation: An Introduction Using MATLAB and Excel Practice Problems • Find C = AB Engineering Computation: An Introduction Using MATLAB and Excel Matrix Multiplication • In general, matrix multiplication is not commutative: AB ≠ BA Engineering Computation: An Introduction Using MATLAB and Excel Transpose of a Matrix • The transpose of a matrix by switching its row and columns • The transpose of a matrix is designated by a superscript T: • The transpose can also be designated with a prime symbol (A’). This is the nomenclature used in MATLAB Engineering Computation: An Introduction Using MATLAB and Excel Determinant of a Matrix • The determinant of a square matrix is a scalar quantity that has some uses in matrix algebra. Finding the determinant of 2 × 2 and 3 × 3 matrices can be done relatively easily: • The determinant is designated as |A| or det(A) • 2 × 2: Engineering Computation: An Introduction Using MATLAB and Excel Determinant of a Matrix • Examples: Engineering Computation: An Introduction Using MATLAB and Excel Determinant of a Matrix • 3 × 3: • Similar for larger matrices, but easier to do with MATLAB or Excel Engineering Computation: An Introduction Using MATLAB and Excel Inverse of a Matrix • Some square matrices have an inverse • If the inverse of a matrix exists (designated by -1 superscript), then where I is the identity matrix – a square matrix with 1’s as the diagonal elements and 0’s as the other elements Engineering Computation: An Introduction Using MATLAB and Excel Inverse of a Matrix • The inverse of a 2X2 matrix is easy to find: Engineering Computation: An Introduction Using MATLAB and Excel Inverse of a Matrix • Example: find inverse of A: Engineering Computation: An Introduction Using MATLAB and Excel Check Result Engineering Computation: An Introduction Using MATLAB and Excel Practice Problem • Find A-1, check that A A-1 = I Engineering Computation: An Introduction Using MATLAB and Excel Inverse of a Matrix • Note from the formula for the inverse of a 2 × 2 matrix that if the determinant equals zero, then the inverse is undefined • This is true generally: the inverse of a square matrix exists only of the determinant is non-zero Engineering Computation: An Introduction Using MATLAB and Excel