Date post: | 23-Dec-2015 |
Category: |
Documents |
Upload: | caren-young |
View: | 222 times |
Download: | 5 times |
Chapter 7Matrix Mathematics
Matrix Operations
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 Determinate 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?
• 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
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
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
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
Determinate of a Matrix
• Examples:
Engineering Computation: An Introduction Using MATLAB and Excel
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
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 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