LINEAR EQUATIONS
1
Numerical Methods
Process Systems Engineering
For who was thinking that The Matrix is a product of Neo, Trinity and Morpheus …
2
Numerical Methods
Process Systems Engineering
I have to say: It’s all about Leibniz, Cramer and Gauss
Leibniz Cramer
~1690 ~1720
Gauss
~1810
3
Numerical Methods
Process Systems Engineering
OVERVIEW
• Different ways of looking at a system of
linear equations (Matrices)
• The inverse, determinant and rank of a
matrix
• The existence of a solution to a set of
linear equations
• Eigenvalues of a matrix
4
Numerical Methods
Process Systems Engineering
MATLAB
• Vector and matrix • It is an interpreted
operations are an language (in
intrinsic part of matlab reference to a
• High level: don’t worry compiler): makes it
about memory sometimes slow
management/allocatio
n
• Close to ‘proper’
languages
• Command line
interface user friendly
5
Numerical Methods
Process Systems Engineering
6
Numerical Methods
Process Systems Engineering
z T z
r x x, y , z T
r Mx 4,7,5
y y
x x
7
Numerical Methods
Process Systems Engineering
INVERSE OF A MATRIX
• Inverse is defined such that:
1 1
MM I and M M I (2-4)
1
x M b (2-8)
8
Numerical Methods
Process Systems Engineering
AN EXAMPLE
• The example:
1 1 1
(2-10)
M 2 1 3
3 1 6
10
Numerical Methods
Process Systems Engineering
CO-FACTORS
• A co-factor is defined to be the
determinant of the stuff left over when you
cover up the row and column of the
element in question:
1 * * (2-11)
* 1 3
* 1 6
11
Numerical Methods
Process Systems Engineering
(2-12)
12
Numerical Methods
Process Systems Engineering
1 1 1 1 * *
M 2 1 3 * 1 3
3 1 6 * 1 6
13
Numerical Methods
Process Systems Engineering
14
Numerical Methods
Process Systems Engineering
1 1 1
2 1 1 1 1 1
det 2 1 3 det 3 det 6 det 1
3 1 3 1 2 1
3 1 6
15
Numerical Methods
Process Systems Engineering
x 3 5 2 4 13 13
1 1
y 3 3 1 7 4 4
1 1
z 1 2 1 5 5 5
16
Numerical Methods
Process Systems Engineering
LARGE SYSTEMS
• Computation of determinants and inverses
of large matrices in this way is too difficult
(slow), so we need other methods to
calculate the inverse of a large matrix
(large systems).
17
Numerical Methods
Process Systems Engineering
USEFUL PROPERTIES
• Triangular matrices:
(2-14) 5 3 2
n
det( M trian ) aii M 0 9 1 det( M ) 5 9 1 45
i 1 0 0 1
• Matrix multiplication:
a 0 0
A 0 1 0 det( AM ) det( A) * det(M ) a * det(M )
0 0 1
18
Numerical Methods
Process Systems Engineering
USEFUL PROPERTIES
• Matrix multiplication:
1 1 0
A 0 1 0 ; det( A) 1
0 0 1
19
Numerical Methods
Process Systems Engineering
MATRIX RANK
• Rank of a matrix: the number of linearly
independent columns (columns that can
not be expressed as a linear combination
of the other columns) of a matrix
Column 2 and 4 are not independent
5 3 2
1 2 1 0
M 0 9 1 M 0 0 1 1
0 0 1 0 0 0 0
3 independent columns: 2 independent columns:
rank(M)=3 Rank(M)=2
20
Numerical Methods
Process Systems Engineering
22
Numerical Methods
Process Systems Engineering
TWO EXAMPLES
1 1 2 17 1 1 2 17
M 0 3 1 ,b 11 Ma 0 3 1 11
0 0 2 4 0 0 2 4
Rank(M) = 3 = n unique solution
Rank, solution??
1 1 2 17 1 1 2 17
M 0 3 1 ,b 11 Ma 0 3 1 11
0 0 0 0 0 0 0 0
Rank(M)=rank(Ma)=2 < n infinite number of solutions
23
Numerical Methods
Process Systems Engineering
EIGENVALUES AND
EIGENVECTORS
• Matrices have characteristic directions,
called eigenvectors, e:
Me e (2-15)
24
Numerical Methods
Process Systems Engineering
FINDING EIGENVALUES
• An example:
1 0 1
M 0 1 0
1 0 1
• From: Me= e
Me I e 0
M I e 0
25
Numerical Methods
Process Systems Engineering
Calculating
• Find : previous equation has infinitely
many solutions for e, so:
det M I 0
1 0 1
det M I det 0 1 0 0
1 0 1
26
Numerical Methods
Process Systems Engineering
Calculating , continued
det(M I )
1 0 0 0 0 1
(1 ) det 0 det 1det
0 1 1 1 1 0
(1 ){(1 ) 2 0} {0 1(1 )} 0
27
Numerical Methods
Process Systems Engineering
SPECTRAL DECOMPOSITION
Me1 e
1 1
M M M M M M 1 0 0
Me2 e
2 2 M e1 e2 e3 e1 e2 e3 0 2 0
M M M M M M 0 0 3
Me3 e
3 3
28
Numerical Methods
Process Systems Engineering
SUMMARY
• Linear equations can be written as
matrices
• A solution depends on the rank of a matrix
• Eigenvalues and eigenvectors are
characteristics of a matrix
29