Professional Documents
Culture Documents
1 MAFE208IU-L11
1. Introduction to differential
equations
2 MAFE208IU-L11
Basic Concepts
A differential equation may involve derivatives of
higher-order, such as y’, y’’, y’’’, etc
We have I '( x) = e P ( x ) dx
P( x) = I ( x) P( x)
Multiply both sides the diff. eq. by I(x) to get
dy I ( x) y '( x) + I ( x) P( x) y = I ( x)Q( x)
+ P( x) y = Q( x)
dx I ( x) y '+ I '( x) y = I ( x)Q( x)
d
( I ( x) y ) = I ( x)Q( x)
dx
y=e
− P ( x ) dx
I ( x) y = I ( x)Q( x)dx
I ( x)Q( x)dx
4 MAFE208IU-L11
Separable Differential Equations
Differential equation of the form
dy f ( x)
= g ( y) y '( x) = f ( x)
dx g ( y )
is called a separable differential equation.
A separable differential equation can be solved by
integrating both sides. This method is known as
separation of variables
4𝑥 3
2) 𝑦′ = , 𝑥 > 1, 𝑦 1 =3
𝑦
3) 𝑦 ′ = sin(𝑥𝑦), 𝑥 > 0, 𝑦 0 =1
6 MAFE208IU-L11
2. One-step Methods
A class of methods
7 MAFE208IU-L11
Approximations of solution of DEs
b−a
xi = a + ih, i = 0,1, 2,..., N , h= : step size
N
8 MAFE208IU-L11
One-step Methods
For problem
dy
= f ( x, y ), a xb
dx
y (a) = y0
yi +1 = yi + h
9 1/24/2021
3. Euler’s method It is a one-
step method
y '( x) = f ( x, y( x)), y( x0 ) = y0
xi = x0 + ih, step size h 0, yi y( x i ), i = 0,1, 2,...
y ( xi + h) − y ( xi )
y '( xi ) = f ( xi , y ( xi ))
h
yi +1 − yi
= f ( xi , yi )
h
yi +1 = yi + h f ( xi , yi )
1/24/2021 10
Interpretation of Euler Method
y2
y1
y0
x0 x1 x2 x
11 MAFE208IU-L11
Interpretation of Euler Method
Slope=f(x0,y0)
y1
y1=y0+hf(x0,y0)
hf(x0,y0)
y0
x0 x1 x2 x
h
12 MAFE208IU-L11
Interpretation of Euler Method
y2 y2=y1+hf(x1,y1)
Slope=f(x1,y1)
hf(x1,y1)
Slope=f(x0,y0)
y1 y1=y0+hf(x0,y0)
hf(x0,y0)
y0
x0 x1 x2 x
h h
13 MAFE208IU-L11
Example
Find approximate values and the errors of the solution
of the initial-value problem
y ' = 3xy, 0 x 1/ 2, y(0) = 1
with step size h=0.1
Solution: Exact solution
y ' = 3xy y '/ y = 3x y '/ ydx = 3xdx
ln( y ) = 3 x 2 / 2 + C
Using initial condition:
ln( y (0)) = ln(1) = 0 = C
14
ln( y ) = 3 x / 2 y = e
2 3 x 2 /2
MAFE208IU-L11
f ( x, y ) = 3xy, h = 0.1
xi = 0 + ih = 0.1i, i = 0,1, 2,3, 4,5
y0 = y (0) = 1
yi +1 = yi + h f ( xi , yi ) = yi + 3hxi yi
0 1 1 0
0.1 1.01511 1 0.0151131
0.2 1.06184 1.03 0.0318365
0.3 1.14454 1.0918 0.0527368
0.4 1.27125 1.19006 0.0811872
0.5
15
1.45499 1.33287 0.122122 MAFE208IU-L12
Local truncation error
lim max1i N | yi − y ( xi ) |= 0
h →0
Taylor expansion
h2
y ( xi + h) = y ( xi ) + hy '( xi ) + y "( xi ) + O(h3 )
2
h2
= y( xi ) + hf ( xi , yi ) + f '( xi , yi ) + O( h3 )
2
where f '( xi , yi ) = f x ( xi , yi ) + f y ( xi , yi ) y '( xi ) = f x ( xi , yi ) + f y ( xi , yi ) f ( xi , yi )
h2
yi +1 = yi + hf ( xi , yi ) + [ f x ( xi , yi ) + f y ( xi , yi ) f ( xi , yi )]
2
18 MAFE208IU-L11
Example
Find approximate values and the errors of the
solution of the initial-value problem
y ' = y + 2 x + 1, 0 x 1/ 2, y (0) = 2
with step size h=0.1
h2
yi +1 = yi + hf ( xi , yi ) + [ f x ( xi , yi ) + f y ( xi , yi ) f ( xi , yi )]
19 2 MAFE208IU-L11
1
y ' = y + 2 x + 1, 0 x
2
y (0) = 2, h=0.1
Exact solution:
𝑦 = −2𝑥 − 3 + 5𝑒 𝑥
0 2 2 0 2 0
0.1 2.326 2.3 0.02585 2.325 0.0008546
0.2 2.707 2.65 0.05701 2.705 0.001889
0.3 3.149 3.055 0.09429 3.146 0.003131
0.4 3.659 3.52 0.1386 3.655 0.004613
0.5
20
4.244 4.053 0.1911 4.237 0.006373
MAFE208IU-L11
Exercise
Find approximate values and the errors of the
solution of the initial-value problem
y ' = −2 xy, 0 x 1,
with step size h=0.2, and initial condition y(0) = 3
21 MAFE208IU-L11
Homework Chapter 5
u (0) = 1, v(0) = 1, h = 1/ 4
23 MAFE208IU-L13
Homework Chapter 5
Problem 3: Find approximate solution of the following
Problem by
a) Euler’s method
b) Heun’s method
24 MAFE208IU-L13
Homework Chapter 5
Additional Problems:
Textbook, Page 752
Problems 25.1, 25.3, 25.4, 25.7
Deadline: 3 weeks
25 MAFE208IU-L12