You are on page 1of 54

Robotics

Department of Electromechanical Engineering


Abu Dhabi Polytechnic

Module 2
Matrix Algebra
26-May-22 Robotics 1
Course Learning Outcomes

When I complete this module, I want to be able to do


the following

• CLO2:Perform basic mathematic manipulations


of spatial coordinate representation and
transformation.

26-May-22 Control System Technologies (EMEC-201) 2


Why use it?
Matrix algebra makes mathematical
expression and computation easier.
It allows you to get rid of cumbersome
notation, concentrate on the concepts involved
and understand where your results come from.
Definitions - scalar

 a scalar is a number
– (denoted with regular type: 1 or 22)
Definitions - vector

Vector: a single row or column of numbers


– denoted with bold small letters
– row vector
a = [1 2 3 4 5]
– column vector
1 
 2
b=  3
 4
5
Definitions - Matrix
A matrix is an array of numbers

A=  a11 a12 a13 


a 21 a 22 a 23

Denoted with a bold Capital letter


All matrices have an order (or dimension):
that is, the number of rows × the number of
columns. So, A is 2 by 3 or (2 × 3).
What you most likely know
• All about (1x1) matrices

• Operation Example Result

• Addition 2+2
• Subtraction 5-1
• Multiplication 2x2
• Division 12 / 3
What you most likely know
• All about (1x1) matrices

• Operation Example Result

• Addition 2+2 4
• Subtraction 5–1 4
• Multiplication 2x2 4
• Division 12 / 3 4
What you may guess
• Numbers can be organized in boxes, e.g.

1 2

3 4
What you may guess
• Numbers can be organized in boxes, e.g.

1 2

3 4
Matrix Notation

A
Many Numbers
31 23 16 99 08 12 14 73 85 98 33 94 12 75 02 57 92 75 11
28 39 57 17 38 18 38 65 10 73 16 73 77 63 18 56 18 57 02
74 82 20 10 75 84 19 47 14 11 84 08 47 57 58 49 48 28 42
88 84 47 48 43 05 61 75 98 47 32 98 15 49 01 38 65 81 68
43 17 65 21 79 43 17 59 41 37 59 43 17 97 65 41 35 54 44
75 49 03 86 93 41 76 73 19 57 75 49 27 59 34 27 59 34 82
43 19 74 32 17 43 92 65 94 13 75 93 41 65 99 13 47 56 34
75 83 47 48 73 98 47 39 28 17 49 03 63 91 40 35 42 12 54
31 87 49 75 48 91 37 59 13 48 75 94 13 75 45 43 54 32 53
75 48 90 37 59 37 59 43 75 90 33 57 75 89 43 67 74 73 10
34 92 76 90 34 17 34 82 75 98 34 27 69 31 75 93 45 48 37
13 59 84 76 59 13 47 69 43 17 91 34 75 93 41 75 90 74 17
34 15 74 91 35 79 57 42 39 57 49 02 35 74 23 57 75 11 35
Matrix Notation

A
Useful Subnotation

A
2 2
Useful Subnotation

A
8 40
Matrix Operations
• Addition
• Subtraction
• Multiplication
• Inverse
Addition

1 2 5 6
3 4
+ 7 8
=

A + B =
Addition

1 2 5 6 6 8
3 4
+ 7 8
= 10 12

A + B = C
Addition Conformability
To add two matrices A and B:

• # of rows in A = # of rows in B

• # of columns in A = # of columns in B
Subtraction

5 6 1 2

7 8
- 3 4
=

B - A =
Subtraction

5 6 1 2 4 4
7 8
- 3 4
= 4 4

B - A = C
Subtraction Conformability
• To subtract two matrices A and B:

• # of rows in A = # of rows in B

• # of columns in A = # of columns in B
Multiplication Conformability
• Regular Multiplication

• To multiply two matrices A and B:

• # of columns in A = # of rows in B

• Multiply: A (m x n) by B (n by p)
Multiplication General Formula

n
Cij = E Aik x Bkj
k=1
Multiplication I

5 6 1 2

7 8
x 3 4
=

A x B =
Multiplication II

5 6 1 2 (5x1)
7 8
x 3 4
=

A x B = C
n

C11 = E A11 x B11


k=1
Multiplication III

5 6 1 2 (5x1)+(6x3)
7 8
x 3 4
=

A x B = C
n

C11 = E A12 x B21


k=2
Multiplication IV

5 6 1 2 23 (5x2)+(6x4)
7 8
x 3 4
=

A x B = C
n

C12 = E A1k x Bk2


k=1
Multiplication V

5 6 1 2 23 34
7 8
x 3 4
= (7x1)+(8x3)

A x B = C
n

C21 = E A2k x Bk1


k=1
Multiplication VI

5 6 1 2 23 34
7 8
x 3 4
= 31 (7x2)+(8x4)

A x B = C
n

C22 = E A2k x Bk2


k=1
Multiplication VII

5 6 1 2 23 34
7 8
x 3 4
= 31 46

A x B = C
mxn nxp mxp
Transpose
• Usually denoted by ’
• Sometimes T

• Exchanges rows and columns


• (m x n) matrix becomes (n x m)
• Aij = Aji
Inner Product of a Vector
2
• (Column) Vector c (n x 1) c = 4
1

2 4 1 x 2 = (2x2)+(4x4)+(1x1)
4
= 1 = 21

c' c c' c
Outer Product of a Vector
2
• (Column) vector c (n x 1) c = 4
1

2 x 2 4 1 = 4 8 2

4 8 16 4

1 2 4 1

c c' c c'
Properties
AB does not necessarily equal BA
(BA may even be an impossible operation)
For example,
A × B = C
(2 × 3) × (3 × 2) = (2 × 2)
B × A = D
(3 × 2) × (2 × 3) = (3 × 3)
Properties
Matrix multiplication is Associative
A(BC) = (AB)C

Multiplication and transposition


(AB)' = B'A'
Special matrices
There are a number of special matrices
– Diagonal
– Null
– Identity
Diagonal Matrices
– A diagonal matrix is a square matrix that has
values on the diagonal with all off-diagonal entities
being zero.

a11 0 0 0
0 a 0 0 
 22

0 0 a33 0
 
0 0 0 a44 
Identity Matrix
An identity matrix is a diagonal matrix where
the diagonal elements all equal one.
1 0 0 0
I= 0 1 0 0

0 0 1 0
 
0 0 0 1

A×I=A
Null Matrix
A square matrix where all elements equal zero.

0 0 0 0
0 0 0 0

0 0 0 0
 
0 0 0 0
The Determinant of a Matrix
The determinant of a matrix A is denoted by
|A| (or det(A)).
Determinants exist only for square matrices.
They are a matrix characteristic, and they are
also difficult to compute
The Determinant for a 2x2 matrix
If A =
a11 a12 
a 
 21 a22 

Then

A = a11a22 − a12a21
Properties of Determinates
Determinants have several mathematical properties
which are useful in matrix manipulations.
– 1 |A|=|A'|.
– 2. If a row or column of A = 0, then |A|= 0.
– 3. If every value in a row or column is multiplied by k,
then |A| = k|A|.
– 4. If two rows (or columns) are interchanged the sign,
but not value, of |A| changes.
– 5. If two rows or columns are identical, |A| = 0.
– 6. If two rows or columns are linear combination of each
other, |A| = 0
Properties of Determinants
– 7. |A| remains unchanged if each element of a row
or each element multiplied by a constant, is added
to any other row.
– 8. |AB| = |A| |B|
– 9. Det of a diagonal matrix = product of the
diagonal elements
Inverse
• A number can be divided by another number - How
do you divide matrices?

• Note that a / b = a x 1 / b

• And that a x 1 / a = 1

• 1 / a is the inverse of a
Properties of inverse matrices

( AB ) −1
= B A-1 -1

(A )

( A' )
−1
= -1 '


(A )-1 −1
= A
Unary operations: Inverse
• Matrix ‘equivalent’ of 1 is the identity matrix

1 0
I = 0 1

-1 -1
• Find A such that A * A = I
Unary Operations: Inverse
• Inverse of (2 x 2) matrix
– Find determinant
– Swap a11 and a22
– Change signs of a12 and a21
– Divide each element by determinant
– Check by pre- or post-multiplying by inverse
Inverse of 2 x 2 matrix
• Find the determinant
= (a11 x a22) = (a21 x a12)
For

2 5
A = 1 3

det(A) = (2x3) – (1x5) = 1


Inverse of 2 x 2 matrix
• Swap elements a11 and a22
Thus
2 5
A = 1 3

becomes
3 5
1 2
Inverse of 2 x 2 matrix
• Change sign of a12 and a21
Thus
3 5
A = 1 2

becomes
3 -5
-1 2
Inverse of 2 x 2 matrix
• Divide every element by the determinant
Thus

3 -5
A = -1 2

becomes

3 -5
-1 2

(luckily the determinant was 1)


Inverse of 2 x 2 matrix
• Check results with A-1 A = I
Thus

3 -5 2 5
-1 2
x 1 3

equals
1 0
0 1
THE END
Thank You

54

You might also like