You may use a formula sheet: version in pdf format .
Answers:
h
/
| 1 dx = h = w1 + w2 + w3
/
0
h 2
/ h
| x dx = --- = w1 (-h) + w2 0 + w3 h
/ 2
0
h 3
/ 2 h 2 2
| x dx = --- = w1 (-h) + w2 0 + w3 h
/ 3
0
The solution
-1 +8 +5
w1 = ---- h w2 = ---- h w3 = ---- h
12 12 12
defines the three point Adams-Moulton method:
h ( ( ) ( ) ( ) )
y = y + --- ( - f ( x , y ) + 8 f ( x , y ) + 5 f ( x , y ) )
n+1 n 12 ( ( n-1 n-1 ) ( n n ) ( n+1 n+1 ) )
(4)
f (a)
--------- (x - h) ( x - 0 ) ( x - (-h) ), for some a in [-h,+h].
4!
Integrating this error over [0,+h] gives
(4) h (4) 4 2
f (a) / 3 2 f (a) ( h 2 h ) 4
--------- | x - h x dx = --------- ( --- - h --- ) = O(h )
4! / 4! ( 4 2 )
0
Thus we derived a method whose local error is O(h^4) and we can write
h ( ) 4
y(x ) = y + ---- ( - f + 8 f + 5 f ) + O(h )
n+1 n 12 ( n-1 n n+1 )
The global error is O(h^3) and therefore we speak of a third-order method.
Hint:
Note that we must apply a third-order Runge-Kutta method to get started. This problem is analoguous to what we did in Lecture 37, except for that f is now a system: for every x you have y(x) and y'(x).
Answers:
Euler's method on this problem amounts to y(n+1) = (1+lambda*h)*y(n). In order for the method to converge for negative lambda, y(n) must go to zero, or equivalently |1 + lambda*h| < 1. This leads to the upper bound 2/(-lambda) for h.
For the modified Euler's method, we find
(1+lambda*h/2)
y(n+1) = ---------------- y(n)
(1-lambda*h/2)
Here we derive no constraint on h, other than the trivial condition
h>0.
y" - 2 x y = x^3, y(0) = 1, y(1) = -1.
With the shooting method we translate this problem into
initial-value problems.
Answers:
p(1) = 3.12767 p(-1) = -0.320365
z - 1 z + 1
p(z) = ------- (-0.320365) + ------- 3.12767
-1 - 1 1 + 1
= 1.72402 z + 1.40365
p(z) = -1 => z = -1.39422
y" + x y' = x^2, y(0) = 1, y(1) = -1.
With finite-difference approximations we translate this problem
into a linear system.
Partial Answers:
1 ( ) 1 ( )
y" = ----- ( y - 2 y + y ) y' = ----- ( y - y )
i h^2 ( i+1 i i-1 ) i 2 h ( i+1 i-1 )
The the equation above becomes (after multiplication with h^2):
h ( ) 2 2
y - 2 y + y + x --- ( y - y ) = x h
i+1 i i-1 i 2 ( i+1 i-1 ) i
or equivalently:
( h ) ( h ) 2 2 ( 1 + x --- ) y - 2 y + ( 1 - x --- ) y = x h ( i 2 ) i+1 i ( i 2 ) i-1 iWith the values for y given at the boundary, we have four unknown values for y, we call them y1, y2, y3, y4, with corresponding values for x at x1 = 0.2, x2 = 0.4, x3 = x.6, and x4 = 0.8. The linear system we have to solve is the following:
[ -2 1+0.2*0.1 0 0 ][ y1 ] [ 0.2^2 - (1-0.2*0.1)*1 ] [ ][ ] [ ] [ 1-0.4*0.1 -2 1+0.4*01 0 ][ y2 ] [ 0.4^2 ] [ ][ ] = .2^2 [ ] [ 0 1-0.6*0.1 -2 1+0.6*0.1 ][ y3 ] [ 0.6^2 ] [ ][ ] [ ] [ 0 0 1-0.8*01 -2 ][ y4 ] [ 0.8^2 - (1+0.8*0.1)(-1)]
y(0+h) - y(0-h) y1 - y(-1)
y'(0) = ----------------- = ------------
2h 2h
so we find y(-1) = y1 - 2*h*y'(0).
y(1+h) - y(1-h) y6 - y4
y'(1) = ----------------- = ---------
2h 2h
so we find y6 = y4 + 2*h*y'(1).
y" - 3 y' + 2k^2 y = 0, y(0) = 0, y(1) = 0.
With finite-difference approximations we translate this
problem into an eigenvalue problem.
Answers:
1 ( ) 1 ( )
y" = ----- ( y - 2 y + y ) y' = ----- ( y - y )
i h^2 ( i+1 i i-1 ) i 2 h ( i+1 i-1 )
The the equation above becomes (after multiplication with h^2):
y - 2 y + y - 3/2 h y + 3/2 h y + 2 k^2 h^2 y = 0
i+1 i i-1 i+1 i-1 i
or equivalently:
(3h/2-1) y + 2 y - (3h/2+1) y = 2 k^2 h^2 y
i+1 i i-1 i
With h = 0.2, we have four internal points inside [0,1], we call
them y1,y2,y3,and y3. Thus we must solve
[ 2 3h/2-1 0 0 ] [ y1 ] [ y1 ]
[ ] [ ] [ ]
[ -3h/2-1 2 3h/2-1 0 ] [ y2 ] [ y2 ]
[ ] [ ] = 2 k^2 h^2 [ ]
[ 0 -3h/2-1 2 3h/2-1 ] [ y3 ] [ y3 ]
[ ] [ ] [ ]
[ 0 0 -3h/2-1 2 ] [ y4 ] [ y4 ]
Setting lambda = 2 k^2 h^2, the system above is an eigenvalue
problem which defines four eigenvalues and eigenvectors.
(A - 1 I) x(k+1) = x(k)
x(k+1) = x(k+1)/norm(x(k+1))
where I is the identity matrix.
FINAL EXAM is in BH 0309 on Monday 29 April 2002, from 1 till 3PM.