Professional Documents
Culture Documents
Computer Methods
Matrices
Matrices
Variety of engineering problems lead to the
need to solve systems of linear equations
Ax = b
Columns,
j = 1, …, n
Examples
– W to B, A, N, R, P, L
– R to N, P, W
Examine the matrix to see if
there is a round trip between
– D to B, N every city that is connected by a
– L to N, W flight.
Matrix Transpose
The transpose of the (m x n) matrix A is the (n x
m) matrix formed by interchanging the rows and
columns such that row i becomes column i of
the transposed matrix
a11 a21 am1
a11 a12 a1n
a a22 am 2
a a22 a2 n AT = 12
A = 21
a
m1 am 2 amn a1n a2n amn
Example - Transpose
1 3 T 1 2
A= A =
2 5 3 5
1 0
1 3 4
A= AT = 3 1
0 1 0
4 0
Matrix Equality
A=B
if and only if
aij = bij for i = 1,...,m; j = 1,...,n
Vector Addition
a1 b1 a1 + b1
a b a + b2
a + b = 2 + 2 = 2
am bm am + bm
Examples - Vector Addition
1 3
− 3 5
u= v=
2 − 1
4 − 2
1 3 1 + 3 4 1 5
− 3 5 − 3 + 5 2 − 3 − 15
u+v = + = = 5u = 5 =
2 − 1 2 − 1 1 2 10
4 − 2 4 − 2 2 4 20
Matrix Addition
1 2 3 3 2 1
A = 2 1 4 B = − 4 1 2
1 4 3 2 3 1
1 2 3 3 2 1 4 4 4
A + B = 2 1 4 + − 4 1 2 = − 2 2 6
1 4 3 2 3 1 3 7 4
1 4 1 − 2 − 8 − 2
α = −2, A = , αA = − 4 0 − 6
2 0 3
Matrix – Matrix Multiplication
The product of two matrices A and B is defined only
if
– the number of columns of A is equal to the number of rows
of B.
If A is (m x p) and B is (p x n), the product is an (m x
n) matrix C
C mxn = Amxp B pxn
Matrix – Matrix Multiplication
b1
a = (a1, a2 ,, an ) b2
b=
c1x1 = a1xn bnx1 (scalar)
bn
b1
b2
c = a ⋅ b = (a1, a2 ,, an ) = a1b1 + a2b2 + + an bn
bn
Example - Matrix Multiplication
1 3 2 1
A= B=
2 4 3 5
C 2 x 2 = A2 x 2 B2 x 2
1 3 2 1 1 ⋅ 2 + 3 ⋅ 3 1 ⋅1 + 3 ⋅ 5 11 16
C = A⋅ B = = =
2 4 3 5 2 ⋅ 2 + 4 ⋅ 3 2 ⋅1 + 4 ⋅ 5 16 22
Example - Matrix Multiplication
1 2 3 2 1
A = 2 1 4 B = 1 2
1 4 3 2 1
1 2 3 2 1
C = A ⋅ B = 2 1 4 1 2
C 3 x 2 = A3 x3 B3 x 2
1 4 3 2 1
1 ⋅ 2 + 2 ⋅1 + 3 ⋅ 2 1 ⋅1 + 2 ⋅ 2 + 3 ⋅1 10 8
= 2 ⋅ 2 + 1 ⋅1 + 4 ⋅ 2 2 ⋅1 + 1 ⋅ 2 + 4 ⋅1 = 13 8
1 ⋅ 2 + 4 ⋅1 + 3 ⋅ 2 1 ⋅1 + 4 ⋅ 2 + 3 ⋅1 12 12
Example - Matrix Multiplication
3 0 4 7
B=
A = 1 1
6 8
5 2
C 3 x 2 = A3 x 2 B2 x 2
3 0 12 21
4 7
C = A⋅ B = 1 1 = 10 15
6 8
5 2 32 51
Diagonal Matrices
a11 0 0 0
0 a22 0 0
A =
Diagonal Matrix 0 0 0
0 0 0 ann
Identity Matrix
1 0 0 0
0 1 0 0
I =
0 0 1 0
0 0 0 1
The identity matrix has the property that
if A is a square matrix, then
IA = AI = A
Matrix Inverse
If
A is an (n x n) square matrix and there is a
matrix X with the property that AX = I
AA−1 = I A−1 A = I
AA −1 = I
Example - Matrix Inverse
• Example (2 x 2) matrix
a11 a12
A =
a a
21 22
1 a22 − a12
A−1 =
a11a22 − a12 a21 − a21 a11
Special Matrices