Professional Documents
Culture Documents
1
Quiz 1 Results
• Mean: 70.6
• Standard deviation: 11.0
20
15
10
0
<50 50-59 60-69 70-79 80-89 >89
2
Recap
3
Recap
• Example:
• Use implicit Euler to solve:
dx
= x, x(0) = x0
dt
Give a closed form formula for the numerical solution
4
Recap
• Example:
• Use implicit Euler to solve:
dx
= x, x(0) = x0
dt
• Let:x = x(k t)
k
xk+1 = xk + t xk+1
1
xk+1 = xk
1 t t
✓ ◆k
1
xk = x0
1 t
• Stability:
2 2
|1 t | 1 ) (1 tRe ) + ( tIm ) 1 5
Recap
• Example:
• Use implicit Euler to solve:
dx
= x, x(0) = x0
dtxk+1 = xk + t xk+1
1
• Numerical
xk+1 =solution: xk
1 t
✓ ◆k
1
xk = x0
1 t
t
• Exact solution:
x k = x0 e k t
k 1 k+1
7
Multistep Methods
• Local accuracy of the leap frog method:
dx 1
= (x(tk+1 ) x(tk 1 )) + O(( t)2 ) = f (x(tk ), tk )
dt 2 t
3
x(tk+1 ) = x(tk 1 ) + 2 tf (x(tk ), tk ) + O(( t) )
• Stability of the leap frog method: dx
= x
dt
xk+1 = xk 1 + 2 t xk
✓ ◆ ✓ ◆✓ ◆
xk+1 2 t 1 xk
=
xk 1 0 xk 1
✓ ◆ ✓ ◆
xk+1 k x1
=C
xk x0
8
Multistep Methods
• Local accuracy of the leap frog method:
dx 1
= (x(tk+1 ) x(tk 1 )) + O(( t)2 ) = f (x(tk ), tk )
dt 2 t
3
x(tk+1 ) = x(tk 1 ) + 2 tf (x(tk ), tk ) + O(( t) )
• Stability of the leap frog method: dx
= x
dt
xk+1 = xk 1 + 2 t xk
✓ ◆ ✓ ◆
xk+1 k x1
=C
xk x0
✓ ◆
2 t 1
C=
1 0
What are the eigenvalues of this matrix? 9
Multistep Methods
• Local accuracy of the leap frog method:
dx 1
= (x(tk+1 ) x(tk 1 )) + O(( t)2 ) = f (x(tk ), tk )
dt 2 t
3
x(tk+1 ) = x(tk 1 ) + 2 tf (x(tk ), tk ) + O(( t) )
• Stability of the leap frog method: dx
= x
dt
xk+1 = xk 1 + 2 t xk
• Both eigenvalues of C must be bounded:
t
p i
| t ± ( t )2 + 1| 1
consider
| t ± 1| 1 when | t | ⌧ 1 :
| t ± 1| 1 | t |⌧1 i 10
Multistep Methods
• Exercise:
• Should I use the leap frog method to integrate the equations of
motion for a mass-spring system?
d2 x
m 2 = kx
dt
• If so, what time steps should I limit myself to?
• If not, what other integrator could I use?
11
Multistep Methods
• Exercise:
• Should I use the leap frog method to integrate the equations of
motion for a mass-spring system?
d2 x
m 2 = kx
dt
• Transform
✓ to◆system✓of first order ODEs:
◆✓ ◆
d v 0 k/m v
=
dt x 1 0 x
r
k
• Eigenvalues of matrix: = ±i
m
• Since eigenvalues are imaginary, leap frog is stable when:
r
m
t<
k 12
Multistep Methods
• Multistep methods can be implicit as well such as the backward
differentiation formulas or Adams-Moulton integrators.
13
Numerical Integration
• Consider the definite integral:
Z t f
f (⌧ )d⌧
t0
f (⌧ )d⌧
t0
Z tk
1
Pk (⌧ )d⌧ = (f (tk ) + 4f ((tk + tk 1 )/2) + f (tk 1 )) (tk tk 1)
tk 1
6
17
Numerical Integration
• Multidimensional integration:
• Of the sort: Z yU Z zU
f (y, z)dydz
yL zL
• For any number of dimensions larger than 3, this is best handled
with Monte Carlo methods
• Example:
18
Numerical Integration
• Improper integrals:
• Of the sort: Z 1
f (⌧ )d⌧
t0
• Can be split into two domains of integration
Z 1 Z tf Z 1
f (⌧ )d⌧ = f (⌧ )d⌧ + f (⌧ )d⌧
t0 t0 tf
• The first integral can be handled with ODE-IVP methods or
polynomial interpolation
20
MIT OpenCourseWare
httpV://ocw.mit.edu
For information about citing these materials or our Terms of Use, visit: httpV://ocw.mit.edu/terms.