Lecture 6 - Rensselaer Polytechnic Institute 6.pdf · Lecture 6. Lecture outline ... c 1x1 2x 1 4x7...
Transcript of Lecture 6 - Rensselaer Polytechnic Institute 6.pdf · Lecture 6. Lecture outline ... c 1x1 2x 1 4x7...
ENGR-1100 Introduction to Engineering Analysis
Lecture 6
Lecture outline
•Matrix and Matrix operations•Rules of matrix arithmetic•Determinants•2 In class problems
Definition: A matrix is a rectangular array of numbers
2 2
-2 0
-1 -1
2 2 π
-2 0 sin(2)
-1 -1 e
2 2 π −3
The size of the matrix m x n. Where m the number of rows and n the number of columns.
Capital letters denote matrices
Lower case letters denote numerical quantities
2 2
-2 0
-1 -1
A= 2 2 π −3C=
In a square matrix m = n a11 a12….… a1n
a21 a22….… a2n
: : :
an1 an2….… ann
A= a11, a22….… ann are on the main diagonal
Definition 1: equal matrices
• Matrix are said to be equal if they have: (i) the same size, and (ii) the corresponding entries in the two matrices are equal.
2 2
-2 0
-1 -1
A=
1 2
-2 0
3 -1
B=
2 2 1
-2 0 2
-1 -1 2
C=
A=B; B=C; A=C
Definition 2: sum of matrices• If A and B are any two matrices of the same size, then the
sum A+B is the matrix obtained by adding together the corresponding entries in the two matrices. Matrices of different sizes can’t be added.
2 2
-2 0
-1 -1
A=
1 2
-2 0
3 -1
B=
2 2 1
-2 0 2
-1 -1 2
C=
3 4
-4 0
2 -2
A+B=A+C and B+C are undefined
Definition 3: matrix scalar product• If A is any matrix and c any scalar, then the product cA is
the matrix obtained by multiplying each entry of A by c.
2 2
-2 0
-1 -1
A=
4 4
-4 0
-2 -2
2A=
-2 -2
2 0
1 1
(-1)A=-A=
Definition 4: Product of two matrices
1 2 4
2 6 0A=
4 1 4 3
0 -1 3 1
2 7 5 2
B=
A x B =?
=1 2 42 6 0
4
0
2
1
-1
7
4
3
5
3
1
2
26
(2x4)+(6x3)+(0x5)=26
=1 2 42 6 0
4
0
2
1
-1
7
4
3
5
3
1
2
13
26
(1x3)+(2x1)+(4x2)=13
Example 1 complete the product computation
=1 2 42 6 0
4
0
2
1
-1
7
4
3
5
3
1
2
13
26
Example 1 Solution
=1 2 42 6 0
4
0
2
1
-1
7
4
3
5
3
1
2
12 27 30 13
8 -4 26 12
120662x01x63x2c 3020645x43x24x1c40622x01x61x2c 2728217x41x21x1c
80082x00x64x2c ,128042x40x24x1c
2,43,1
2,22,1
2,11,1
=−+=++==++=++=
−=+−=+−+==+−=+−+=
=++=++==++=++=
The size of a product matrix
A B = AB
m x r r x n m x n
inside
outside
Remember, Rows then Columns. (Thankfully, your calculator and Matlab work like this too).
Transpose of a matrix AT
a11
a12
a13
a14
AT=
a21
a22
a23
a24
a31
a32
a33
a34
a11 a12 a13 a14
a21 a22 a23 a24
a31 a32 a33 a34
A=
Example 2 Determine ED
E=
1 5 2
-1 0 1
3 2 4
D=
6 1 3
-1 1 2
4 1 3
2112184x31x12x43,3f 266202x30x15x43,2f 129143x31x11x41,3f
78124x21x12x12,3f 1-4-52x21x0-1x52,2f 46113x21x11x11,2f
25121124x31x12x61,3f 366302x30x15x61,2f 149163x31x11x61,1f,EDFLet
=++=++==+=++==+−=+−+=
=++−=++−==+=++==+−−=+−+−=
=++=++==+=++==+−=+−+==
−=
212612714253614
ED
Example 3 Determine D+E
E=
1 5 2
-1 0 1
3 2 4
D=
6 1 3
-1 1 2
4 1 3
−=+
737312567
ED
Rules of matrix arithmetic
-1 0
2 3A=
1 2
3 0B=
Multiply AB:
-1 -2
11 4AB=
3 6
-3 0BA=
Then: AB=BA
Multiply BA
The following rules of matrix arithmetic are valid(assuming that the sizes of the matrices are such that the indicated operations can be performed)
• (a) A+B=B+A• (b) A+(B+C)=(A+B)+C• (c) A(BC)=(AB)C• (d) A(B±C)=AB±AC• (e) (B±C)A=BA±CA• (f) a(B±C)=aB±aC• (g) (a±b)C=aC±bC• (h (ab)C=a(bC)• (i) a(BC)=(aB)C=B(aC)
Identity matrix:square matrix with 1’s on the main diagonal and 0’s off the main diagonal
1 0
0 1I2=
1 0 00 1 00 0 1
I3=
1
0
0
0
0
1
0
0
0
0
1
0
0
0
0
1
I4=
If A is an mxn matrix, then:
AIn=A and ImA=A
Why study determinants?• They have important applications to system of
linear equations and can be used to produce formula for the inverse of an invertible matrix.
• The determinant of a square matrix A is denoted by det(A) or |A|. If A is 1x1 matrix
A=[a11]Then: det(A)= a11
For example A=[-7]det (A)=det(-7)=-7
Determinant of a 2x2 matrix
If A is a 2x2 matrixa11 a12
a21 a22A=
Then we define
a11 a12
a21 a22det(A)= = det(A)= a11a22 -a21a12
a11 a12
a21 a22
minus
Example 1
5 4
3 2A=
Then we define
5 4
3 2det(A)= = det(A)= (5x2)-(3x4)=-2
5 4
3 2
Duplicate column method – for 3x3
a11 a12 a13
a21 a22 a23
a31 a32 a33
a11 a12
a21 a22
a31 a32
det(A)=
1 5 -3
1 0 2
3 -1 2
Example1 5
1 0
3 -1
=0+30+3-0-(-2)-10=25
I personally do not like this method. It only works for 3 x3It means nothing physically.
Class assignment 1
-1 2 3
4 1 -6
-3 5 2
A=
• Find det(A) using the method shown in class
• Let
Class assignment 1 Solution
-1 2 3
4 1 -6
-3 5 2
A=
57)692032(]23*3[]10*2[)]32(*1[)]1*3()5*4[(*)3[(
)]6*3()2*4[(*)2[()]]6*5()2*1[(*)1[(
253614
321
=++−=+−−−=−−+
−−−−−−−=
−−
−=A
Inverse of a 2x2 matrix
If A is a 2x2 matrix
Then we define
𝐴𝐴 = 𝑎𝑎 𝑏𝑏𝑐𝑐 𝑑𝑑
𝐼𝐼𝐼𝐼𝐼𝐼 𝐴𝐴 = 𝐴𝐴−1 =𝑑𝑑 −𝑏𝑏−𝑐𝑐 𝑎𝑎det(𝐴𝐴)
So, if the determinant is zero, what does that say about A-1 ?
Example 2
5 4
3 2A=
Then we define
5 4
3 2det(A)= = det(A)= 5X2-4X3=-2
2 -4
-3 5Inv(A)= / -2
-1 2
3/2 -5/2A-1=
6543
Class assignment 2
• Find the matrix A.
• Let A be an invertible matrix whose inverse is:
Don’t overthink this question. Invert this matrix. (There is a reason for this wording, discussed later in the semester.)
Class assignment 2 Solution
• Find the matrix A.
( ) ( )[ ] ( ) ( )
−
−=
−
−
−
=
−=−=−=
=
2/32/523
23546
A
220185x46x3)det(A ,6543
A 1-1-