Chapter 7 Matrix Mathematics Matrix Operations Copyright © The McGraw-Hill Companies, Inc....
-
Upload
caren-young -
Category
Documents
-
view
221 -
download
5
Transcript of Chapter 7 Matrix Mathematics Matrix Operations Copyright © The McGraw-Hill Companies, Inc....
![Page 1: Chapter 7 Matrix Mathematics Matrix Operations Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.](https://reader036.fdocuments.us/reader036/viewer/2022062407/56649db25503460f94aa0deb/html5/thumbnails/1.jpg)
Chapter 7Matrix Mathematics
Matrix Operations
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
![Page 2: Chapter 7 Matrix Mathematics Matrix Operations Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.](https://reader036.fdocuments.us/reader036/viewer/2022062407/56649db25503460f94aa0deb/html5/thumbnails/2.jpg)
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
![Page 3: Chapter 7 Matrix Mathematics Matrix Operations Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.](https://reader036.fdocuments.us/reader036/viewer/2022062407/56649db25503460f94aa0deb/html5/thumbnails/3.jpg)
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
![Page 4: Chapter 7 Matrix Mathematics Matrix Operations Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.](https://reader036.fdocuments.us/reader036/viewer/2022062407/56649db25503460f94aa0deb/html5/thumbnails/4.jpg)
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
![Page 5: Chapter 7 Matrix Mathematics Matrix Operations Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.](https://reader036.fdocuments.us/reader036/viewer/2022062407/56649db25503460f94aa0deb/html5/thumbnails/5.jpg)
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
![Page 6: Chapter 7 Matrix Mathematics Matrix Operations Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.](https://reader036.fdocuments.us/reader036/viewer/2022062407/56649db25503460f94aa0deb/html5/thumbnails/6.jpg)
Matrix Operations
• Matrix Addition• Multiplication of a Matrix by a Scalar• Matrix Multiplication• Matrix Transposition • Finding the Determinate of a Matrix• Matrix Inversion
Engineering Computation: An Introduction Using MATLAB and Excel
![Page 7: Chapter 7 Matrix Mathematics Matrix Operations Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.](https://reader036.fdocuments.us/reader036/viewer/2022062407/56649db25503460f94aa0deb/html5/thumbnails/7.jpg)
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
![Page 8: Chapter 7 Matrix Mathematics Matrix Operations Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.](https://reader036.fdocuments.us/reader036/viewer/2022062407/56649db25503460f94aa0deb/html5/thumbnails/8.jpg)
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
![Page 9: Chapter 7 Matrix Mathematics Matrix Operations Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.](https://reader036.fdocuments.us/reader036/viewer/2022062407/56649db25503460f94aa0deb/html5/thumbnails/9.jpg)
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
![Page 10: Chapter 7 Matrix Mathematics Matrix Operations Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.](https://reader036.fdocuments.us/reader036/viewer/2022062407/56649db25503460f94aa0deb/html5/thumbnails/10.jpg)
Multiplication of Matrices
• Consider these matrices:
• Can we find this product?
• What will be the size of C?
Engineering Computation: An Introduction Using MATLAB and Excel
Yes, 3 columns of A = 3 rows of B
2 X 2: 2 rows in A, 2 columns in B
![Page 11: Chapter 7 Matrix Mathematics Matrix Operations Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.](https://reader036.fdocuments.us/reader036/viewer/2022062407/56649db25503460f94aa0deb/html5/thumbnails/11.jpg)
Multiplication of Matrices
• Easy way to remember rules for multiplication:
Engineering Computation: An Introduction Using MATLAB and Excel
These values must match
Size of Product Matrix
![Page 12: Chapter 7 Matrix Mathematics Matrix Operations Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.](https://reader036.fdocuments.us/reader036/viewer/2022062407/56649db25503460f94aa0deb/html5/thumbnails/12.jpg)
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
![Page 13: Chapter 7 Matrix Mathematics Matrix Operations Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.](https://reader036.fdocuments.us/reader036/viewer/2022062407/56649db25503460f94aa0deb/html5/thumbnails/13.jpg)
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
![Page 14: Chapter 7 Matrix Mathematics Matrix Operations Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.](https://reader036.fdocuments.us/reader036/viewer/2022062407/56649db25503460f94aa0deb/html5/thumbnails/14.jpg)
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
![Page 15: Chapter 7 Matrix Mathematics Matrix Operations Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.](https://reader036.fdocuments.us/reader036/viewer/2022062407/56649db25503460f94aa0deb/html5/thumbnails/15.jpg)
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
![Page 16: Chapter 7 Matrix Mathematics Matrix Operations Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.](https://reader036.fdocuments.us/reader036/viewer/2022062407/56649db25503460f94aa0deb/html5/thumbnails/16.jpg)
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
![Page 17: Chapter 7 Matrix Mathematics Matrix Operations Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.](https://reader036.fdocuments.us/reader036/viewer/2022062407/56649db25503460f94aa0deb/html5/thumbnails/17.jpg)
Example – Matrix Multiplication
• Solution:
Engineering Computation: An Introduction Using MATLAB and Excel
![Page 18: Chapter 7 Matrix Mathematics Matrix Operations Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.](https://reader036.fdocuments.us/reader036/viewer/2022062407/56649db25503460f94aa0deb/html5/thumbnails/18.jpg)
Practice Problems
• Find C = AB
Engineering Computation: An Introduction Using MATLAB and Excel
![Page 19: Chapter 7 Matrix Mathematics Matrix Operations Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.](https://reader036.fdocuments.us/reader036/viewer/2022062407/56649db25503460f94aa0deb/html5/thumbnails/19.jpg)
Practice Problems
• Find C = AB
Engineering Computation: An Introduction Using MATLAB and Excel
![Page 20: Chapter 7 Matrix Mathematics Matrix Operations Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.](https://reader036.fdocuments.us/reader036/viewer/2022062407/56649db25503460f94aa0deb/html5/thumbnails/20.jpg)
Practice Problems
• Find C = AB
Engineering Computation: An Introduction Using MATLAB and Excel
![Page 21: Chapter 7 Matrix Mathematics Matrix Operations Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.](https://reader036.fdocuments.us/reader036/viewer/2022062407/56649db25503460f94aa0deb/html5/thumbnails/21.jpg)
Matrix Multiplication
• In general, matrix multiplication is not commutative:
AB ≠ BA
Engineering Computation: An Introduction Using MATLAB and Excel
![Page 22: Chapter 7 Matrix Mathematics Matrix Operations Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.](https://reader036.fdocuments.us/reader036/viewer/2022062407/56649db25503460f94aa0deb/html5/thumbnails/22.jpg)
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
![Page 23: Chapter 7 Matrix Mathematics Matrix Operations Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.](https://reader036.fdocuments.us/reader036/viewer/2022062407/56649db25503460f94aa0deb/html5/thumbnails/23.jpg)
Determinate of a Matrix
• The determinate of a square matrix is a scalar quantity that has some uses in matrix algebra. Finding the determinate of 2 × 2 and 3 × 3 matrices can be done relatively easily:
• The determinate is designated as |A| or det(A)• 2 × 2:
Engineering Computation: An Introduction Using MATLAB and Excel
![Page 24: Chapter 7 Matrix Mathematics Matrix Operations Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.](https://reader036.fdocuments.us/reader036/viewer/2022062407/56649db25503460f94aa0deb/html5/thumbnails/24.jpg)
Determinate of a Matrix
• Examples:
Engineering Computation: An Introduction Using MATLAB and Excel
![Page 25: Chapter 7 Matrix Mathematics Matrix Operations Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.](https://reader036.fdocuments.us/reader036/viewer/2022062407/56649db25503460f94aa0deb/html5/thumbnails/25.jpg)
Determinate 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
![Page 26: Chapter 7 Matrix Mathematics Matrix Operations Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.](https://reader036.fdocuments.us/reader036/viewer/2022062407/56649db25503460f94aa0deb/html5/thumbnails/26.jpg)
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
![Page 27: Chapter 7 Matrix Mathematics Matrix Operations Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.](https://reader036.fdocuments.us/reader036/viewer/2022062407/56649db25503460f94aa0deb/html5/thumbnails/27.jpg)
Inverse of a Matrix
• The inverse of a 2X2 matrix is easy to find:
Engineering Computation: An Introduction Using MATLAB and Excel
![Page 28: Chapter 7 Matrix Mathematics Matrix Operations Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.](https://reader036.fdocuments.us/reader036/viewer/2022062407/56649db25503460f94aa0deb/html5/thumbnails/28.jpg)
Inverse of a Matrix
• Example: find inverse of A:
Engineering Computation: An Introduction Using MATLAB and Excel
![Page 29: Chapter 7 Matrix Mathematics Matrix Operations Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.](https://reader036.fdocuments.us/reader036/viewer/2022062407/56649db25503460f94aa0deb/html5/thumbnails/29.jpg)
Check Result
Engineering Computation: An Introduction Using MATLAB and Excel
![Page 30: Chapter 7 Matrix Mathematics Matrix Operations Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.](https://reader036.fdocuments.us/reader036/viewer/2022062407/56649db25503460f94aa0deb/html5/thumbnails/30.jpg)
Practice Problem
• Find A-1, check that A A-1 = I
Engineering Computation: An Introduction Using MATLAB and Excel
![Page 31: Chapter 7 Matrix Mathematics Matrix Operations Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.](https://reader036.fdocuments.us/reader036/viewer/2022062407/56649db25503460f94aa0deb/html5/thumbnails/31.jpg)
Inverse of a Matrix
• Note from the formula for the inverse of a 2 × 2 matrix that if the determinate equals zero, then the inverse is undefined
• This is true generally: the inverse of a square matrix exists only of the determinate is non-zero
Engineering Computation: An Introduction Using MATLAB and Excel