ME 142 Engineering Computation I Matrix Operations in Excel.
-
Upload
cornelia-bradley -
Category
Documents
-
view
227 -
download
0
Transcript of ME 142 Engineering Computation I Matrix Operations in Excel.
ME 142Engineering Computation I
Matrix Operations
in
Excel
Key Concepts
Matrix Basics
Matrix Addition
Matrix Multiplication
Transposing a Matrix
Inverting a Matrix
The Determinant of a Matrix
Matrix Inversion Method
Cramer’s Rule
Matrix Basics
What is a Matrix? A matrix may be defined as a collection of numbers, arranged into
rows and columns
6118
427
532
D
Matrix Basics
Named cells may be used to define arrays Simplifies process Makes formulas easier to understand
Pre-select the array output area Use [Shift]+[Ctrl]+[Enter] key combination to execute array
commands Populates each cell in array output area with array command
Matrix Addition
238
541A
476
305B
61014
246ResultAxB
The 2 matrices to be added must be the same size Matrices are added element by element
Matrix Addition
=A+B [Shift]+[Cntl]+[Enter]
Matrix Multiplication
In order to multiply 2 matrices, the number of columns in the first matrix must equal the number of rows in the second matrix
Elements in the results matrix are obtained by performing a product-sum of each row in the first matrix by each column in the second matrix
Matrix Multiplication
238
541A
23
41
51
B
Row1,col1: 1*1 + 4*(-1) +5*3 = 12 Row1,col2: 1*5 + 4*4 + 5*2 = 31 Row2,col1: 8*1 + 3*(-1) + 2*3 = 11 Row2,col2: 8*5 + 3*4 + 2*2 = 56
5611
3112)(Results AxB
Matrix Multiplication: AxB
=MMULT(A,B) [Shift]+[Cntl]+[Enter]
Matrix Multiplication: BxA
=MMULT(B,A) [Shift]+[Cntl]+[Enter]
Transposing a Matrix
=TRANSPOSE(A) [Shift]+[Cntl]+[Enter]
238
541A
25
34
81
transposedA
To transposing a matrix simply switch the rows and columns
Any matrix can be transposed
Inverting a Matrix
100
010
001 A matrix multiplied by its inverse matrix results in the identity matrix
The inverse of a matrix can be useful in solving simultaneous equations
Only square matrices (equal number of rows and columns) are possible to invert
Not all square matrices can actually be inverted
3x3 Identity Matrix
Inverting a Matrix
6118
427
532
D
081.0009.0289.0
128.0133.0047.0
009.0175.0152.0
inverseD
Inverting a Matrix
=MINVERSE(D) [Shift]+[Cntl]+[Enter]
Determinant of a Matrix
The determinant of a matrix is a single value, calculated by performing a product-sum on the rows and columns in a matrix
The determinant of a matrix can be useful in solving simultaneous equations
Only square matrices (equal number of rows and columns) have a determinant
Determinant of a Matrix
=MDETERM(D)
6118
427
532
D Determinant = 211
Recopy first 2 columns Multiply and sum diagonals to the right Multiply and sum diagonals to the left Difference of sum is determinant
1186118
27427
32532
(2*2*6 + 3*4*8 + 5*7*11) – (5*2*8 + 2*4*11 + 3*7*6)
Matrix Inversion Method
BAX 1
333231
232221
131211
aaa
aaa
aaa
A
3
2
1
x
x
x
X
3
2
1
b
b
b
B
BXA
BAXAA 11
Given linear system of equations in matrix form:
Where
Then multiplying both sides by [A-1], the inversion of [A]
Cramer’s Rule
This rule states that each unknown in a system of linear equations may be expressed as a fraction of two determinants.
The determinant of the denominator, D, is obtained from the coefficients of matrix [A]
The determinant of the numerator is obtained from D by replacing the column of coefficients of the unknown in question by the coefficients of matrix [B]
Cramer’s Rule
333231
232221
131211
aaa
aaa
aaa
A
3
2
1
x
x
x
X
3
2
1
b
b
b
B
BXA
Given linear system of equations in matrix form:
Where
Cramer’s Rule
Then the determinant of [A] may be defined as:
And values of [X] may be found from the expressions below:
333231
232221
131211
aaa
aaa
aaa
D
D
aab
aab
aab
x 33323
23222
13121
1 D
aba
aba
aba
x 33331
23221
13111
2 D
baa
baa
baa
x 33231
22221
11211
3
Cramer’s Rule
Useful in solving systems of 2 or 3 linear equations, by hand or by computer