Beruflich Dokumente
Kultur Dokumente
Exercise #6
( )
en ( h ) = O h 3
Answer:
y ( t n ) 2 y( 3) ( t n ) 3
y ( t n +1 ) = y ( t n + h ) = y ( t n ) + y ( t n ) h +
h +
h +
2
6
y ( t n 1 ) = y ( t n h ) = y ( t n ) y ( t n ) h +
y ( t n ) 2 y( 3) ( t n ) 3
h
h +
2
6
en ( h ) = y ( t n +1 ) y ( t n 1 ) 2h F ( y ( t n ) , t n )
=2
y( 3) ( t n )
6
h3 =
y( 3) ( t n )
3
h3
y n+1 = y n +
h
( F ( y n,t n ) + F ( y n+1,tn +1))
2
( )
en ( h ) = O h 3
Answer:
We use F y ( t n ) , t n = y ( t n ) and F y ( t n +1 ) , t n +1 = y ( t n +1 )
-1-
y ( t n +1 ) = y ( t n + h ) = y ( t n ) + y ( t n ) h +
y ( t n )
2
y ( t n +1 ) = y ( t n + h ) = y ( t n ) + y ( t n ) h +
h +
2
y( 3) ( t n )
2
y( 3) ( t n )
6
h3 +
h2 +
h
F ( y ( t n ) , t n ) + F ( y ( t n +1 ) , t n +1 )
2
y( 3) ( t n ) 2
y ( t n ) 2 y( 3) ( t n ) 3 h
= y ( t n ) h +
h +
h y ( t n ) + y ( t n ) + y ( t n ) h +
h
2
2
6
2
1 ( 3)
1 1
= y( 3) ( t n ) h 3 =
y (tn ) h 3
12
6 4
3. Convert y + (1 + y 2 ) y + 2y = cos(3t) to a first order ODE system.
Answer:
We treat y(t) and v(t) = y(t) as unknowns.
y ( t ) = v ( t )
v ( t ) = y ( t ) = cos ( 3t ) 1 + y 2 ( t ) v ( t ) 2y ( t )
==>
v (t )
d y ( t )
=
dt v ( t ) cos ( 3t ) 1 + y 2 ( t ) v ( t ) 2y ( t )
4. Consider the model ODE y = y , > 0 . The exact solution is given by y (t ) = y (0) e t .
The exact solution satisfies
y (t ) 0 as t
Suppose we use the Euler method to solve y = y . What condition does the step size h
have to satisfy to ensure that yn be bounded as n ?
-2-
Suppose we use the backward Euler method to solve y = y . What condition does the
step size h have to satisfy to ensure that yn be bounded as n ?
Answer:
For the Euler method, to ensure that yn be bounded as n , the time step h has to satisfy
h
2
))
y = y sin 1 + x 2 ,
y ( 0 ) = 0
= 1012
2
.
N=
10
10
= 5 = 5 1012 = 5 Trillion steps
2
h
( x1, y1 ) , ( x2 , y2 )
Let p(x) be the linear function that goes through these 2 points.
p ( x1 ) = y1 ,
p ( x2 ) = y2
c1 ( x ) =
==>
x x2
,
x1 x2
c2 ( x ) =
x x1
x2 x1
p ( x ) = y1c1 ( x ) + y2 c2 ( x )
=
y2 ( x x1 ) + y1 ( x2 x )
x2 x1
y2 y1
x2 x1
p ( x ) =
( h, y1 ) , ( 0, y2 ) , ( h, y3 )
Let p(x) be the quadratic polynomial that goes through these 3 points.
p ( h ) = y1 ,
p ( 0 ) = y2 ,
p ( h ) = y2
( x x2 ) ( x x 3 ) = x 2 x h
( x1 x2 ) ( x1 x3 ) 2h 2
c2 ( x ) =
( x x1 ) ( x x3 ) = h 2 x 2
h2
( x2 x1 ) ( x2 x3 )
c3 ( x ) =
( x x1 ) ( x x2 ) = x 2 + x h
( x3 x1 ) ( x3 x2 ) 2h 2
==>
p ( x ) = y1c1 ( x ) + y2 c2 ( x ) + y3c3 ( x )
=
y1 x 2 x h + y2 2h 2 2x 2 + y3 x 2 + x h
p ( x ) =
2h
y1 2y2 + y3
h2
-4-
2
What is the period of sin x ?
5
Answer:
The period of sin(x) is 2.
==>
2
2
sin x + 2 = sin x
5
5
==>
2
2
sin x + = sin x
5
5
5
==>
2
The period of sin x is period of .
5
5
-5-