Академический Документы
Профессиональный Документы
Культура Документы
Equations relating derivatives of more than one independent variables are called partial differential equations (PDEs) Different notations: u = x u = u x x
INF2340 / Spring 2005 p.
Motivation
In this course we will study simulation of differential equations:
steady heat equation (elliptic): heat equation (parabolic): wave equation (hyperbolic): transport equations:
2
u = uxx + uyy = q
2 u, 2
ut = utt = ut +
u,
2 u,
f (u) =
Common for all: relates various derivatives of unknown functions These are all continous quantities, which cannot be represented on a computer we need discrete quantities.
Computing Derivatives
Question: How do we compute the derivative of a given function f (x) on a computer? Consider the denition of the derivative:
f (x) = lim f (x + h) f (x) . h0 h
This is a forward nite difference. Clearly h must be small for this to be a good approximation
INF2340 / Spring 2005 p.
Finite differences
Rigorous derivation from MacLoren series:
h2 f (x + h) = f (x) + hf (x) + f (), 2
where M depends on f . We call the approximation rst order since the error is O(h).
INF2340 / Spring 2005 p.
which also are rst order: | f (x)f (xh) f (x)| M h. h We can also derive central differences
f (x + h) f (x h) f (x) 2h
+ O(h2 ) + O(h3 )
f (x) =
....
+ O(h4 )
Graphical interpretation
discrete points
slopes
N 8 16 32 64 128 256
where the error is bounded by |eh (x)| supx |f (4) (x)|h2 /12.
f (x + h) f (x) h f (x + h) 2f (x) + f (x h) = h2
f (x)f (xh) h
f (x+h)f (x)
f (x)f (xh) h
f (x+h)f (x) h
f (x)f (xh) h
Higher-order approximation:
f (x + 2h) + 16f (x) 30f (x) + 16f (x h) f (x 2h) f (x) = +O(h4 ) 12h2