PDF - MIT OpenCourseWare

advertisement
10.34, Numerical Methods Applied to Chemical Engineering
Professor William H. Green
Lecture #10: Function Space.
Functional Approximation
(Variables are scalar in this example)
N
f ( x ) ≈ ∑ c nφ n ( x ) + Δ ( x )
Figuring out Δ(x) is similar to solving whole problem
n =0
Increase N until function converges
{φn(x)} favorite set of functions
length M
N
w ≈ ∑ cn v n
{vn} favorite set of vectors
N<M
n =0
{ }
vn ∈ ℜ
m
N
Basis: el =
∑ d l ,n v n
w
approx
N
≈ ∑ c n v n = ∑ a l el = ∑ a l d l , n v n
n =0
n =0
l
l ,n
c = aTD
el·ej = δjl Î orthonormal
We want to do the same with functions. How do you take dot product?
Define “φn·φm” =
∫ dx g ( x)φ
*
n
( x)φ m ( x)
“works”: <φm|φn> = δmn
interesting
range of x
weighting
function
g(x) = k
x: 0 Æ 2π
φm = eimx = cos(mx) + i·sin(mx)
e imx + e − imx
= cos(mx)
2
g(x) = 1
g ( x) = e − x
g ( x) =
2
x: -1 Æ +1
Legendre polynomials
x: -∞ Æ +∞
Hermite polynomials
2
π 1− x2
x: -1 Æ +1
Chebyshev polynomials
1) We chose a basis {φn(x)} and an inner product
orthonormal: <φm|φn> = δmn
2) We’re trying to solve Ôf(x) = q(x)
unknown
given
(“In most problems, these are all vectors,
but that looks too scary to start with”)
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].
Look for solutions: funknown(x) ≈
[
]
∑c φ
n n
(x)
b
*
*
dx
g
(
x
)
φ
(
λ
)
O
f
(
x
)
=
m
∫
∫ dx g ( x)φm ( x)q( x) solution will depend on a,b,cn,m.
b
a
a
favorite
range
F(a,b,cn,m) = v(m,a,b)
F(cn,m) = v(m)
Now solve for cn.
If Ô is a linear operator:
Oˆ ∑ c n φ n ( x ) =
Ôfapprox(x) =
∑c
n
(Oˆ φ n )
and if Ôφn = λnφn (i.e. φn is an eigenfunction of Ô)
Ôfapprox(x) = =
∑c λ φ
n
n
n
b
(x)
*
*
∫ dx g ( x)φ m ∑ cn λnφn = ∑ cn λn ∫ dx gφmφn
b
a
<φm|φn> = δmn
a
b
*
∫ dx g ( x)φm Oˆ f
N
approx
= ∑ c n λ nδ mn = c m λ m
n=0
a
c m λ m = ∫ dx g ( x)φ m* ( x)q( x) ≡ bm
cm =
1
λm
∫ dx g ( x)φ
*
m
( x)q ( x)
f(x)
⎡ ∂
⎤
Oˆ = ⎢k 2 + h( x)⎥T ( x) Often this is the operator
⎣ ∂x
⎦
2
sin
cos
are eigenfunctions
Gives you a really messy equation:
Suppose Ô = Ô1 + h(x)
{i.e. Schrodinger Equation}
Suppose Ô1φn = λnφ
10.34, Numerical Methods Applied to Chemical Engineering
Prof. William Green
Lecture 10
Page 2 of 3
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].
b
∫ dx g ( x)φ
*
m
( x)Oˆ f
approx
a
= c m λ m + ∫ dx g ( x)φ m* ( x)h( x)∑ c nφ n ( x)
∑ c ∫ dx g ( x)φ
n
*
m
( x)h( x)φ n ( x)
H mn
c m λ m + ∑ c n H mn = bm
(H+Λ)c = B m=1,…N
⎛ λ1
⎜
λmI = ⎜ 0
⎜0
⎝
0
λ2
0
Linear Problem: c = (H+Λ)\b
0⎞
⎟
0⎟
λ3 ⎟⎠
Must evaluate integrals Hmn: difficult to evaluate, quantum mechanics requires 6dimensional integrals. H becomes a large matrix when n gets large.
Also have Boundary Conditions: f(x = 0) = f0
Adds another equation:
∑c φ
n n
( x = 0) = f 0
v·c = f0
How to solve? Can try to fit by least squares and just fit all the equations approximately.
Can drop larger n terms to leave space for boundary conditions. Another way would be to
not consider the boundary conditions and then craftily choose Φn so that they solve the
boundary conditions.
To check if answer makes sense: write out the series and see if cn converges
Evaluate Residuals
R = Ôf – q
max(R) < tol?
||R(xi)|| < tol?
we will evaluate this later
10.34, Numerical Methods Applied to Chemical Engineering
Prof. William Green
Lecture 10
Page 3 of 3
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