NM Chapter 6

Download as pdf or txt
Download as pdf or txt
You are on page 1of 72

Solution of Ordinary

Differential Equations
Chapter 6
Introduction to Differential Equations
• Mathematical models which describe the state of system are often
expressed interms of not only certain system parmameters but also
their derivatives.
• Such mathematial models which use differential calculus to express
relationship between variables are known as Differential Equations
Ordinary Differential Equation
• If there is only one independent variable, the equation is called an
ordinary differential equation

Partial Differential Equation


• If it contains two or more independent variable, the derivative will be
partial and therefore the equation is called partial differential
equation
Order of Equations
• The order of a differential equation is the highest derivative that
appears in the equation

Degree of Equations
• The degree of a differential equation is the power of the highest order
derivative
Types of Problem
a) Initial Value Problem
If all the conditions are specified at a particular value of the
independent variable (say x = x0), then the problem is called an initial
value problem.

b) Boundary Value Problem


If all the conditions are not specified at the same point of the
independent variable , then the problem is said to be boundary value
problem.
Solution of Ordinary Differential Equations
Taylor Series Method
Example
Eulers Method (1st Order RK method)
• Eulers method is the simplest one-step method and has a limited
application because of its low accuracy.
• However it is discussed here as it serves as a starting point of all other
advanced methods.
• It uses only the first two terms of the Taylor Series.
Notes on Eulers method
• This does not involve any derivative
• The new value is obtained by extrapolating linearly over the step size
“h” using. The slope at its previous value.
• New value = Old Value + Slope * Step Size
Example Eulers Method
Example 2 Eulers Method
HEUN’s Method (Modified Eulers Method)
(2nd Order RK Method)
• Although Euler’s Method is the simplest of all one-step methods and
doesnot require any differentiation and is easy to implement.
• However, its major weakness is large truncation errors. ( Refer to
Balagurusamy Book for Accuracy of Eulers Method)
• Heun’s method is an improvement to Euler’s Method.
• It uses the average of two slopes one at initial point and one at the
next step calculated using the predicted value of yi+1 Calculated using
Eulers method.
Heun’s Method
Example Heuns Method
Practice Question
Runge – Kutta Methods
• Runge- Kutta methods are known by their order.
• For Instance, an RK method is called r – order RK method when slopes
at “r” points are used to construct the weighted average slope m.
• Euler’s method is a first order RK method as it uses only one slope at
(xi,yi)
• Heun’s method is called a second order RK method as it employs
slope at two end points of the interval.
• As it was demonstrated by the Euler and Heun methods, higher the
order, better would be the accuracy of the estimates.
• So fourth order RK method was developed
Fourth order Runge Kutta Method (RK-4
Method)
• This is the most commonly used Runge – Kutta Method .
• It uses slopes at 4 points and takes the weighted average
Practice Question
Algorithm RK-2 (Huen’s Method) (Modified
Eulers Mehtod)
STEP 1: Start
STEP 2: Define a differential equation f(x,y)
STEP 3: Input initial condition xo,yo and step size h
STEP 4: Input xn where functional value is required
STEP 5: Compute n = (xn – x0 )/h
STEP 6: For i = 1 to n do step 7
STEP 7: m1 = f(xo,yo)
m2 = f(xo + h , yo +m1*h)
m = (m1 + m2 )/2
y1 = yo + m * h
x1= x0 +h
x0 = x1
y0 = y1
STEP 8: Display the functional value at xn is “yo”
STEP 9: Stop
Algorithm of RK-4
STEP 1: Start
STEP 2: Define a differential equation f(x,y)
STEP 3: Input initial condition xo,yo and step size h
STEP 4: Input xn where functional value is required
STEP 5: Compute n = (xn – x0 )/h
STEP 6: For i = 1 to n do step 7
STEP 7: m1 = f(xo,yo)
m2 = f((xo + h/2) , (yo +m1*h/2))
m3 = f((xo + h/2) , (yo +m2*h/2))
m4 = f((xo +h) , (yo +m3*h))
m = (m1 +2m2 +2m3 +m4 )/6
y1 = yo + m * h
x1= x0 +h
x0 = x1
y0 = y1
STEP 8: Display the functional value at xn is “yo”
STEP 9: Stop
Higher Order Differential Equations
Using RK-4 Method
Practice Question

Answer:
y(0.1) = 1.0003
y’(0.1) = 0.01
Picard’s Method Example
Boundary Value Problems (BVP’S)
• In IVP’s(Initial value problems) all initial conditions of higher order differential
equaitons are specified at one point x = x0
• Specifying initial conditions at one point only donot give sufficient information about
the physical problems described by the differential equations.
• They are specified at different points in the interval (a,b) and therefore such
problems are called boundary value problems.
• For instance, Given :

• We are interested in finding the values of y in the range a ≤ 𝑥 ≤ 𝑏


• There are two popular methods available for solving the boundary value problem
• Finite Difference method
• Shooting method
Finite Difference Method
• In this method, the derivatives appearing in the differential equation
and the boundary conditions are replaced by their finite difference
approximation.
• This results in linear system of equations.
• The linear equations can be solved by any standard procedure.
Formula derivaiton of Finite Difference
Method
Example : Finite Difference Method
Practice Question
Shooting Method
• In this method, the boundary value problem is first converted into an
equivalent initial value problem and then solved using any method
(RK-1, RK-2, RK-4)
• In order to solve this as an initial value problem, we need two
conditions at x = a .
• But we have only y(a) = A
• So let z(a) = M1 (Where M1 represents slope at x = a)
Assumption is made that the
value of M and B are linearly
related to use two point
formula
Example : Shooting Method
This gives B1 = 7.75 which is less than B = 9 i.e. y(2) = 9
This gives B1 = 9.75 which is greater than B = 9 i.e. y(2) = 9

You might also like