You are on page 1of 4

CHE 374 Module # 6; Part 1 IVP, Euler’s , Midpoint and Heun’s Methods

Differential Equations
Differential Equation: An equation involving the derivatives or
differentials of the dependent variable

CHE 374 ODE (Ordinary Differential Equation)


Differential equation involving only one independent
Computational Methods in Engineering variable
e.g.
The falling object model derived in
Our introductory module

Differential Equations PDE (Partial Differential Equation)


Involving two or more independent variables

e.g.
 2T  2T  2T 1 T
   Unsteady state heat conduction
x 2 y 2 z 2  t In a 3D medium
1

Classification of ODE’s Linearity and Homogeneity


ODE’s may be classified according to their order, linearity and boundary The equation F  t , y, y, y,... y   0 (n)
conditions.

The Order of an ODE is the order of the highest derivative present


is said to be a linear function of y, y, y,... y ( n )
dy 1st order ODE, Linear if it can be written as an (t ) y ( n )  an 1 (t ) y ( n 1)  ....  a1 y (1) a0 y  g (t )
 ay  f ( x)
dx
where ai (t ), i  1, 2, 3,..., n and g (t ) are known functons of t

d 2 y dy diy
and y (i ) 
x2   2 y  sin( x) 2nd order ODE, Linear dt i
dx 2 dx If not in this form then it is NON-Linear

Also:
d3y d2y dy If g(t) = 0 == homogeneous
3
 a 2  by  dCos( x) 3rd order ODE, Non-Linear
dx dx dx If g(t) ≠0 == non-homogeneous

1
CHE 374 Module # 6; Part 1 IVP, Euler’s , Midpoint and Heun’s Methods

Boundary Conditions Solution of Initial value Problems


Initial Value Problem If the values of the dependent variable
(IVP):
Solve y  F (t , y ), y (a)  
or their derivatives are known at the
initial value of the independent variable General 1st order differential equation:
Boundary Value Problem The dependent variable or its derivative
(BVP): are is known at more than one point of y  f (t , y )
the independent variable
dy
Examples:
y  , f (t , y ) is a given function.
dt
y   y y (0)  1, y(0)  0 Is an IVP
The solution of this equation contains an arbitrary constant.
To find the constant we must know a point in the solution
y   y y (0)  1, y( )  0 Is a BVP vector. i.e., y must be specified at some value of t, say t=a

y (a)   Auxiliaryconditions.

Taylor Series Methods Euler’s method


Simple and capable of high accuracy When only one term is retained, the method is called
Truncated Taylor series expansion of y about t Euler’s method

1 1 1
y (t  h)  y (t )  y(t )h  y(t )h 2  y(t ) h3  ...  y ( m ) (t )h m
2! 3! n!
Predicts y at (t+h) from the information available
yi 1  yi  hf (ti , yi )  O ( h)
The last kept term in the series determines the order

1
Truncation error: e y ( m1) ( )h m 1 t  t h
 m  1!
The first derivative provides a
y ( m) (t  h)  y ( m ) (t )
Using finite difference approximation y ( m1) ( ) 
h direct estimate of the slope at t i
(forward difference): m
h
e  y ( m) (t  h)  y ( m ) (t ) 
We obtain a more useable form  m  1! 

2
CHE 374 Module # 6; Part 1 IVP, Euler’s , Midpoint and Heun’s Methods

Euler’s method Euler’s method


We have already see this in our
very first module.
y

h h

t t
i t n
i1

t n  to
h i  0,1, 2,... n interval [t0 , t n ]
n

Example Euler’s Method Example Euler’s Method


Use Euler’s method to integrate numerically:
dy
y y (0)  1 0  t  1.5
dt y1  y0  hf  t0 , y0   1.0  0.5(1)  1.5
From t=0 to t=1.5 using a step size of h=0.5 y 2  y1  hf  t1 , y1   1.5  0.5(1.5)  2.25
and initial condition at t=0, y=1
y3  y2  hf  t2 , y2   2.25  0.5(2.25)  3.375
t
Exact solution is : y (t )  e

Solution: Using Euler’s method


In the following graph, we compare the effect of changing the
yi 1  yi  hf (ti , yi )
step size h on the solution
 y (0.5)  y (0)  0.5  f (0,1)

3
CHE 374 Module # 6; Part 1 IVP, Euler’s , Midpoint and Heun’s Methods

The Midpoint Method – a modification of


Euler’s method

yi 1  yi  hf (tm , ym )
1
tm  ti  h
2
h
ym  f (ti , yi )
2

Heun's Method – Another modification


of Euler’s Method The Heun’s Method

h
yi 1  yi   f (ti , yi )  f (ti 1 , yi 1 )
2

You might also like