MATH2310 – DE Lecture 5
Direction Fields:
Given a differential equation:
dy
=f (x , y )
dx
is on a rectangular region R=[ x min , x max ]×[ y ¿ ¿ min , y max ]¿ , then the direction field for
grid size ∆ x >0 , ∆ y >0 , is a plot of the vectors:
⃗
xj
( )(
x j +∆ x
yi ∆ x ∙ f ( x j , yi ) )
On grid points (x j , y i) that are spaced ∆ x and ∆ y apart.
Euler method:
Given ( t k , x k ) , the differential equation ẋ=f (t , x ) and a step size h> 0, each step in the
Euler method is to compute:
t k+1=t k +h
x k+1 =x k + hf (t k , x k )
Error:
Absolute error is given by:
e k =|approximation−actual value|=|x k −x( t k )|
Relative error is given by:
absolute error ek
rk = =
|actual value| |x (t k )|
Improved Euler method:
t k+1=t k +h
h
2( k k
x k+1 =x k + f ( t , x ) +f ( t k +h , x k + hf ( t k , x k ) ) )
Direction Fields:
Given a differential equation:
dy
=f (x , y )
dx
is on a rectangular region R=[ x min , x max ]×[ y ¿ ¿ min , y max ]¿ , then the direction field for
grid size ∆ x >0 , ∆ y >0 , is a plot of the vectors:
⃗
xj
( )(
x j +∆ x
yi ∆ x ∙ f ( x j , yi ) )
On grid points (x j , y i) that are spaced ∆ x and ∆ y apart.
Euler method:
Given ( t k , x k ) , the differential equation ẋ=f (t , x ) and a step size h> 0, each step in the
Euler method is to compute:
t k+1=t k +h
x k+1 =x k + hf (t k , x k )
Error:
Absolute error is given by:
e k =|approximation−actual value|=|x k −x( t k )|
Relative error is given by:
absolute error ek
rk = =
|actual value| |x (t k )|
Improved Euler method:
t k+1=t k +h
h
2( k k
x k+1 =x k + f ( t , x ) +f ( t k +h , x k + hf ( t k , x k ) ) )