0% found this document useful (0 votes)
16 views30 pages

Maths Unit 3,4,5

The document discusses the numerical solutions of ordinary differential equations (ODEs), emphasizing their importance in engineering and physical phenomena. It covers various methods such as Taylor Series, Euler's Method, Modified Euler's Method, and the Runge-Kutta method, providing examples and error analysis for each. Additionally, it highlights the applications of these methods in fields like hydrology, chemistry, and electronic engineering.

Uploaded by

Abhinavv
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views30 pages

Maths Unit 3,4,5

The document discusses the numerical solutions of ordinary differential equations (ODEs), emphasizing their importance in engineering and physical phenomena. It covers various methods such as Taylor Series, Euler's Method, Modified Euler's Method, and the Runge-Kutta method, providing examples and error analysis for each. Additionally, it highlights the applications of these methods in fields like hydrology, chemistry, and electronic engineering.

Uploaded by

Abhinavv
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 30

Unit-IV

Numerical Solution of

Ordinary Differential Equations


INTRODUCTION

• Equations which are composed of an unknown


function and its derivatives are called differential
equations.

• It becomes an initial value problem when the original


solution is to be found, given the initial condition.

2
Differential equations play a fundamental role in

engineering because many physical phenomena are

best formulated mathematically in terms of their rate of

change.
• When a function involves one dependent variable, the

equation is called an ordinary differential equation (or

ODE). A partial differential equation (or PDE)

involves two or more independent variables.


• Differential equations are also classified as to their
order.
– A first order equation includes a first derivative as
its highest derivative.
– A second order equation includes a second
derivative, as its highest derivative.
• Higher order equations can be reduced to a system of
first order equations, by redefining a variable.
Single-step method: calculation at current

step only uses value at last step (yn → yn+1).

Multi-step method: calculation at current step

uses values at several previous steps.


Types of Errors :

Absolute error : is the numerical difference between


the true value and approximate value of a quantity.

Truncation errors: They are caused by using


approximate results or on replacing an infinite process
by a finite one.
• Round off errors : They arise when a calculated

figure is rounded off to a fixed number of digits to

represent the exact figure, the difference between

such rounded figure and exact figure is called

round off error.


Taylor Series Method

The method gives a straightforward adaptation of

classic calculus to develop the solution of the infinite

series. It is a powerful single step method used to find

the successive derivative easily. It is useful for finding

the starting values for powerful method like Runge-

kutta method, Milne's method .


Example 1:
Solve the initial value problem y' = -2xy2, y(0) = 1 for
y at x = 1 with step length 0.2 using Taylor series
method of order .
Solution:
Given y' = f(x,y) = -2xy2 , y'' = -2y2 - 4xyy'
y''' = -8yy' - 4xy'2 - 4xyy''
yiv = -12y'2 - 12yy'' - 12xy'y'' - 4xyy'''
yv = -48y'y'' - 16yy''' -12xy''2 - 16xy'y''' - 4xyyiv
The fourth order Taylor's formula is

y(xi+h) = y(xi) + h y'(xi, yi) + h2 y''(xi, yi)/2!

+ h3 y'''(xi, yi)/3! + h4 yiv(xi, yi)/4! + . . .


given at x=0, y=1 and with h =0 .2 we have
y' = -2(0)(1)2 = 0.0
y'' = -2(1)2 - 4(0)(1)(0) = -2
y''' = -8(1)(0) - 4(0)(0)2 - 4(0)(1)(-2) = 0.0
yiv = -12(0)2 - 12(1)(-2) - 12(0)(0)(-2) - 4(0)(1)(0) = 24
y(0.2) = 1 + .2 (0) + .22 (-2)/2! + 0 + .24 (24)/4! = .9615
now at x = .2 we have y = .9615
y' = -0.3699, y'' = -1.5648, y''' = 3.9397
and yiv = 11.9953 then

y(0.4) = 1 + .2 (-.3699) + .22 (-1.5648)/2! +

.23(3.9397)/3! + .24 (11.9953)/4! = 0.8624

y(0.6) = 1 + .2 (-.5950) + .22 (-0.6665)/2! + .23

(4.4579)/3! + .24 (-5.4051)/4! = 0.7356


y(0.8) = 1 + .2 (-.6494) + .22 (-0.0642)/2! + .23

(2.6963)/3! + .24 (-10.0879)/4! = 0.6100

y(1.0) = 1 + .2 (-.5953) + .22 (-0.4178)/2! + .23

(0.9553)/3! + .24 (-6.7878)/4! = 0.5001

now at x = 1.0 we have y = .5001,which is the required

solution
Euler’s Method and Modified Euler’s Method

The Taylor –series method may be difficult to


apply if the derivatives become complicated and in
this case, it is difficult to determine the error.
The error in a Taylor series will be small if the step
size h is small. In fact, if we make h small enough,
we may only need a few terms of Taylors series
expansion for good accuracy.

In Euler’s method if h is small, the method is too


slow and if h is large, it gives in accurate value .
It is one of the oldest method.
Euler method Formula: yi+1 = yi+ h f(xi, yi)

Improved Euler Formula :

yi+1 = yi + ½ h [f (xi, yi) + f (xi + h, yi + hf (xi, yi)) ]

Example 2: Find y(1.0) accurate up to four


decimal places using Improved Euler's method by
solving the IVP y' = -2xy2, y(0) = 1 with step
length 0.2.
Solution: f(x, y) = -2xy2

y' = -2×x×y×y, y[0.0] = 1.0 with h = 0.2

Given

y[0.0] = 1.0

Euler Solution: y(1) = y(0) + h× (-2×x×y×y)(1)

y[0.20] = 1.0
Modified Euler iterations:

y(1) = y(0) + 0.5 × h ×((-2 × x × y × y)(0)

+ (-2 × x × y × y)(1)
y[0.20] = 1.0 y[0.20] = 0.95999

y[0.20] = 0.96313 y[0.20] = 0.96289

y[0.20] = 0.96291

Euler Solution:

y(2) = y(1) + h × (-2 × x × y × y)(2)


y[0.40] = 0.88873
Modified Euler iterations:

y(2) = y(1) +0.5 × h × ((-2 × x × y × y)(1)

+ (-2 × x × y × y)(2)
y[0.40] = 0.88873 y[0.40] = 0.86263
y[0.40] = 0.86629 y[0.40] = 0.86578
y[0.40] = 0.86585

Euler Solution:

y(3) = y(2) + h ×(-2 × x × y × y)(3)


y[0.60] = 0.74589
Modified Euler iterations:

y(3) = y(2) + .5 × h × ((-2 × x × y × y)(2)

+ (-2 × x × y × y)(3)
y[0.60] = 0.74589 y[0.60] = 0.73910
y[0.60] = 0.74031 y[0.60] = 0.74010
y[0.60] = 0.74014

Euler Solution:

y(4) = y(3) + h × (-2 × x × y × y)(4)


y[0.80] = 0.60866
Modified Euler iterations:

y(4) = y(3) + .5 × h ×((-2 × x × y × y)(3)

+ (-2 × x × y × y)(4)
y[0.80] = 0.60866 y[0.80] = 0.61512
y[0.80] = 0.61385 y[0.80] = 0.61410
y[0.80] = 0.61405

Euler Solution:

y(5) = y(4) + h ×(-2 × x × y × y)(5)


y[1.00] = 0.49340
Modified Euler iterations:

y(5) = y(4) + .5 × h ×((-2 × x × y × y)(4)

+ (-2 × x × y × y)(5)
y[1.00] = 0.49340

y[1.00] = 0.50504
y[1.00] = 0.50272

y[1.00] = 0.50318
y[1.00] = 0.50309

y[1.00] = 0.50311
Runge -Kutta method

• Runge -Kutta methods generate an accurate solution


without the need to calculate high order derivatives.

• Second order Runge-Kutta method have local


truncation error of order O(h3) and global truncation
error of order O(h2).

• Higher order Runge-Kutta method have better local


and global truncation errors.
4th Order Runge-Kutta Formula:
k1 = f ( xi , yi )
h 1
k2 = f ( xi + , yi + k1h )
2 2
h 1
k3 = f ( xi + , yi + k2h )
2 2
k4 = f ( xi + h, yi + k3h )

yi +1 = yi + (k1 + 2k2 + 2k3 + k4 )


h
6
5 4
Local error is O ( h ) and global error is O ( h )
Example 3 :
dy
= 1 + y + x 2 , y( 0 ) = 0.5
dx
Use Runge − Kutta method to find y( 0.2 ), y( 0.4 )

Solution:
Step 1:
h = 0.2, f(x,y) = 1 + y + x 2 , x0 = 0, y0 = 0.5
k1 = f ( x0 , y0 ) = ( 1 + y0 + x0 ) = 1.5
2

1 1
k 2 = f ( x0 + h , y0 + k1 h )
2 2
= 1 + ( y0 + 0.15) + ( x0 + 0.1) = 1.64
2

1 1
k 3 = f ( x0 + h , y 0 + k 2 h )
2 2
= 1 + ( y0 + 0.164 ) + ( x0 + 0.1) = 1.654
2

k 4 = f ( x0 + h , y 0 + k 3 h )
= 1 + ( y0 + 0.16545) + ( x0 + 0.2 ) = 1.7908
2

h
y1 = y0 + (k1 + 2k 2 + 2k 3 + k 4 ) = 0.8293
6
Step 2:

h = 0.2, f ( x , y ) = 1 + y + x 2 , x1 = 0.2 , y1 = 0.8293

k1 = f ( x1 , y1 ) = 1.7893
1 1
k 2 = f ( x1 + h , y1 + k1 h ) = 1.9182
2 2
1 1
k 3 = f ( x1 + h , y1 + k 2 h ) = 1.9311
2 2
k 4 = f ( x1 + h , y1 + k 3 h ) = 2.0555
0.2
y 2 = y1 + (k1 + 2k 2 + 2k3 + k4 ) = 1.2141
6
Summary of the solution :

xi yi
0.0 0.5
0.2 0.8293
0.4 1.2141
Applications

Runge - Kutta method is applied in many


chemical and biological settings.
In hydrology , equations of this type model the
transport and fate of adsorbing contaminants and
microbe-nutrient systems in groundwater.
In chemistry , this equation can stimulate the air
pollution in environmental cases.
Adams–Bashforth scheme used in modeling the
population dynamics in erbium-doped fiber
amplifiers and lasers based on highly doped fibers.
Euler method is used to find the salt
concentration in chemical Engineering and to find
the voltage across the capacitor in electronic
Engineering.

You might also like