ME 210 Applied Mathematics for Mechanical Engineerscourses.me.metu.edu.tr/courses/me210/... · ME...
Transcript of ME 210 Applied Mathematics for Mechanical Engineerscourses.me.metu.edu.tr/courses/me210/... · ME...
ME 210 Applied Mathematics for Mechanical Enginee rs
Prof. Dr. Bülent E. Platin Spring 2014 – Sections 02 & 03 1/26
Gauss(ian) Elimination
This is a systematic method in which
• First variable is eliminated from the (m–1) equations starting from the 2nd
equation up until the last equation using 1st equation,
• Second variable is eliminated from the (m–2) equations starting from the 3rd equation up until the last equation using 2nd equation,
• This process is continued until no more variable and/or equation is left.
• Then, the solution is obtained in the reverse order starting from the last one by
a simple back substitution .
This is a powerful method which also yields all the information on the consistency of equations as well as the uniqueness of the solution, if exists.
The method has several variants and some advanced versions. However, its very
basic version will be covered here.
ME 210 Applied Mathematics for Mechanical Enginee rs
Prof. Dr. Bülent E. Platin Spring 2014 – Sections 02 & 03 2/26
The procedure is applied to the augmented matrix [A¦b] by performing a set of basic (elementary) row operations such that the matrix [A¦b] will be transformed into what is so-called as the row echelon form in which all elements of [C] = [A¦b] below its elements cii {i = 1, 2, …, min(m,n+1)} become zero.
Some basic row echelon forms of [A ¦ b]
xx0000
xxx000
xxxx00
xxxxx0
xxxxxx
L
L
MMMOMMM
L
L
L
xxx000
xxxx00
xxxxx0
xxxxxx
L
MMMOMMM
L
L
L
x00000
xx0000
xxx000
xxxx00
xxxxx0
xxxxxx
L
L
L
MMMOMMM
L
L
L
000000 L
000000 L
000000 L
000000 LSign of redundancy
Sign of inconsistencySign of
unique solutionSign of
multiple solutions
IMPORTANT WARNING: NEVER PERFORM ANY COLUMN OPERATIONS! WHY?
ME 210 Applied Mathematics for Mechanical Enginee rs
Prof. Dr. Bülent E. Platin Spring 2014 – Sections 02 & 03 3/26
Row operations used in Gauss Elimination Method are as follows.
• Interchange of two rows.
• Multiplication of any row by a nonzero scalar.
• Replacement of a row by the sum of multiple of itself and another multiple of
the pivot row .
The pivot row of a [A¦b] matrix is its row located at the same position as the location of the column containing the coefficients of the variable to be eliminated.
Examples:
72233
01124
65108 ← The pivot row
1st variable is to be eliminated in rows below it.
3300
1100
0740
8642
← The pivot row
3rd variable is to be eliminated in rows below it.
ME 210 Applied Mathematics for Mechanical Enginee rs
Prof. Dr. Bülent E. Platin Spring 2014 – Sections 02 & 03 4/26
→←←
1100
0740
3310
8642
R2R4R4R2
3310
0740
1100
8642
3300
1100
0740
8642
72233
01124
65108
pivot elementpivot element
pivot element
pivot element
The pivot or pivot element of a [A¦b] matrix is the element of the pivot row located
at the same position as the location of the pivot row.
Examples:
The pivot element of a pivot row should be a nonzero entry.
If there is zero in its location, then its row should be interchanged by one of the
rows below that row to have a nonzero entry at its position in order declare it as
pivot element and its row as pivot row .
Example:
ME 210 Applied Mathematics for Mechanical Enginee rs
Prof. Dr. Bülent E. Platin Spring 2014 – Sections 02 & 03 5/26
−−−
−=→
3111
53101
2212
b][AM
3xxx
53x10xx
22xx2x
321
321
321
−=++−=−+=+−
Example: (m=n and a unique solution exists)
444 3444 21
R1R3*2:R32element Pivot1Row row Pivot
neliminatio 1 Column
4410
88210
2212
+=
=
−−
−→
444 3444 21
M
R1R2*2:R22element Pivot1Row row Pivotneliminatio 1 Column
3111
88210
2212
b][A
−=
=
−−−
−→
44444 344444 21
R2R3*21:R321 element Pivot2Row row Pivot
neliminatio 2 Column
929200
88210
2212
−=
=
−−
−→
Back substitution:
92 x3 = –92 → x3 = –1
21 x2 – 8 x3 = 8 → 21 x2 – 8 (–1) = 8 → x2 = 0
2 x1 – x2 + 2 x3 = 2 → 2 x1 – (0) + 2 (–1) = 2 → x1 = 2
−=
1
0
2
[x]
Solution:
Unique solution
ME 210 Applied Mathematics for Mechanical Enginee rs
Prof. Dr. Bülent E. Platin Spring 2014 – Sections 02 & 03 6/26
Solve the following set of equations by Gauss elimination
1 2 3 4
1 2 3 4
1 2 3 4
1 2 3 4
x + 2 x + 3 x + 4 x = 5
2 x + x + 4 x + x = 2
3 x + 4 x + x + 5 x = 14
2 x + 3 x + 5 x + 2 x = 4
1 2 3 4 5 1 2 3 4 5
2 1 4 1 2 0 -3 -2 -7 -8 =>
3 4 1 5 14 0 0 -6 5
2 3 5 2 4
11
0 0 0 -71 -71
Solution:
x4 = 1 x3 = -1 x2 = 1 x1 = 2
Example: (m=n and a unique solution exists)
Unique solution
ME 210 Applied Mathematics for Mechanical Enginee rs
Prof. Dr. Bülent E. Platin Spring 2014 – Sections 02 & 03 7/26
Example: (m>n, but a unique solution exists)
43421
M
R2*3R1*2:R23element Pivot1Row row Pivot
neliminatio 1 Column
1331
3570
423
b][A
−=
=
→
44 344 21
R3*3-R1:R33element Pivot1Row row Pivotneliminatio 1 Column
3570
3570
423
==
−−→
43421
R3R2:R37 element Pivot2Row row Pivot
neliminatio 2 Column
000
3570
423
+=
=
→
Back substitution:
7 x2 = 35 → x2 = 5
3 x1 + 2 x2 = 4 → 3 x1 + 2 (5) = 4 → x1 = –2
−=
5
2[x]
Unique solution
Solution:133xx
9x2x
42x3x
21
21
21
=+−=−
=+
−−=→
1331
912
423
b][AM
redundancy
Twoindependentequations
ME 210 Applied Mathematics for Mechanical Enginee rs
Prof. Dr. Bülent E. Platin Spring 2014 – Sections 02 & 03 8/26
Note that m = 3, n = 2, rank [A] = 2, rank [A ¦ b] = 2; hence a solution exists and it is
unique.
Notice that the last line of the augmented matrix [A ¦ b] is transformed into all zeros
indicating the redundancy existing in the set of equations.
Therefore, m – n = 3 – 2 = 1 of 3 equations must be redundant.
As a matter of fact, for large scale systems, number of such all–zero rows gives the number of redundant equations, which is when subtracted from number of
equations m, gives the number of independent equations.
However, it is not too clear to spot the structure of this redundancy by a simple inspection, which becomes even impossible when m and/or becomes large.
ME 210 Applied Mathematics for Mechanical Enginee rs
Prof. Dr. Bülent E. Platin Spring 2014 – Sections 02 & 03 9/26
=→
=++=++=++
10233
9122
6111
b][A
102x3x3x
9x2x2x
6xxx
321
321
321
M
Note that m = 3, n = 3, rank[A] = 2, rank[A¦b] = 3.
Hence the equations are inconsistent, therefore no solution exists.
For large scale systems, number of such rows gives the number of inconsistentequations.
No solution
44 344 2144 344 21444 3444 21
M
R2R3:R3R33R1:R3R2R1*2:R2
5000
3100
6111
8100
3100
6111
10233
3100
6111
b][A
−−−
→
→
→indication of
inconsistency
Example: (m=n , no solution)
row echelon form is obtained
additional row operation
ME 210 Applied Mathematics for Mechanical Enginee rs
Prof. Dr. Bülent E. Platin Spring 2014 – Sections 02 & 03 10/26
=→
=++=+=+=+
4233
3110
2101
1011
b][A
42x3x3x
3xx
2xx
1xx
321
32
31
21
M
44 344 2144 344 2144 344 2144 344 21
M
R4R3:R4R2R3:R3R1*3R4:R4R1R2:R2
3000
4200
1110
1011
1200
4200
1110
1011
1200
3110
1110
1011
4233
3110
1110
1011
b][A
−+−−
−→
−→
−→
−→
No solutionNote that m = 4, n = 3, rank [A] = 3, rank [A¦b] = 4
Hence the equations are inconsistent, therefore no solution exists.
Example: (m>n , no solution)
indication of inconsistency
ME 210 Applied Mathematics for Mechanical Enginee rs
Prof. Dr. Bülent E. Platin Spring 2014 – Sections 02 & 03 11/26
444 3444 21444 3444 21
M
R2*2R3:R3R1R3:R3
10000
21100
10011
52200
21100
10011
b][A
−−
→
→
Example: (m<n , no solution)
No solution
Note that m = 3, n = 4, rank[A] = 2, rank[A¦b] = 3
Hence the equations are inconsistent, therefore no solution exists.
=→
=+++=+=+
62211
21100
10011
b][A
62x2xxx
2xx
1xx
4321
43
21
M
indication of inconsistency
row echelon form is obtained
additional row operation
ME 210 Applied Mathematics for Mechanical Enginee rs
Prof. Dr. Bülent E. Platin Spring 2014 – Sections 02 & 03 12/26
=→
=+=+=+
844
422
211
b][A
84x4x
42x2x
2xx
21
21
21
M
Example: (m>n , multiple solutions)
Family of solutions
Set x2 = c. Then, the solution is expressed as: 1
2
x 2 - c 2 -1 = = + c
x c 0 1
4342143421
M
R1*4R3:R3R1*2R2:R2
000
000
211
844
000
211
b][A
−−
⇒
⇒ indication of 2 redundant equations
only 1 independent equation
Note that m = 3, n = 2, rank[A] = 1, rank[A¦b] = 1Hence a solution exists and it is multiple with {n–rank[A] = 2–1 = 1} parameter.
ME 210 Applied Mathematics for Mechanical Enginee rs
Prof. Dr. Bülent E. Platin Spring 2014 – Sections 02 & 03 13/26
Example: (m<n , multiple solutions)
−−−−
−−−−
=→
=+−+−=−++−=+−+−=+−+−
112321
245942
359863
46111184
b][A
1x2x3x2xx
24x5x9x4x2x
35x9x8x6x3x
46x11x11x8x4x
54321
54321
54321
54321
M
44444 344444 2144444 344444 21
M
R1*4R4:R4
R1*2R3:R3
R1*3R2:R2R4&R1eInterchang
023100
069300
023100
112321
46111184
245942
359863
112321
b][A
−−−
−−−
−−−−
→
−−−−
−−−−
→
Note that m = 4, n = 5, and it can further be shown that rank[A] = 2, rank[A¦b] = 2Hence a solution exists and it is multiple with {n–rank[A] = 5–2 = 3} parameters.
ME 210 Applied Mathematics for Mechanical Enginee rs
Prof. Dr. Bülent E. Platin Spring 2014 – Sections 02 & 03 14/26
44444 344444 21
M
R33R4:R4
000000
069300
023100
112321
023100
069300
023100
112321
b][A
+
−−−−−
→
−−−
−−−−
→
only 2 independent
equations
4444 34444 21
M
R2*3R3:R3
000000
000000
023100
112321
000000
069300
023100
112321
b][A
+
−−−−
→
−−−−−
→
3-parameter solutions
row echelon form is obtained
indication of1 redundant
equation
additional row operation
indication of2 redundant equations
ME 210 Applied Mathematics for Mechanical Enginee rs
Prof. Dr. Bülent E. Platin Spring 2014 – Sections 02 & 03 15/26
−−−−
→
000000
000000
023100
112321
b][AM
The 2nd row (corresponding to one the only two independent equations), which is normally reserved for finding the second unknown x2 reads as
– x3 – 3x4 + 2x5 = 0indicating that not all x3, x4, x5 can be chosen arbitrarily.
But, we still have one more unknown that can be chosen arbitrarily. Since the 1st row is actually reserved to determine the 1st unknown x1.
So, take x5 = c1 and x4 = c2 then x3 = 2c1 –3c2
Take x2 = c3 then x1 = 1 – c1 + 2c2 – 3(2c1 –3c2) +2c3 = 1 – 7c1 + 11c2 + 2c3
+
−+
−
+
=
−
++−
=
0
0
0
1
2
c
0
1
3
0
11
c
1
0
2
0
7
c
0
0
0
0
1
c
c
3c2c
c
2c11c7c1
x
x
x
x
x
321
1
2
21
3
321
5
4
3
2
1
Therefore, the solution is expressed as
ME 210 Applied Mathematics for Mechanical Enginee rs
Prof. Dr. Bülent E. Platin Spring 2014 – Sections 02 & 03 16/26
Example: (homogeneous equations, m=n, only the trivial solution exists)
Note that equations are all homogeneous and m = 3, n = 3, rank[A] = 3Hence only the trivial solution exists.
=→
=+=+=+
0110
0101
0011
b][A
0xx
0xx
0xx
32
31
21
M
444 3444 21444 3444 21R2R3:R3R1R2:R2
0200
0110
0011
0110
0110
0011
+−
−→
−→
The 3rd row indicates that
2 x3 = 0 thus x3 = 0
Back substitution of this in the 2nd equation gives
– x2 + x3 = 0 thus x2 = 0Back substitution of this in the 1st equation gives
x1 + x2 = 0 thus x1 = 0
Hence, the trivial solution x1 = x2 = x3 = 0 is the only solution.
ME 210 Applied Mathematics for Mechanical Enginee rs
Prof. Dr. Bülent E. Platin Spring 2014 – Sections 02 & 03 17/26
Example: (m>n, unique solution with a redundant row arising at the mid-elimination)
−−−−
=→
=++=++−=−++=−+−=+
105230
02064
75131
35031
40102
b][A
105x2x3x
02x6x4x
75xx3xx
35x3xx
4x2x
432
421
4321
421
31
M
−−−−
→
−−−−
+−+
105230
82260
1010160
1010160
40102
105230
02064
75131
35031
40102
operation no : R5R4R1*2 : R4R3*2R1 : R3R2*2R1 : R2
ME 210 Applied Mathematics for Mechanical Enginee rs
Prof. Dr. Bülent E. Platin Spring 2014 – Sections 02 & 03 18/26
Example: (m>n, unique solution with a redundant row arising at the mid-elimination)
indication of redundancy
−
− →
−−−−
+−+−
+
1020300
212100
00000
1010160
40102
105230
82260
1010160
1010160
40102
R5*2R2 : R5R4R2 : R4
R3R2 : R3
−−
→
−
−
00000
1020300
212100
1010160
40102
1020300
212100
00000
1010160
40102
bottom the torow redundant the Take
ME 210 Applied Mathematics for Mechanical Enginee rs
Prof. Dr. Bülent E. Platin Spring 2014 – Sections 02 & 03 19/26
4444 34444 21Form EchelonRow
R4R3*3 : R4
00000
1616000
212100
1010160
40102
00000
1020300
212100
1010160
40102
−−
− →
−−
−
• There are no inconsistencies in the row-echelon form.
• Therefore, the system has at least one solution.
• In the row-echelon form, one row is redundant leaving 4 linearly
independent equations.
• Since there is the same number of linearly independent equations as the
number unknowns (4), this system has a unique solution .
Example: (m>n, unique solution with a redundant row arising at the mid-elimination)
ME 210 Applied Mathematics for Mechanical Enginee rs
Prof. Dr. Bülent E. Platin Spring 2014 – Sections 02 & 03 20/26
Back-substitution:
Solution:
Example: (m>n, unique solution with a redundant row arising at the mid-elimination)
1x1616x 44 −=→−=
10x212x212xx 3343 =→−=−→−=+
35
x1010106x1010xx6x 22432 −=→=++→=−+
3x4102x4x2x 1131 −=→=+→=+
[ ]
−
−−
=
1
10
5/3
3
x
ME 210 Applied Mathematics for Mechanical Enginee rs
Prof. Dr. Bülent E. Platin Spring 2014 – Sections 02 & 03 21/26
−−−−
→
−−−−
+−+
105230
82260
1210160
1010160
40102
105230
02064
85131
35031
40102
operation no : R5R4R1*2 : R4R3*2R1 : R3R2*2R1 : R2
−−−−
=→
=++=++−=−++=−+−=+
105230
02064
85131
35031
40102
b][A
105x2x3x
02x6x4x
85xx3xx
35x3xx
4x2x
432
421
4321
421
31
M
The only change in the previous example
Example: (m>n, inconsistency arising at the mid-elimination)
(same as before)
ME 210 Applied Mathematics for Mechanical Enginee rs
Prof. Dr. Bülent E. Platin Spring 2014 – Sections 02 & 03 22/26
−−
− →
−−−−
+−+−
+
1020300
212100
20000
1010160
40102
105230
82260
1210160
1010160
40102
R5*2R2 : R5R4R2 : R4
R3R2 : R3
Example: (m>n, inconsistency arising at the mid-elimination)
The 3rd row indicates an inconsistency, i.e.
which is not possible.
Therefore, there is no need to continue the elimination; this system has no solution .
(same as before)
20x0x0x0x 4421 −=+++
ME 210 Applied Mathematics for Mechanical Enginee rs
Prof. Dr. Bülent E. Platin Spring 2014 – Sections 02 & 03 23/26
Inverse of a Square Matrix
Adjoint matrix of [A]
Determinant of [A]
Adj[A] = [Cij]T
Transpose of the Cofactor Matrix, [Cij]T
Cofactor Matrix (Recall)
Matrix formed from cofactors of elements (minors with sign)
Properties of matrix inversion
[A][A]-1 = [A]-1[A] = [ I ]
{[A]-1}-1 = [A]
det{[A]-1} = 1 / det[A]
{[A]T}-1 = {[A]-1}T
{[B][C]}-1 = [C]-1[B]-1
det[A]Adj[A]
[A] 1 =−
Cij = (–1)i+j Mij
ME 210 Applied Mathematics for Mechanical Enginee rs
Prof. Dr. Bülent E. Platin Spring 2014 – Sections 02 & 03 24/26
Unique Solution of a Set of Linearly-independent, A lgebraic Equationsby Matrix Inverse
[A] [x] = [b] →→→→ [A]-1 [A] [x] = [A]-1 [b]
Example
Find the solution of the following system of linear equations by using
matrix inverse.
{ 32144 344 21[b][x]
3
2
1
[A]
321
321
321
3
5
2
x
x
x
111
3101
212
3xxx
53x10xx
22xx2x
−=
−−
−⇒
−=++−=−+=+−
→→→→ [x] = [A]-1 [b]
ME 210 Applied Mathematics for Mechanical Enginee rs
Prof. Dr. Bülent E. Platin Spring 2014 – Sections 02 & 03 25/26
46](11)(4)2)(1)(1)[(
111
2110
410
111
2110
212
111
3101
212
det[A]442
R3*2R1:R1R3R2:R2
=−−−=−
−=−
−−
=−
−−
=−
++
321321
443442144 344 21
−−=
−−
−−
−−
−−
−−
−
−−−
−−
=21817
143
11213
101
12
31
22
310
2111
12
11
22
11
2111
101
11
31
11
310
][Cij
−
−=−
21111
842
17313
461
[A] 1
−=
−×+×−+×−×+×+×
−×−+×+×=
−
−
−== −
1
0
2
3)(2151)(211
3)(85422
3)(17)(53213
461
3
5
2
21111
842
17313
461
[b][A][x] 1
The solution is:
ME 210 Applied Mathematics for Mechanical Enginee rs
Prof. Dr. Bülent E. Platin Spring 2014 – Sections 02 & 03 26/26
END OF WEEK END OF WEEK END OF WEEK END OF WEEK END OF WEEK END OF WEEK END OF WEEK END OF WEEK 33333333