Professional Documents
Culture Documents
Differential Equations
CAAM 452
Spring 2005
Lecture 5
Summary of convergence checks for LMM and
one-step time stepping
Instructor: Tim Warburton
Today
m1
has roots which satisfy the root condition (all roots bounded
by 1, and if they have magnitude 1 must be simple roots).
CAAM 452 Spring 2005
AB cont
• For roots with |z|<1 we are sure that the method is stable.
What we wish to know is what values of mu*dt guarantee
this condition. We can think of this formula defining a map
between the (complex) plane of roots to the (complex) plane
of mu*dt
m 1
• Example AB3: z3 z 2
:
(23 z 2 -16 z 5) /12
z rei
z3 z2
:
(23 z 2 -16 z 5) /12
CAAM 452 Spring 2005
AB Accuracy
m s m
un1 un
m 0 m !
• For stability we required: m s
m
m 0 m !
1
rei
2 3
1 rei
2 3!
CAAM 452 Spring 2005
RK Accuracy
u u
c
t x
• We can also make the same choice for the spatial representation
at each discrete time level.
tn x
xm3 xm2 xm1 xm xm1 xm 2 xm3
tn x
xm3 xm2 xm1 xm xm1 xm 2 xm3
tn x
xm3 xm2 xm1 xm xm1 xm 2 xm3
tn x
xm3 xm2 xm1 xm xm1 xm 2 xm3
tn x
xm3 xm2 xm1 xm xm1 xm 2 xm3
tn x
xm3 xm2 xm1 xm xm1 xm 2 xm3
And many more combinations
CAAM 452 Spring 2005
Use Taylor’s Series
• Examples:
du dx 2 d 2u dx 3 d 3u *
3 m
u xm1 u xm dx xm 2 m
x x
dx 2! dx 3! dx
du dx 2 d 2u dx 3 d 3u **
3 m
u xm1 u xm dx xm 2 m
x x
dx 2! dx 3! dx
tn x
xm3 xm2 xm1 xm xm1 xm 2 xm3
du dx 2 d 2u dx 3 d 3u *
3 m
u xm1 u xm dx xm 2 m
x x
dx 2! dx 3! dx
tn x
xm3 xm2 xm1 xm xm1 xm 2 xm3
du u xm u xm1 dx d 2u dx 2 d 3u *
xm 2 m 3 m
x x
dx dx 2! dx 3! dx
tn x
xm3 xm2 xm1 xm xm1 xm 2 xm3
um1 um
um
dx
du dx d 2u dx 2 d 3u *
3 m
um xm 2 m
x x
dx 2! dx 3! dx
tn x
xm3 xm2 xm1 xm xm1 xm 2 xm3
du dx 2 d 2u dx3 d 3u dx 4 d 4u dx5 d 5u *
3 m 4 m 5 m
u xm1 u xm dx xm 2 m
x x x x
dx 2! dx 3! dx 4! dx 5! dx
du dx 2 d 2u dx3 d 3u dx 4 d 4u dx5 d 5u **
3 m 4 m 5 m
u xm1 u xm dx xm 2 m
x x x x
dx 2! dx 3! dx 4! dx 5! dx
• We obtain:
3 3
du 2dx d u
3 m
u xm1 u xm1 2dx xm x O dx 5
dx 3! dx
CAAM 452 Spring 2005
cont
um1 um1 du dx 2 d 3u
m 3 m
0um : x x O dx 4
2dx dx 3! dx
• i.e. the central differencing operator is second order
accurate in dx
dx
um1 um um um1
dx 2 dx 2
um1 2um um1
dx 2
du dx 2 d 2u dx 3 d 3u dx 4 d 4u *
u xm dx dx xm 2! dx 2 xm 3! dx 3 xm 4! dx 4 x m
1
2 2u xm
dx
du dx 2 d 2u dx 3 d 3u dx 4 d 4u **
4 m
u xm dx xm 2 m
x 3 m
x x
dx 2! dx 3! dx 4! dx
CAAM 452 Spring 2005
cont
du dx 2 d 2u dx 3 d 3u dx 4 d 4u *
u xm dx dx xm 2! dx 2 xm 3! dx 3 xm 4! dx 4 xm
1
um 2
2
2u xm
dx 2 2 3 3 4 4
du dx d u dx d u dx d u
4 m
u xm dx xm 2 m
x 3 m
x x
**
dx 2! dx 3! dx 4! dx
d 2u
2 xm O dx 2
dx
du dx d 2u dx 2 d 3u *
xm 2 m 3 m
um x x
dx 2! dx 3! dx
du dx d 2u dx 2 d 3u *
xm 2 m 3 m
um x x
dx 2! dx 3! dx
2
d u
2u m
dx 2 m
x O dx 2
du dx 2 d 3u
xm 3 m
0u m x O dx 4
dx 3! dx
du dx 2 d 3u
3 m
0um xm x O dx 4
We use: dx 3! dx
dx 2 d 2 du
1 2
3! dx dx
xm O dx 4
du dx 2 d 3u
3 m
0um xm x O dx 4
dx 3! dx
dx 2 2 du
1 xm O dx 4
3! dx
du
dx
xm
dx 2 2
3!
2 2
O dx 0 O dx u m O dx
4
du dx 2 2
dx
m
x
3!
u
0 m O dx 4
du dx 2 2
xm 0 0 um O dx 4
dx 3!
CAAM 452 Spring 2005
Example 2 cont
du dx 2 2
xm 0 0 um O dx 4
dx 3!
dx 2 2 um1 um1
1 O dx 4
3! 2dx
um1 um1 1
um2 um 2um1 2um1 um um2 O dx 4
2dx 3!2dx
1
um2 8um1 8um1 um2 O dx 4
12dx
• And we have a super difference formula for the
derivative which is 4th order accurate!
• What is the stencil for this formula ? (volunteer) CAAM 452 Spring 2005
Example 2 cont
• Becomes
u1 0 8 1 1 8 u1
u 8 0 8 1 1 u
2 2
u3 1 8 0 8 1 u3
1 8 0 8 1
d 1 1 8 0 8 1
dx 12dx
1 8 0 8 1
O dx 4
1 8 0 8 1
1 8 0 8 1
1 1 8 0 8
u10 8 1 1 8 0 u10
This is an identity (although we are a little fuzzy about the O(dx^4) term)
CAAM 452 Spring 2005
Some Notation
d
v cv
dt
• Noting our studies of the stability regions, the fact that all the
eigenvalues sit on the imaginary axis rules out
– Euler-Forward (unconditionally unstable)
– AB2 and RK2 (marginally stable)
CAAM 452 Spring 2005
cont
3cdt 3cdt
2dx i, 2dx i
v= 0 8 -1 0 0 0 0 0 1 -8
-8 0 8 -1 0 0 0 0 0 1
0 - 1.36603956377562i 1 -8 0 8 -1 0 0 0 0 0
0 - 1.17011114634479i 0 1 -8 0 8 -1 0 0 0 0
0 - 0.94222308910582i 0 0 1 -8 0 8 -1 0 0 0
0 - 0.62520425034077i 0 0 0 1 -8 0 8 -1 0 0
0 - 0.00000000000000i 0 0 0 0 1 -8 0 8 -1 0
0 + 0.00000000000000i 0 0 0 0 0 1 -8 0 8 -1
0 + 0.62520425034077i -1 0 0 0 0 0 1 -8 0 8
0 + 0.94222308910582i 8 -1 0 0 0 0 0 1 -8 0
0 + 1.17011114634479i
0 + 1.36603956377562i
• Taking the first derivative we achieve:
d i 2 x
2 i 2 x
e L
u
ˆ e L
dx
L
i 2 x
du 2
uˆ e L
dx L
0.0000 - 0.0000i
0.0000 + 0.0000i
• There is the +/-1.6639 in there. -0.0000 - 1.0000i
-0.0000 + 1.0000i
-0.0000 - 1.6639i
• More about this later. -0.0000 + 1.6639i
-0.0000 - 2.0000i
-0.0000 + 2.0000i
0.0000 - 2.9997i
0.0000 + 2.9997i
CAAM 452 Spring 2005
Using RK4
n
a dtf u cdtDu
n
n
b dtf u a / 2 cdtD u a / 2
n
n n
c dtf u b / 2 cdtD u b / 2
n
d dtf u c cdtD u c
n
n1 n 1
u u a 2b 2c d
6
To avoid confusion with subindices for the vector, we have
used super indices to represent the time level.
http://www.library.cornell.edu/nr/bookcpdf/c16-2.pdf
Use equations: 16.2.4 , 16.2.5, 16.2.6 with coefficients at the top of table
717 (Cash-Karp coefficients provided on the website)
du
Q1a) Solve cos t u 0 t 1
dt
u 0 1
Q1b) Estimate dtmax by concocting a Lipschitz constant for the right hand
side of the ODE.
Q1c) Solve 4 times, using (i) dt=dtmax (ii) dt=dtmax/2 (iii) dt=dtmax/5 (iv)
dt=dtmax/6At each time step estimate the error (using 16.2.7) and
compare with actual error (plot both on a graph, use log scale if
necessary).
CAAM 452 Spring 2005