Professional Documents
Culture Documents
ESS101-Modeling and Simulation: Paolo Falcone
ESS101-Modeling and Simulation: Paolo Falcone
Paolo Falcone
Department of Signals and Systems
Chalmers University of Technology
Gteborg, Sweden
October 3, 2015
Today (Chapters 4, 5)
October 3, 2015
October 3, 2015
xn+1 = xn + hx!n
En = O(h)
For TS(p)
1 i (i)
xn+1 = xn + h x n
i=1 i!
p
En = O(h )
October 3, 2015
Trapezoidal rule
x! (t + h) = x! (t) + h!!
x(t) + O(h 2 )
Substitute h!!
x(t) = x! (t + h) x! (t) + O(h 2 ) in
1 2
x(t + h) = x(t) + hx! (t) + h !!
x(t) + O(h 3 )
2!
1
xn+1 = xn + hx!n + h ( x!n+1 x!n )
2
1
= xn + h ( fn+1 + fn )
2
October 3, 2015
Trapezoidal rule
1
Note that in xn+1 = xn + h ( fn+1 + fn )
2
We need to calculate fn+1 = f (tn+1, xn+1 )
That is, xn+1 is on both left and right hand sides
We may not have an explicit expression of xn+1 as function
of the previous samples (implicit method)
October 3, 2015
x n +1 = G(t, x n k +1, x n k +2 ,, x n , x n +1 )
Implicit method
k-steps method
x n +1 = G(t, x n k +1, x n k +2 ,, x n , x n +1 )
This equation needs to be solved to find xn+1
Explicit method
x n +1 = G(t, x n k +1, x n k +2 ,, x n )
Paolo Falcone (CHALMERS)
October 3, 2015
x! (t + h) = x! (t) + h!!
x(t) + O(h 2 )
x! (t h) = x! (t) h!!
x(t) + O(h 2 )
The resulting iteration is
1
xn+1 = xn + hx!n + h ( x!n x!n1 )
2
1
= xn + h (3 fn fn1 )
2
Paolo Falcone (CHALMERS)
October 3, 2015
2
1 1
t
4 2
The iteration is
1
xn+2 = xn+1 + h (3 fn+1 fn )
2
1
= xn+1 + h 3 (1 2tn+1 ) xn+1 (1 2tn ) xn
2
Paolo Falcone (CHALMERS)
October 3, 2015
1
x2 = 1+ h (1 2h ) x1 h
2
Euler (ABE)
1
2. x1 = x0 + h (1 2t1 ) x1 + (1 2t0 ) x0
2
1+ 1 (1 2t0 )
2
x1 =
x0 Trapezoidal rule (ABT)
1 1 (1 2t1 )
2
Paolo Falcone (CHALMERS)
October 3, 2015
10
103GE@ t=1.2
En h
Paolo Falcone (CHALMERS)
October 3, 2015
11
More in general
October 3, 2015
12
Otherwise, it is inconsistent.
Example. The Euler method
The n-th iteration xn+1 = xn + hfn stems from
October 3, 2015
13
Example. Consistency
October 3, 2015
14
Example. Consistency
1 2
1 3 (4)
x! (t + h) = x! (t) + h!!
x(t) + h !!!
x (t) + h x (t) + O(h 4 )
2
6
October 3, 2015
15
Example. Consistency
After simplification
x(t + 2h) + 4x(t + h) 5x(t) h [ 4 x! (t + h) + 2 x! (t)] =
1 4 (4)
h x (t) + O(h 5 )
6
1 4 (4)
h x (t) is dominating and O(h 5 ) can be neglected
6
1 4 (4)
h x (t) = O(h 4 ) and the method is of order 3
6
October 3, 2015
16
(r) = r 2 + 1r + 0
(r) = 2 r 2 + 1r + 0
October 3, 2015
17
October 3, 2015
18
Example
October 3, 2015
19
Example
October 3, 2015
20
k-step methods
The two-step LMM
October 3, 2015
21
i=0
k
i
i=0
= 0, k = 1, and i i = i
i=0
i=0
October 3, 2015
22
Example
October 3, 2015
23
(r) = i r i , k = 1
i=0
October 3, 2015
24