Document 13511337

advertisement
10.34, Numerical Methods Applied to Chemical Engineering
Professor William H. Green
Lecture #11: Numerical Calculation of Eigenvalues and Eigenvectors. Singular
Value Decomposition (SVD).
Singular Value Decomposition (SVD)
How do you handle poorly conditioned matrices? A·x = b
What are corresponding eigenvalues for rectangular matrix?
⎛
⎜
⎜
⎜
⎝
A
⎞
⎟⎛
⎟⎜⎜
⎟⎝
⎠
⎛
⎜
)⎜
⎜
⎝
⎞
⎟⎟ or (
⎠
A
⎞
⎟
⎟ eigenvalues? eigenvectors?
⎟
⎠
Lots of equations and not many unknowns Î rectangular matrix
[Oˆ f ( x) − q( x)] = 0
∫a
n
( x)ℜ( x)dx = 0
infinite number of equations, finite number of cn
f ( x, c ) = ∑ c nφ n ( x )
Another scenario:
Determine how plant is operating:
You make more measurements than unknowns.
⎛
A A: ⎜
⎜
⎝
T
⎛
⎞⎜
⎟⎜ A
⎟
⎠⎜
⎝
AT
⎞
⎟ ⎛ AT A
⎟ = ⎜⎜
⎟ ⎝
⎠
⎞
⎟ eigenvalues λ: σ i = λi Å “singular values of A”
⎟
⎠
small square matrix
⎛σ 1 0
⎜
⎜ 0 σ2
⎜0
0
⎜
A=U ⎜ 0
0
⎜0
0
⎜
⎜0
0
⎜
0
⎝0
0
0
σ3
0
0
0
0
0 0 ⎞
⎟
0 0 ⎟
0 0 ⎟
⎟
% 0 ⎟ ·VT
0 σ n ⎟⎟
0 0 ⎟
⎟
0 0 ⎠
UT = U-1
VT = V-1
in the Beers notes
this is called W square matrix
A = U·Σ·VT
big square
matrix
Í Singular value decomposition
rectangular matrix
mostly zeros
MATLAB read help for more information about svd
[U,S,V] = svd(A)
Cite as: William Green, Jr., course materials for 10.34 Numerical Methods Applied to Chemical
Engineering, Fall 2006. MIT OpenCourseWare (http://ocw.mit.edu), Massachusetts Institute of
Technology. Downloaded on [DD Month YYYY].
||A||2 = max({σi})
cond(A) = σmax/σmin
Pseudo Inverse
0 0 0
⎛σ 1 0
⎜
⎜ 0 σ2 0 0 0
+
0 σ3 0 0
A = V· ⎜ 0
⎜
0
0 % 0
⎜0
⎜0
0
0 0 σn
⎝
0 0⎞
⎟
0 0⎟
0 0 ⎟ UT x = A+b
⎟
0 0⎟
0 0 ⎟⎠
A·x ≈ b
For a poorly conditioned matrix, one of σi is close to zero; better to just replace 1/σn (when
σn ≈ 0) with 0. This gives you a more stable approximate inverse.
Figure 1. Least squares.
Figure 2. SVD ignores the other direction.
10.34, Numerical Methods Applied to Chemical Engineering
Prof. William Green
Lecture 11
Page 2 of 4
Cite as: William Green, Jr., course materials for 10.34 Numerical Methods Applied to Chemical
Engineering, Fall 2006. MIT OpenCourseWare (http://ocw.mit.edu), Massachusetts Institute of
Technology. Downloaded on [DD Month YYYY].
Least Squares
Homework
φi Vi
N
V (φ ) = ∑ y n cos(nφ )
0
0 0
# 2.1
#
#
5π
3
0.5
8.6
:
:
φi
cos(1 ⋅ 0)
⎛ cos(0 ⋅ 0)
⎜
⎜ cos(0 ⋅ π/3) cos(1 ⋅ π/3) cos(2 ⋅ π/3)
⎜
⎜
⎜
⎜
⎝
*setup_interV.m*
⎞
⎟
⎟
⎟
⎟
⎟
⎟
⎠
yi
y
⎛ 0⎞
⎜ ⎟
⎜ # ⎟
⎜ # ⎟
⎜ ⎟
⎜ # ⎟
⎜y ⎟
⎝ 5⎠
vi
⎛ 0 ⎞
⎜ ⎟
φ i ⋅ y i ⇒ ⎜ 2 .1 ⎟
⎜ 0. 5 ⎟
⎜ ⎟
⎜ # ⎟
⎝ ⎠
set tolerances in MatLAB and use: *interpolateV.m*
SVD – answers are not as sensitive to numerical noise
condA = 8.988·1015 Å HIGH
0
0
0 0⎞
⎛1 σ 1
⎟
⎜
0
0 0⎟
⎜ 0 1/ σ 2
ATVφ = V· ⎜ 0
0
1 / σ 3 0 0 ⎟ UT Vφ
⎟
⎜
0
0
% 0⎟
⎜ 0
⎜ 0
0
0
0 %⎟⎠
⎝
From MatLAB; singular values, S:
⎞
⎛ 2.495
⎟
⎜
2.495
⎟
⎜
⎟
⎜
2.495
⎟
⎜
2.495
⎟
⎜
⎜
0 ⎟⎟
⎜
⎜
0 ⎟⎠
⎝
Very poorly conditioned matrix means that there is a lot of flexibility in the unknown
variables.
y = y + ((U(i,i)’*Vphi)./S(j,j)).*V(i,j);
10.34, Numerical Methods Applied to Chemical Engineering
Prof. William Green
Lecture 11
Page 3 of 4
Cite as: William Green, Jr., course materials for 10.34 Numerical Methods Applied to Chemical
Engineering, Fall 2006. MIT OpenCourseWare (http://ocw.mit.edu), Massachusetts Institute of
Technology. Downloaded on [DD Month YYYY].
⎛
⎜
A
⎜
⎜
⎜
⎜
⎝
rectangle
⎞ ⎛
⎟ ⎜
⎟ ⎜
⎟=⎜
⎟ ⎜
⎟ ⎜
⎠ ⎝
U
square
same long
0⎞
⎞⎛ σ 1 0
⎟⎜
⎟⎛
⎞
⎟
⎟⎜ 0 σ 2 0 ⎟⎜
T
V
⎜
⎟
⎟⎜ 0
0 σ 3 ⎟⎜
⎟
⎟⎜
⎟⎝
⎠
⎟⎜ 0
⎟
0
0
⎠⎝
⎠
square; same as
dimension as A
A·V = U·Σ·VTV
A·V = V·Λ
short dimension of A
Λ
ATA·V = V·ΣTUTU·Σ
~
T
AA U = U Λ
Deconvolution of experimental data
SVD is very good for this.
S(λ,t) = Σcifi(t)gi(λ)
See homework for an example.
10.34, Numerical Methods Applied to Chemical Engineering
Prof. William Green
Lecture 11
Page 4 of 4
Cite as: William Green, Jr., course materials for 10.34 Numerical Methods Applied to Chemical
Engineering, Fall 2006. MIT OpenCourseWare (http://ocw.mit.edu), Massachusetts Institute of
Technology. Downloaded on [DD Month YYYY].
Download