Download CPA7-MatrixOper

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Mathematics of radio engineering wikipedia , lookup

Determinant wikipedia , lookup

Matrix calculus wikipedia , lookup

Transcript
ME 142
Engineering 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
2 3 5
D  7 2 4
8 11 6
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
 The 2 matrices to be added must be the same size
 Matrices are added element by element
1 4 5
A

8
3
2


Result AxB
 6 4 2


14
10
6


5 0  3
B

6
7
4


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
1 4 5
A

8
3
2






Row1,col1:
Row1,col2:
Row2,col1:
Row2,col2:
 1 5
B   1 4
 3 2
12 31
Results ( AxB)  

11
56


1*1 + 4*(-1) +5*3 = 12
1*5 + 4*4 + 5*2 = 31
8*1 + 3*(-1) + 2*3 = 11
8*5 + 3*4 + 2*2 = 56
Matrix Multiplication: AxB
=MMULT(A,B) [Shift]+[Cntl]+[Enter]
Matrix Multiplication: BxA
=MMULT(B,A) [Shift]+[Cntl]+[Enter]
Transposing a Matrix
 To transposing a matrix simply switch the rows and columns
 Any matrix can be transposed
1 4 5
A

8
3
2


1 8 
A transposed  4 3
5 2
=TRANSPOSE(A) [Shift]+[Cntl]+[Enter]
Inverting a Matrix
 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
1 0 0
0 1 0 


0 0 1
3x3 Identity
Matrix
Inverting a Matrix
2 3 5
D  7 2 4
8 11 6
0.175
0.009 
 0.152
Dinverse   0.047  0.133 0.128 
 0.289
0.009  0.081
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
2 3 5
D  7 2 4
8 11 6




2 3 5 2 3 
7 2 4 7 2  Determinant = 211


8 11 6 8 11
Recopy first 2 columns
Multiply and sum diagonals to the right
Multiply and sum diagonals to the left
Difference of sum is determinant
(2*2*6 + 3*4*8 + 5*7*11) – (5*2*8 + 2*4*11 + 3*7*6)
=MDETERM(D)
Matrix Inversion Method
Given linear system of equations in matrix form:
AX   B
Where
 a11 a12
A a21 a22
a31 a32
a13 
a23 
a33 
 b1 
 x1 
X   x2  B b2 
b3 
 x3 
Then multiplying both sides by [A-1], the inversion of [A]
A AX   A B
X   A B
1
1
1
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
Given linear system of equations in matrix form:
AX   B
Where
 a11 a12

A a21 a22
a31 a32
a13 

a23 
a33 
 x1 
X   x2 
 x3 
 b1 
B b2 
b3 
Cramer’s Rule
Then the determinant of [A] may be defined as:
a11 a12
D  a21 a22
a31 a32
a13
a23
a33
And values of [X] may be found from the expressions below:
x1 
b1
b2
b3
a12 a13
a11 b1 a13
a22 a23
a21 b2 a23
a32 a33
a31 b3 a33
x2 
D
D
a11 a12 b1
a21 a22 b2
a31 a32 b3
x3 
D
Cramer’s Rule
 Useful in solving systems of 2 or 3 linear equations, by hand
or by computer