0% found this document useful (0 votes)
101 views51 pages

Numerical Solution of Ordinary Differential Equations (Part - 1)

The document discusses numerical methods for solving ordinary differential equations of first and second order. It introduces Picard's method of successive approximations, which generates a sequence of approximations that converge to the solution. The method replaces the differential equation with an integral equation and iteratively improves the approximation by substituting the previous iterate into the right hand side. It is useful theoretically but limited in applications. Taylor series and single-step methods provide solutions as power series, while multi-step methods like Euler and Runge-Kutta compute solutions over a range of x-values in small steps. Initial and boundary value problems require conditions to determine constants in the general solution. Exercises are provided to apply Picard's method to sample equations.

Uploaded by

founè diassana
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)
101 views51 pages

Numerical Solution of Ordinary Differential Equations (Part - 1)

The document discusses numerical methods for solving ordinary differential equations of first and second order. It introduces Picard's method of successive approximations, which generates a sequence of approximations that converge to the solution. The method replaces the differential equation with an integral equation and iteratively improves the approximation by substituting the previous iterate into the right hand side. It is useful theoretically but limited in applications. Taylor series and single-step methods provide solutions as power series, while multi-step methods like Euler and Runge-Kutta compute solutions over a range of x-values in small steps. Initial and boundary value problems require conditions to determine constants in the general solution. Exercises are provided to apply Picard's method to sample equations.

Uploaded by

founè diassana
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/ 51

Numerical Solution of

Ordinary Differential Equations


(Part - 1)

P. Sam Johnson

May 3, 2020

Sam Johnson NIT Karnataka Mangaluru


Numerical
India
Solution of Ordinary Differential Equations (Part - 1) May 3, 2020 1/51
Overview

We discuss the following important methods of solving ordinary differential


equations of first / second order.

Picard’s method of successive approximations


(Method of successive integration)
Taylor’s series method
Euler’s method
Modified Euler’s method

Sam Johnson NIT Karnataka Mangaluru


Numerical
India
Solution of Ordinary Differential Equations (Part - 1) May 3, 2020 2/51
Introduction

A number of problems in science and technology can be formulated into


differential equations. The analytical methods of solving differential
equations are applicable only to a limited class of equations.

Quite often differential equations appearing in physical problems do not


belong to any of these familiar types and one is obliged to resort to
numerical methods. These methods are of even greater importance when
we realize that computing machines are now readily available which reduce
numerical work considerably.

Sam Johnson NIT Karnataka Mangaluru


Numerical
India
Solution of Ordinary Differential Equations (Part - 1) May 3, 2020 3/51
Solution of a Differential Equation

The solution of an ordinary differential equation means finding an explicit


expression for y in terms of a finite number of elementary functions of x.

Such a solution of a differential equation is known as the closed or finite


form of solution.

In the absence of such a solution, we have numerical methods to calculate


approximate solution.

Sam Johnson NIT Karnataka Mangaluru


Numerical
India
Solution of Ordinary Differential Equations (Part - 1) May 3, 2020 4/51
Numerical Solution of Ordinary Differential Equations of
First Order

Let us consider the first order differential equation


dy
= f (x, y ) given y (x0 ) = y0 (1)
dx
to study the various numerical methods of solving such equations.

In most of these methods, we replace the differential equation by a


difference equation and then solve it.

These methods yield solutions either as a power series in x from which


the values of y can be found by direct substitution or a set of values of x
and y .

Sam Johnson NIT Karnataka Mangaluru


Numerical
India
Solution of Ordinary Differential Equations (Part - 1) May 3, 2020 5/51
Single-step Methods

The methods of Picard and Taylor series belong to the former class of
solutions. In these methods, y in (1) is approximated by a truncated
series, each term of which is a function of x.

The information about the curve at one point is utilized and the solution is
not iterated.

As such, these are referred to as single-step methods.

Sam Johnson NIT Karnataka Mangaluru


Numerical
India
Solution of Ordinary Differential Equations (Part - 1) May 3, 2020 6/51
Step-by-step Methods

The methods of Euler, Runge-Kutta, Milne, Adams-Bashforth etc. belong


to the latter class of solutions.

In these methods, the next point on the curve is evaluated in short steps
ahead, by performing iterations till sufficient accuracy is achieved. As
such, these methods are called step-by-step methods.

Euler and Runge-Kutta methods are used for computing y over a limited
range of x-values whereas Milne and Adams methods may be applied for
finding y over a wider range of x-values.

Therefore Milne and Adams methods require starting values which are
found by Picard, Taylor series or Runge-Kutta method.

Sam Johnson NIT Karnataka Mangaluru


Numerical
India
Solution of Ordinary Differential Equations (Part - 1) May 3, 2020 7/51
Initial and Boundary Conditions

An ordinary differential equation of the nth order is of the form

dy d 2 y d ny
 
F x, y , , , ..., = 0.
dx dx 2 dx n

Its general solution contains n arbitrary constants and is of the form

φ(x, y , c1 , c2 , . . . , cn ) = 0.

Sam Johnson NIT Karnataka Mangaluru


Numerical
India
Solution of Ordinary Differential Equations (Part - 1) May 3, 2020 8/51
Initial / Boundary Value Problems

To obtain its particular solution, n conditions must be given so that the


constants c1 , c2 , . . . , cn can be determined.

If these conditions are prescribed at one point only (say, x0 ), then the
differential equation together with the conditions constitute an initial
value problem of the nth order.

If the conditions are prescribed at two or more points, then the problem is
termed as boundary value problem.

Sam Johnson NIT Karnataka Mangaluru


Numerical
India
Solution of Ordinary Differential Equations (Part - 1) May 3, 2020 9/51
Picard’s Method

Condier the first order differential equation


dy
= f (x, y ) given y (x0 ) = y0 . (2)
dx

It is required to find that particular solution of (2) which assumes the


values y0 when x = x0 .

Integrating (2) between limits, we get


Z y Z x Z x
dy = f (x, y ) dx ⇒ y = y0 + f (x, y ) dx.
y0 x0 x0

This is an integral equation equivalent to (2).

Sam Johnson NIT Karnataka Mangaluru


Numerical
India
Solution of Ordinary Differential Equations (Part - 1) May 3, 2020 10/51
Picard’s Method

As a first approximation y1 to the solution, we put y = y0 in f (x, y ) and


integrate (2), giving
Z x
y1 = y0 + f (x, y0 ) dx.
x0

For a second approximation


Rx y2 , we put y = y1 in f (x, y ) and integrate (2),
giving y2 = y0 + x0 f (x, y1 ) dx.

Continuing this process, we obtain y3 , y4 , . . . , yn , where


Z x
yn = y0 + f (x, yn−1 ) dx.
x0

Hence this method gives a sequence of approximations y1 , y2 , . . ., each


giving a better result than the preceding one.

Sam Johnson NIT Karnataka Mangaluru


Numerical
India
Solution of Ordinary Differential Equations (Part - 1) May 3, 2020 11/51
Picard’s Method

Picard’s method is of considerable theoretical value, but can be


applied only to a limited class of equations in which the successive
integrations can be performed easily.
The method can be extended to simultaneous equations and
equations of higher order.

Sam Johnson NIT Karnataka Mangaluru


Numerical
India
Solution of Ordinary Differential Equations (Part - 1) May 3, 2020 12/51
Exercises

1. Using Picard’s process of successive approximations, obtain a solution


upto the fifty approximation of the equation
dy
=y +x
dx
such that y = 1 when x = 0. Check your answer by finding the exact
particular solution.
2. Find the value of y for x = 0.1 by Picard’s method, given that
dy y −x
=
dx y +x
such that y = 1 when x = 0.

Sam Johnson NIT Karnataka Mangaluru


Numerical
India
Solution of Ordinary Differential Equations (Part - 1) May 3, 2020 13/51
Exercises

3. Solve for y (0.2) by Picard’s method,

dy
= y2 + x
dx
where y (0) = 0.
4. Use Picard’s method to approximate the value of y when x = 0.1
given that y (0) = 1 and dy 2
dx = 3x + y .
5. Find the solution of
dy
= 1 + xy
dx
which passes through (0, 1) in the interval (0, 0.5) such that the value
of y is correct to 3 decimal places. Use the whole interval as one
interval only and take h = 0.1.

Sam Johnson NIT Karnataka Mangaluru


Numerical
India
Solution of Ordinary Differential Equations (Part - 1) May 3, 2020 14/51
Exercises

6. Use Picard’s method to approximate y when x = 0.2 given that y = 1


when x = 0 and dy
dx = x − y .
7. Find an approximate solution of the initial value problem
y 0 = 1 + y 2 , y (0) = 0 by Picard’s method and compare with the
exact solution.
8. Find the successive approximate solution of the differential equation
y 0 = y , y (0) = 1, by Picard’s method and compare it with the exact
solution.
9. Given the differential equation

dy x2
= 2
dx y +1
with the initial condition y = 0 when x = 0. Use Picard’s method to
obtain y for 0.25, 0.5 and 1.0 correct to 3 decimal places.

Sam Johnson NIT Karnataka Mangaluru


Numerical
India
Solution of Ordinary Differential Equations (Part - 1) May 3, 2020 15/51
Solving Simultaneous First Order Differential Equations :
Picard’s Method

Consider the simultaneous differential equations of the type


dy
= f (x, y , z) (3)
dx
and
dz
= g (x, y , z) (4)
dx
with initial conditions y (x0 ) = y0 and z(x0 ) = z0 can be solved by Picard’s
method.

The first approximate solution of the equations (3) and (4) are given by
Z x
y1 = y0 + f (x, y0 , z0 )dx
x0
Z x
z1 = z0 + g (x, y0 , z0 )dx.
x0
Sam Johnson NIT Karnataka Mangaluru
Numerical
India
Solution of Ordinary Differential Equations (Part - 1) May 3, 2020 16/51
Solving Simultaneous First Order Differential Equations :
Picard’s Method

Similarly, the higher approximations of y and z are given as follows:


Z x Z x
y2 = y0 + f (x, y1 , z1 )dx, z2 = z0 + g (x, y1 , z1 )dx
x0 x0
Z x Z x
y3 = y0 + f (x, y2 , z2 )dx, z3 = z0 + g (x, y2 , z2 )dx
x0 x0

and so on.

Sam Johnson NIT Karnataka Mangaluru


Numerical
India
Solution of Ordinary Differential Equations (Part - 1) May 3, 2020 17/51
Exercises

10. Apply Picard’s method to find the second approximations to the


values of y and z by corresponding to x = 0.1 given that
dy dz
= z, = x 3 (y + z)
dx dx
1
given that y = 1, z = 2 when x = 0.
11. Approximate y and z by using Picard’s method for the particular
solution of
dy dz
= x + z, = x − y2
dx dx
given that y = 2, z = 1 when x = 0.

Sam Johnson NIT Karnataka Mangaluru


Numerical
India
Solution of Ordinary Differential Equations (Part - 1) May 3, 2020 18/51
Exercises

12. Approximate y and z by using Picard’s method for the particular


solution of
dy dz
= 1 + xyz, =x +y +z
dx dx
given that y = 0, z = 1 when x = 0.

Sam Johnson NIT Karnataka Mangaluru


Numerical
India
Solution of Ordinary Differential Equations (Part - 1) May 3, 2020 19/51
Solving Second / Higher Order Differential Equations :
Picard’s Method

Consider a second order differential equation

d 2y
 
dy
= f x, y , .
dx 2 dx

Let z = dy
dx . Hence the given equation can be reduced to 2 first order
simultaneous differential equations
dy
= z
dx
and
dz
= f (x, y , z).
dx

Sam Johnson NIT Karnataka Mangaluru


Numerical
India
Solution of Ordinary Differential Equations (Part - 1) May 3, 2020 20/51
Exercises

13. Use Picard’s method to approximate y when x = 0.2 given that


y = 1, y 0 = 0 when x = 0 and

y 00 = y + xy 0 .

14. Using Picard’s method, obtain the second approximation to the


solution at x = 0.2 of the differential equation

d 2y dy
2
= x3 + x 3y
dx dx
with y (0) = 1, y 0 (0) = 1/2.

Sam Johnson NIT Karnataka Mangaluru


Numerical
India
Solution of Ordinary Differential Equations (Part - 1) May 3, 2020 21/51
Taylor’s Series Method

Consider the first order differential equation


dy
= f (x, y ) given y (x0 ) = y0 . (5)
dx
Differentiating (5), we have

d 2y ∂f ∂f dy
2
= + . ⇒ y 00 = fx + fy f .
dx ∂x ∂y dx

Differentiating this successively, we can get y 000 , y iv etc.

Putting x = x0 and y = y0 , the values of y 0 , y 00 , y 000 , . . . , can be obtained


at x = x0 .

Sam Johnson NIT Karnataka Mangaluru


Numerical
India
Solution of Ordinary Differential Equations (Part - 1) May 3, 2020 22/51
Taylor’s Series Method

Hence the Taylor’s series

(x − x0 )2 00
y = y0 + (x − x0 )(y 0 )x=x0 + (y )x=x0 + · · · (6)
2!
gives the values of y for every value of x for which (6) converges.

On finding the value y1 for x = x1 from (6), y 0 , y 00 etc. can be evaluated


at x = x1 .

Then y can be expanded about x = x1 .

In this way, the solution can be extended beyond the range of convergence
of series (6).

Sam Johnson NIT Karnataka Mangaluru


Numerical
India
Solution of Ordinary Differential Equations (Part - 1) May 3, 2020 23/51
Main Drawback of Taylor’s Series Method

This is a single step method and works well so long as the successive
derivatives can be calculated easily.

If f (x, y ) is somewhat complicated and the calculation of higher order


derivatives becomes tedious, then Taylor’s method cannot be used
gainfully. This is the main drawback of this method and therefore, has
little application for computer programmes.

However, it is useful for finding starting values for the application of


powerful methods like Runge-Kutta, Milne and Adams-Bashforth which
will be discussed later.

Sam Johnson NIT Karnataka Mangaluru


Numerical
India
Solution of Ordinary Differential Equations (Part - 1) May 3, 2020 24/51
Exercises

15. Solve
dy
= x + y , y (0) = 1
dx
by Taylor’s series method. Hence find the values of y at x = 0.1 and
x = 0.2.
Compare the final result with the value of the explicit solution.
16. Find by Taylor’s series method, the values of y at x = 0.1 and
x = 0.2 to five places of decimals from
dy
= x 2 y − 1, y (0) = 1.
dx
17. Using Taylor’s series method, find y at x = 1.1 and 0.2 by solving
dy
= x 2 + y 2, y (1) = 2.3.
dx

Sam Johnson NIT Karnataka Mangaluru


Numerical
India
Solution of Ordinary Differential Equations (Part - 1) May 3, 2020 25/51
Exercises

18. Evaluate the solution of the following problem by the first four terms
of its Maclaurin series for x = 0.1,
dy 1
= (1 + x)y 2 , y (0) = 1.
dx 2
Compare the value with the exact solution.

Sam Johnson NIT Karnataka Mangaluru


Numerical
India
Solution of Ordinary Differential Equations (Part - 1) May 3, 2020 26/51
Exercises

19. Employ Taylor’s method to obtain approximate value of y at x = 0.2


for the differential equation
dy
= 2y + 3e x , y (0) = 0.
dx
Compare the numerical solution obtained with the exact solution.
20. Solve by Taylor series method of the equation

dy x 3 + xy 2
=
dx ex
y (0) = 1 for y at x = 0.1, 0.2 and x = 0.3.

Sam Johnson NIT Karnataka Mangaluru


Numerical
India
Solution of Ordinary Differential Equations (Part - 1) May 3, 2020 27/51
Exercises

21. Solve by Taylor’s series method the equation


dy
= log(xy )
dx
for y (1.1) and y (1.2), given that y (1) = 2.
22. From the Taylor series for y (x), find y (0.1) correct to 4 decimal
places if y (x) satisfies y 0 = x − y 2 and y (0) = 1.
23. Using Taylor’s method solve
dy
= 1 + xy
dx
with y (0) = 2. Find y at x = 0.1, 0.2, 0.3.
24. Using Taylor’s method find y (0.1) correct to 3 decimal places from
dy
+ 2xy = 1
dx
with y (0) = 0.
Sam Johnson NIT Karnataka Mangaluru
Numerical
India
Solution of Ordinary Differential Equations (Part - 1) May 3, 2020 28/51
Solving Simultaneous First Order Differential Equations :
Taylor’s Series Method

Consider the simultaneous differential equations of the type


dy
= f (x, y , z) (7)
dx
and
dz
= g (x, y , z) (8)
dx
with initial conditions

y (x0 ) = y0 and z(x0 ) = z0

can be solved by Taylor’s series method.

Sam Johnson NIT Karnataka Mangaluru


Numerical
India
Solution of Ordinary Differential Equations (Part - 1) May 3, 2020 29/51
Solving Simultaneous First Order Differential Equations :
Taylor’s Series Method

Let h be the interval of differencing

y1 = y (x0 + h) and z1 = z0 + h.

The Taylor’s algorithm for (7) and (8) are given by

h2 00 h3 000
y1 = y0 + hy00 + y + y0 + · · · (9)
2! 0 3!
h 2 h 3
z1 = z0 + hz00 + z000 + z0000 + · · · . (10)
2! 3!
Differentiating (7) and (8) successively, we get y 00 , z 00 etc. Hence, the
values of y00 , y000 , y0000 , . . . , and z00 , z000 , z0000 , . . . can be found.

Sam Johnson NIT Karnataka Mangaluru


Numerical
India
Solution of Ordinary Differential Equations (Part - 1) May 3, 2020 30/51
Solving Simultaneous First Order Differential Equations :
Taylor’s Series Method

Substituting these values in (9) and (10) we get the first approximation y1
and z1 . Similarly for the second approximation, the Taylor’s algorithms are

h2 00 h3 000
y2 = y1 + hy10 + y + y1 + · · · (11)
2! 1 3!
h 2 h3
z2 = z1 + hz10 + z100 + z1000 + · · · . (12)
2! 3!
Using the first approximate values y1 and z1 , we can calculate y10 , y100 etc.
and z10 , z100 etc.

Substituting these values in (11) and (12) we get y2 and z2 . Proceeding


like this we can calculate the higher approximations of y and z step by
step.

Sam Johnson NIT Karnataka Mangaluru


Numerical
India
Solution of Ordinary Differential Equations (Part - 1) May 3, 2020 31/51
Exercises

25. Solve the initial value problem involve two independent functions x(t)
and y (t) using Taylor series method,

dx dy
= ty + 1, = −tx
dt dt
x = 0, y = 1 when t = 0. Evaluate x and y at t = 0.1.
26. Find an approximate series solution of the simultaneous equations
dx dy
= xy + 2t, = 2ty + x
dt dt
subject to the initial conditions x = 1, y = −1 when t = 0.

Sam Johnson NIT Karnataka Mangaluru


Numerical
India
Solution of Ordinary Differential Equations (Part - 1) May 3, 2020 32/51
Solving Second / Higher Order Differential Equations :
Picard’s Method

Consider a second order differential equation

d 2y
 
dy
= f x, y , .
dx 2 dx

Let z = dy
dx . Hence the given equation can be reduced to 2 first order
simultaneous differential equations
dy
= z
dx
and
dz
= f (x, y , z).
dx

Sam Johnson NIT Karnataka Mangaluru


Numerical
India
Solution of Ordinary Differential Equations (Part - 1) May 3, 2020 33/51
Exercises

27. Using Taylor’s series method obtain the values of y at x = 0.1 to 4


significant figures, if y satisfies the equation

d 2y
= −xy
dx 2
dy
given that dx = 0.5 and y = 1 when x = 0.
28. Find the first 6 terms of the power series method solution of

y 00 + xy 0 − 2y = 0

if y (1) = 0, y 0 (1) = 1.

Sam Johnson NIT Karnataka Mangaluru


Numerical
India
Solution of Ordinary Differential Equations (Part - 1) May 3, 2020 34/51
Exercises

29. Find the value of y (1.1) and y (1.2) from

y 00 + y 2 y 0 = x 3 0

with the conditions y (1) = 1 and y 0 (1) = 1, using Taylor’s series


method.
30. Using Taylor’s series method, obtain the values of y at x = 0.2
correct to 4 decimal places, if y satisfies the equation

d 2y
= xy
dx 2
dy
given that y = 1 and dx = 1 at x = 0.

Sam Johnson NIT Karnataka Mangaluru


Numerical
India
Solution of Ordinary Differential Equations (Part - 1) May 3, 2020 35/51
Exercises

31. Given the differential equation

y 00 − xy 0 − y = 0

with the conditions y (0) = 1 and y 0 (0) = 0, use Taylor’s series


method to determine the value of y (0.1).
32. Using Taylor’s series method, find the values of x and y for t = 0.4
satisfying the differentiatl equations

dx d 2y
= x + y + t, =x −t
dt dt 2

with initial conditions x = 0, y = 1, dy


dt = 1 at t = 0.

Sam Johnson NIT Karnataka Mangaluru


Numerical
India
Solution of Ordinary Differential Equations (Part - 1) May 3, 2020 36/51
Euler’s Method
dy
Consider the equation dx = f (x, y ) given y (x0 ) = y0 .

For a given point P(x0 , y0 ) in the (unknown) solution curve, we are going
to find the ordinate of x, possibly near to the solution curve.

The unknown solution curve is in blue, and its polygonal approximation is


in red. Let us divide LM into n subintervals each of width h, the value of
h is quite small.
Sam Johnson NIT Karnataka Mangaluru
Numerical
India
Solution of Ordinary Differential Equations (Part - 1) May 3, 2020 37/51
Euler’s Method

In the interval LL1 , we approximate the curve by the tangent at P.

If the ordinate through L1 meets this tangent in P1 (x0 + h, y1 ), then

y1 = L1 P1 = LP + R1 P1
= y0 + PR1 tan θ
 
dy
= y0 + h
dx P
= y0 + hf (x0 , y0 ).

Sam Johnson NIT Karnataka Mangaluru


Numerical
India
Solution of Ordinary Differential Equations (Part - 1) May 3, 2020 38/51
Euler’s Method

Let P1 Q1 be the solution curve of the given initial value problem through
P1 and let its tangent at P1 meet the ordinate through L2 in
P2 (x0 + 2h, y2 ).

Then
y2 = y1 + hf (x0 + h, y1 ).
Repeating this process n times, we finally reach on an approximation MPn
of MQ given by

yn = yn−1 + hf (x0 + (n − 1)h, yn−1 ).

This is Euler’s method of finding an approximate solution of the given


differential equation
dy
= f (x, y ) given y (x0 ) = y0 .
dx

Sam Johnson NIT Karnataka Mangaluru


Numerical
India
Solution of Ordinary Differential Equations (Part - 1) May 3, 2020 39/51
Drawbacks of Euler’s Method

In Euler’s method, we approximate the solution curve by the tangent in


each interval, i.e., by a sequence of points (or by short lines).

Unless h is small, the error is bound to be quite significant. This sequence


of lines may also deviate considerably from the solution curve.

As such, the method is slow and hence there is a modification of this


method, which will be discussed later.

Sam Johnson NIT Karnataka Mangaluru


Numerical
India
Solution of Ordinary Differential Equations (Part - 1) May 3, 2020 40/51
Drawbacks of Euler’s Method

An another drawback lies in the fact that if dydx changes rapidly over an
interval, then its value at the beginning of the interval may give a poor
approximation as compared to its average value over the interval and thus
the value of y calculated from Euler’s method may be in much error from
its true value.

These errors accumulate in the succeeding intervals and the value of y


becomes much erroroneous ultimately. Thus the method is completely
useless.
Sam Johnson NIT Karnataka Mangaluru
Numerical
India
Solution of Ordinary Differential Equations (Part - 1) May 3, 2020 41/51
Exercises

33. Using Euler’s method, find an approximate value of y corresponding


to x = 1, given that
dy
=x +y and y (0) = 1.
dx
34. Solve for y (0.4) by Euler’s method, y 0 = −y with the condition
y (0) = 1.
35. Given
dy y −x
=
dx y +x
with initial condition y = 1 at x = 0 ; find y for x = 0.1 by Euler’s
method.
36. Using Euler’s method, compute y for x = 0.1 and 0.2 choosing
h = 0.1 from y 0 = y − 2x/y , y (0) = 1.

Sam Johnson NIT Karnataka Mangaluru


Numerical
India
Solution of Ordinary Differential Equations (Part - 1) May 3, 2020 42/51
Exercises

37. Determine the numerical solution at x = 0.8 for


dy √
= x +y
dx
given y (0.4) = 0.41. Assume h = 0.2.
38. Solve
dy
+ y2 = 0
dt
given y = 1 at t = 0. Find approximately the value of y for t = 1 by
Euler’s method in five steps.
39. Solve the equation
dy
= 1 − y2
dx
with x = 0, y = 1, using Euler’s algorithm and tabulate the solutions
of x = 0.1, 0.2, 0.3, 0.4.
Sam Johnson NIT Karnataka Mangaluru
Numerical
India
Solution of Ordinary Differential Equations (Part - 1) May 3, 2020 43/51
Modified Euler’s Method

In the Euler’s method, the curve of solution in the interval LL1 is


approximated by the tangent at P such that at P1 , we have

y1 = y0 + hf (x0 , y0 ).

Then the slope of the curve of solution through P1 ,


 
dy
= f (x0 + h, y1 )
dx P1

is computed and the tangent at P1 to P1 Q1 is drawn meeting the ordinate


through L2 in P(x0 + 2h, y2 ).

Sam Johnson NIT Karnataka Mangaluru


Numerical
India
Solution of Ordinary Differential Equations (Part - 1) May 3, 2020 44/51
Modified Euler’s Method
(1)
Now we find a better approximation y1 of y (x0 + h) by taking the slope
of the curve as the mean of the slopes of the tangents at P and P1 .

That is,  
(1) h
y1 = y0 + f (x0 , y0 ) + f (x0 + h, y1 ) .
2

As the slope of the tangent at P1 is not known, we calculate y1 by Euler’s


(1)
method to calculate the first modified value y1 .

Sam Johnson NIT Karnataka Mangaluru


Numerical
India
Solution of Ordinary Differential Equations (Part - 1) May 3, 2020 45/51
Modified Euler’s Method
(2)
We can find a still better value y1 corresponding to L1 as
 
(2) h (1)
y1 = y0 + f (x0 , y0 ) + f (x0 + h, y1 ) .
2

We repeat this step, till two consecutive values of y agree. This is then
taken as the starting point for the next interval L1 L2 .

Once y1 is obtained to desired degree of accuracy, y corresponding to L2 is


(1)
found from Euler’s method, and a better approximation y2 is obtained
 
(1) h
y2 = y1 + f (x0 + h, y1 ) + f (x0 + 2h, y2 ) .
2

We repeat this step until y2 becomes stationary. Then we calculate y3 .


This is the modified Euler’s method which gives great improvement in
accuracy over the original method.
Sam Johnson NIT Karnataka Mangaluru
Numerical
India
Solution of Ordinary Differential Equations (Part - 1) May 3, 2020 46/51
Exercises

40. Using modified Euler’s method, find an approximate value of y when


x = 0.3 given that
dy
=x +y
dx
and y = 1 when x = 0.
41. Using modified Euler’s method, find y (0.2) and y (0.4) given

dy
= y + ex y (0) = 0.
dx
42. Solve the following differential equation by Euler’s modified method,
dy
= log(x + y ) y (0) = 2.
dx

Sam Johnson NIT Karnataka Mangaluru


Numerical
India
Solution of Ordinary Differential Equations (Part - 1) May 3, 2020 47/51
Exercises

43. Using modified Euler’s method, obtain a solution of the equation


dy √
= x + | y|
dx
with the initial condition y = 1 at x = 0, for the range 0 ≤ x ≤ 0.6 in
steps of 0.2.
44. Using modified Euler’s method, to compute y (0.2) with h = 0.1 from

dy 2x
=y− , y (0) = 1.
dx y
45. Solve by modified Euler’s method,
dy
= x + y 2, y (0) = 1.
dx

Sam Johnson NIT Karnataka Mangaluru


Numerical
India
Solution of Ordinary Differential Equations (Part - 1) May 3, 2020 48/51
Exercises

46. Using modified Euler’s method, solve


dy
= x2 + y, y (0) = 0.94
dx
for x = 0.1.
47. Use modified Euler’s method to find an approximate solution at the
point 0.2 of the problem

y 0 = −y y (0) = 1

with step length h = 0.2.


48. Solve
dy
= 1 − y, y (0) = 0
dx
in the range 0 ≤ x ≤ 0.2 by taking h = 0.1.
Compare the result with the results of the exact solution.
Sam Johnson NIT Karnataka Mangaluru
Numerical
India
Solution of Ordinary Differential Equations (Part - 1) May 3, 2020 49/51
Exercises

49. Use Euler’s method solve


dy
= 1 + xy y (0) = 2.
dx
Find y (0.1), y (0.2) and y (0.3). Also find the values by modified
Euler’s method
50. Given
dy y 1
+ = 2, y (1) = 1.
dx x x
Evaluate y (1.3) by modified Euler’s method.
51. Solve the simultaneous equations by the modified Euler’s method
with h = 0.1, y 0 = z, z 0 = y + xz, y (0) = 1, z(0) = 0.

Sam Johnson NIT Karnataka Mangaluru


Numerical
India
Solution of Ordinary Differential Equations (Part - 1) May 3, 2020 50/51
References

1. Richard L. Burden and J. Douglas Faires, Numerical Analysis -


Theory and Applications, Cengage Learning, Singapore.
2. Kendall E. Atkinson, An Introduction to Numerical Analysis, Wiley
India.
3. David Kincaid and Ward Cheney, Numerical Analysis -
Mathematics of Scientific Computing, American Mathematical
Society, Providence, Rhode Island.
4. S.S. Sastry, Introductory Methods of Numerical Analysis, Fourth
Edition, Prentice-Hall, India.

Sam Johnson NIT Karnataka Mangaluru


Numerical
India
Solution of Ordinary Differential Equations (Part - 1) May 3, 2020 51/51

You might also like