+ All Categories
Home > Education > Numerical Methods - Oridnary Differential Equations - 2

Numerical Methods - Oridnary Differential Equations - 2

Date post: 09-Jan-2017
Category:
Upload: dr-nirav-vyas
View: 785 times
Download: 2 times
Share this document with a friend
of 170 /170
Numerical Methods Ordinary Differential Equations - 2 Dr. N. B. Vyas Department of Mathematics, Atmiya Institute of Tech. and Science, Rajkot (Gujarat) - INDIA [email protected] Dr. N. B. Vyas Numerical Methods Ordinary Differential Equations -
Transcript
Page 1: Numerical Methods - Oridnary Differential Equations - 2

Numerical MethodsOrdinary Differential Equations - 2

Dr. N. B. Vyas

Department of Mathematics,Atmiya Institute of Tech. and Science,

Rajkot (Gujarat) - [email protected]

Dr. N. B. Vyas Numerical Methods Ordinary Differential Equations - 2

Page 2: Numerical Methods - Oridnary Differential Equations - 2

Ordinary Differential Equations

Euler’s Method:

Consider the differential Equationdy

dx= f(x, y), y(x0) = y0

The Taylor’s series is

y(x) = y(x0) +(x− x0)

1!y′(x0) +

(x− x0)2

2!y′′(x0) + . . . - - - (1)

Now substituting h = x1 − x0 in eq (1), we get

y(x1) = y(x0) + hy′(x0) +h2

2!y′′(x0) + . . .

Dr. N. B. Vyas Numerical Methods Ordinary Differential Equations - 2

Page 3: Numerical Methods - Oridnary Differential Equations - 2

Ordinary Differential Equations

Euler’s Method:

Consider the differential Equationdy

dx= f(x, y), y(x0) = y0

The Taylor’s series is

y(x) = y(x0) +(x− x0)

1!y′(x0) +

(x− x0)2

2!y′′(x0) + . . . - - - (1)

Now substituting h = x1 − x0 in eq (1), we get

y(x1) = y(x0) + hy′(x0) +h2

2!y′′(x0) + . . .

Dr. N. B. Vyas Numerical Methods Ordinary Differential Equations - 2

Page 4: Numerical Methods - Oridnary Differential Equations - 2

Ordinary Differential Equations

Euler’s Method:

Consider the differential Equationdy

dx= f(x, y), y(x0) = y0

The Taylor’s series is

y(x) = y(x0) +(x− x0)

1!y′(x0) +

(x− x0)2

2!y′′(x0) + . . . - - - (1)

Now substituting h = x1 − x0 in eq (1), we get

y(x1) = y(x0) + hy′(x0) +h2

2!y′′(x0) + . . .

Dr. N. B. Vyas Numerical Methods Ordinary Differential Equations - 2

Page 5: Numerical Methods - Oridnary Differential Equations - 2

Ordinary Differential Equations

Euler’s Method:

Consider the differential Equationdy

dx= f(x, y), y(x0) = y0

The Taylor’s series is

y(x) = y(x0) +(x− x0)

1!y′(x0) +

(x− x0)2

2!y′′(x0) + . . . - - - (1)

Now substituting h = x1 − x0 in eq (1), we get

y(x1) = y(x0) + hy′(x0) +h2

2!y′′(x0) + . . .

Dr. N. B. Vyas Numerical Methods Ordinary Differential Equations - 2

Page 6: Numerical Methods - Oridnary Differential Equations - 2

Euler’s Method

If h is chosen small enough then we may neglect the second andhigher order term of h.

y1 = y0 + hf(x0, y0)Which is Euler’s first approximation.The general step for Euler method isyi+1 = yi + hf(xi, yi) where i = 0, 1, 2....

Dr. N. B. Vyas Numerical Methods Ordinary Differential Equations - 2

Page 7: Numerical Methods - Oridnary Differential Equations - 2

Euler’s Method

If h is chosen small enough then we may neglect the second andhigher order term of h.y1 = y0 + hf(x0, y0)

Which is Euler’s first approximation.The general step for Euler method isyi+1 = yi + hf(xi, yi) where i = 0, 1, 2....

Dr. N. B. Vyas Numerical Methods Ordinary Differential Equations - 2

Page 8: Numerical Methods - Oridnary Differential Equations - 2

Euler’s Method

If h is chosen small enough then we may neglect the second andhigher order term of h.y1 = y0 + hf(x0, y0)Which is Euler’s first approximation.

The general step for Euler method isyi+1 = yi + hf(xi, yi) where i = 0, 1, 2....

Dr. N. B. Vyas Numerical Methods Ordinary Differential Equations - 2

Page 9: Numerical Methods - Oridnary Differential Equations - 2

Euler’s Method

If h is chosen small enough then we may neglect the second andhigher order term of h.y1 = y0 + hf(x0, y0)Which is Euler’s first approximation.The general step for Euler method is

yi+1 = yi + hf(xi, yi) where i = 0, 1, 2....

Dr. N. B. Vyas Numerical Methods Ordinary Differential Equations - 2

Page 10: Numerical Methods - Oridnary Differential Equations - 2

Euler’s Method

If h is chosen small enough then we may neglect the second andhigher order term of h.y1 = y0 + hf(x0, y0)Which is Euler’s first approximation.The general step for Euler method isyi+1 = yi + hf(xi, yi) where i = 0, 1, 2....

Dr. N. B. Vyas Numerical Methods Ordinary Differential Equations - 2

Page 11: Numerical Methods - Oridnary Differential Equations - 2

Euler’s Method

Ex.: Use Euler’s method to find y(1.6) given thatdy

dx= xy

12 , y(1) = 1

Dr. N. B. Vyas Numerical Methods Ordinary Differential Equations - 2

Page 12: Numerical Methods - Oridnary Differential Equations - 2

Euler’s Method

Sol.:

Here x0 = 1, y0 = 1 anddy

dx= f(x, y) = xy

12

we take h = 0.2

1st approximation:

y1 = y0 + hf(x0, y0)

= 1 + (0.2)(1)(1)12

= 1.2

x1 = x0 + h = 1 + 0.2 = 1.2

Dr. N. B. Vyas Numerical Methods Ordinary Differential Equations - 2

Page 13: Numerical Methods - Oridnary Differential Equations - 2

Euler’s Method

Sol.:

Here x0 = 1, y0 = 1 anddy

dx= f(x, y) = xy

12

we take h = 0.2

1st approximation:

y1 = y0 + hf(x0, y0)

= 1 + (0.2)(1)(1)12

= 1.2

x1 = x0 + h = 1 + 0.2 = 1.2

Dr. N. B. Vyas Numerical Methods Ordinary Differential Equations - 2

Page 14: Numerical Methods - Oridnary Differential Equations - 2

Euler’s Method

Sol.:

Here x0 = 1, y0 = 1 anddy

dx= f(x, y) = xy

12

we take h = 0.2

1st approximation:

y1 = y0 + hf(x0, y0)

= 1 + (0.2)(1)(1)12

= 1.2

x1 = x0 + h = 1 + 0.2 = 1.2

Dr. N. B. Vyas Numerical Methods Ordinary Differential Equations - 2

Page 15: Numerical Methods - Oridnary Differential Equations - 2

Euler’s Method

Sol.:

Here x0 = 1, y0 = 1 anddy

dx= f(x, y) = xy

12

we take h = 0.2

1st approximation:

y1 = y0 + hf(x0, y0)

= 1 + (0.2)(1)(1)12

= 1.2

x1 = x0 + h = 1 + 0.2 = 1.2

Dr. N. B. Vyas Numerical Methods Ordinary Differential Equations - 2

Page 16: Numerical Methods - Oridnary Differential Equations - 2

Euler’s Method

Sol.:

Here x0 = 1, y0 = 1 anddy

dx= f(x, y) = xy

12

we take h = 0.2

1st approximation:

y1 = y0 + hf(x0, y0)

= 1 + (0.2)(1)(1)12

= 1.2

x1 = x0 + h = 1 + 0.2 = 1.2

Dr. N. B. Vyas Numerical Methods Ordinary Differential Equations - 2

Page 17: Numerical Methods - Oridnary Differential Equations - 2

Euler’s Method

Sol.:

Here x0 = 1, y0 = 1 anddy

dx= f(x, y) = xy

12

we take h = 0.2

1st approximation:

y1 = y0 + hf(x0, y0)

= 1 + (0.2)(1)(1)12

= 1.2

x1 = x0 + h = 1 + 0.2 = 1.2

Dr. N. B. Vyas Numerical Methods Ordinary Differential Equations - 2

Page 18: Numerical Methods - Oridnary Differential Equations - 2

Euler’s Method

2nd approximation:

y2 = y1 + hf(x1, y1)

= 1.2 + (0.2)(1.2)(1.2)12

= 1.4629

x2 = x1 + h = 1.2 + 0.2 = 1.4

3rd approximation:

y3 = y2 + hf(x2, y2)

= 1.4629 + (0.2)(1.4)(1.4629)12

= 1.8016

x3 = x2 + h = 1.4 + 0.2 = 1.6

∴ y(1.6) = 1.8016

Dr. N. B. Vyas Numerical Methods Ordinary Differential Equations - 2

Page 19: Numerical Methods - Oridnary Differential Equations - 2

Euler’s Method

2nd approximation:

y2 = y1 + hf(x1, y1)

= 1.2 + (0.2)(1.2)(1.2)12

= 1.4629

x2 = x1 + h = 1.2 + 0.2 = 1.4

3rd approximation:

y3 = y2 + hf(x2, y2)

= 1.4629 + (0.2)(1.4)(1.4629)12

= 1.8016

x3 = x2 + h = 1.4 + 0.2 = 1.6

∴ y(1.6) = 1.8016

Dr. N. B. Vyas Numerical Methods Ordinary Differential Equations - 2

Page 20: Numerical Methods - Oridnary Differential Equations - 2

Euler’s Method

2nd approximation:

y2 = y1 + hf(x1, y1)

= 1.2 + (0.2)(1.2)(1.2)12

= 1.4629

x2 = x1 + h = 1.2 + 0.2 = 1.4

3rd approximation:

y3 = y2 + hf(x2, y2)

= 1.4629 + (0.2)(1.4)(1.4629)12

= 1.8016

x3 = x2 + h = 1.4 + 0.2 = 1.6

∴ y(1.6) = 1.8016

Dr. N. B. Vyas Numerical Methods Ordinary Differential Equations - 2

Page 21: Numerical Methods - Oridnary Differential Equations - 2

Euler’s Method

2nd approximation:

y2 = y1 + hf(x1, y1)

= 1.2 + (0.2)(1.2)(1.2)12

= 1.4629

x2 = x1 + h = 1.2 + 0.2 = 1.4

3rd approximation:

y3 = y2 + hf(x2, y2)

= 1.4629 + (0.2)(1.4)(1.4629)12

= 1.8016

x3 = x2 + h = 1.4 + 0.2 = 1.6

∴ y(1.6) = 1.8016

Dr. N. B. Vyas Numerical Methods Ordinary Differential Equations - 2

Page 22: Numerical Methods - Oridnary Differential Equations - 2

Euler’s Method

2nd approximation:

y2 = y1 + hf(x1, y1)

= 1.2 + (0.2)(1.2)(1.2)12

= 1.4629

x2 = x1 + h =

1.2 + 0.2 = 1.4

3rd approximation:

y3 = y2 + hf(x2, y2)

= 1.4629 + (0.2)(1.4)(1.4629)12

= 1.8016

x3 = x2 + h = 1.4 + 0.2 = 1.6

∴ y(1.6) = 1.8016

Dr. N. B. Vyas Numerical Methods Ordinary Differential Equations - 2

Page 23: Numerical Methods - Oridnary Differential Equations - 2

Euler’s Method

2nd approximation:

y2 = y1 + hf(x1, y1)

= 1.2 + (0.2)(1.2)(1.2)12

= 1.4629

x2 = x1 + h = 1.2 + 0.2 = 1.4

3rd approximation:

y3 = y2 + hf(x2, y2)

= 1.4629 + (0.2)(1.4)(1.4629)12

= 1.8016

x3 = x2 + h = 1.4 + 0.2 = 1.6

∴ y(1.6) = 1.8016

Dr. N. B. Vyas Numerical Methods Ordinary Differential Equations - 2

Page 24: Numerical Methods - Oridnary Differential Equations - 2

Euler’s Method

2nd approximation:

y2 = y1 + hf(x1, y1)

= 1.2 + (0.2)(1.2)(1.2)12

= 1.4629

x2 = x1 + h = 1.2 + 0.2 = 1.4

3rd approximation:

y3 = y2 + hf(x2, y2)

= 1.4629 + (0.2)(1.4)(1.4629)12

= 1.8016

x3 = x2 + h = 1.4 + 0.2 = 1.6

∴ y(1.6) = 1.8016

Dr. N. B. Vyas Numerical Methods Ordinary Differential Equations - 2

Page 25: Numerical Methods - Oridnary Differential Equations - 2

Euler’s Method

2nd approximation:

y2 = y1 + hf(x1, y1)

= 1.2 + (0.2)(1.2)(1.2)12

= 1.4629

x2 = x1 + h = 1.2 + 0.2 = 1.4

3rd approximation:

y3 = y2 + hf(x2, y2)

= 1.4629 + (0.2)(1.4)(1.4629)12

= 1.8016

x3 = x2 + h = 1.4 + 0.2 = 1.6

∴ y(1.6) = 1.8016

Dr. N. B. Vyas Numerical Methods Ordinary Differential Equations - 2

Page 26: Numerical Methods - Oridnary Differential Equations - 2

Euler’s Method

2nd approximation:

y2 = y1 + hf(x1, y1)

= 1.2 + (0.2)(1.2)(1.2)12

= 1.4629

x2 = x1 + h = 1.2 + 0.2 = 1.4

3rd approximation:

y3 = y2 + hf(x2, y2)

= 1.4629 + (0.2)(1.4)(1.4629)12

= 1.8016

x3 = x2 + h = 1.4 + 0.2 = 1.6

∴ y(1.6) = 1.8016

Dr. N. B. Vyas Numerical Methods Ordinary Differential Equations - 2

Page 27: Numerical Methods - Oridnary Differential Equations - 2

Euler’s Method

2nd approximation:

y2 = y1 + hf(x1, y1)

= 1.2 + (0.2)(1.2)(1.2)12

= 1.4629

x2 = x1 + h = 1.2 + 0.2 = 1.4

3rd approximation:

y3 = y2 + hf(x2, y2)

= 1.4629 + (0.2)(1.4)(1.4629)12

= 1.8016

x3 = x2 + h = 1.4 + 0.2 = 1.6

∴ y(1.6) = 1.8016

Dr. N. B. Vyas Numerical Methods Ordinary Differential Equations - 2

Page 28: Numerical Methods - Oridnary Differential Equations - 2

Euler’s Method

Ex.: Using Euler’s method, find y(0.2), givendy

dx= y − 2x

y, y(0) = 1. (Take h = 0.1)

Dr. N. B. Vyas Numerical Methods Ordinary Differential Equations - 2

Page 29: Numerical Methods - Oridnary Differential Equations - 2

Euler’s Method

Sol.:

Here x0 = 0, y0 = 1 anddy

dx= f(x, y) = y − 2x

y

we take h = 0.1

1st approximation:

y1 = y0 + hf(x0, y0)

= 1 + (0.1)(1 − 0)

= 1.1

x1 = x0 + h = 0 + 0.1 = 0.1

Dr. N. B. Vyas Numerical Methods Ordinary Differential Equations - 2

Page 30: Numerical Methods - Oridnary Differential Equations - 2

Euler’s Method

Sol.:

Here x0 = 0, y0 = 1 anddy

dx= f(x, y) = y − 2x

ywe take h = 0.1

1st approximation:

y1 = y0 + hf(x0, y0)

= 1 + (0.1)(1 − 0)

= 1.1

x1 = x0 + h = 0 + 0.1 = 0.1

Dr. N. B. Vyas Numerical Methods Ordinary Differential Equations - 2

Page 31: Numerical Methods - Oridnary Differential Equations - 2

Euler’s Method

Sol.:

Here x0 = 0, y0 = 1 anddy

dx= f(x, y) = y − 2x

ywe take h = 0.1

1st approximation:

y1 = y0 + hf(x0, y0)

= 1 + (0.1)(1 − 0)

= 1.1

x1 = x0 + h = 0 + 0.1 = 0.1

Dr. N. B. Vyas Numerical Methods Ordinary Differential Equations - 2

Page 32: Numerical Methods - Oridnary Differential Equations - 2

Euler’s Method

Sol.:

Here x0 = 0, y0 = 1 anddy

dx= f(x, y) = y − 2x

ywe take h = 0.1

1st approximation:

y1 = y0 + hf(x0, y0)

= 1 + (0.1)(1 − 0)

= 1.1

x1 = x0 + h = 0 + 0.1 = 0.1

Dr. N. B. Vyas Numerical Methods Ordinary Differential Equations - 2

Page 33: Numerical Methods - Oridnary Differential Equations - 2

Euler’s Method

Sol.:

Here x0 = 0, y0 = 1 anddy

dx= f(x, y) = y − 2x

ywe take h = 0.1

1st approximation:

y1 = y0 + hf(x0, y0)

= 1 + (0.1)(1 − 0)

= 1.1

x1 = x0 + h = 0 + 0.1 = 0.1

Dr. N. B. Vyas Numerical Methods Ordinary Differential Equations - 2

Page 34: Numerical Methods - Oridnary Differential Equations - 2

Euler’s Method

Sol.:

Here x0 = 0, y0 = 1 anddy

dx= f(x, y) = y − 2x

ywe take h = 0.1

1st approximation:

y1 = y0 + hf(x0, y0)

= 1 + (0.1)(1 − 0)

= 1.1

x1 = x0 + h = 0 + 0.1 = 0.1

Dr. N. B. Vyas Numerical Methods Ordinary Differential Equations - 2

Page 35: Numerical Methods - Oridnary Differential Equations - 2

Euler’s Method

Sol.:

Here x0 = 0, y0 = 1 anddy

dx= f(x, y) = y − 2x

ywe take h = 0.1

1st approximation:

y1 = y0 + hf(x0, y0)

= 1 + (0.1)(1 − 0)

= 1.1

x1 = x0 + h = 0 + 0.1 = 0.1

Dr. N. B. Vyas Numerical Methods Ordinary Differential Equations - 2

Page 36: Numerical Methods - Oridnary Differential Equations - 2

Euler’s Method

2nd approximation:

y2 = y1 + hf(x1, y1)

= 1.1 + (0.1)f(0.1, 1.1)

= 1.1 + (0.1)

(0.1 − 2(0.1)

1.1

)= 1.1918

x2 = x1 + h = 0.1 + 0.1 = 0.2

∴ y(0.2) = 1.1918

Dr. N. B. Vyas Numerical Methods Ordinary Differential Equations - 2

Page 37: Numerical Methods - Oridnary Differential Equations - 2

Euler’s Method

2nd approximation:

y2 = y1 + hf(x1, y1)

= 1.1 + (0.1)f(0.1, 1.1)

= 1.1 + (0.1)

(0.1 − 2(0.1)

1.1

)= 1.1918

x2 = x1 + h = 0.1 + 0.1 = 0.2

∴ y(0.2) = 1.1918

Dr. N. B. Vyas Numerical Methods Ordinary Differential Equations - 2

Page 38: Numerical Methods - Oridnary Differential Equations - 2

Euler’s Method

2nd approximation:

y2 = y1 + hf(x1, y1)

= 1.1 + (0.1)f(0.1, 1.1)

= 1.1 + (0.1)

(0.1 − 2(0.1)

1.1

)= 1.1918

x2 = x1 + h = 0.1 + 0.1 = 0.2

∴ y(0.2) = 1.1918

Dr. N. B. Vyas Numerical Methods Ordinary Differential Equations - 2

Page 39: Numerical Methods - Oridnary Differential Equations - 2

Euler’s Method

2nd approximation:

y2 = y1 + hf(x1, y1)

= 1.1 + (0.1)f(0.1, 1.1)

= 1.1 + (0.1)

(0.1 − 2(0.1)

1.1

)

= 1.1918

x2 = x1 + h = 0.1 + 0.1 = 0.2

∴ y(0.2) = 1.1918

Dr. N. B. Vyas Numerical Methods Ordinary Differential Equations - 2

Page 40: Numerical Methods - Oridnary Differential Equations - 2

Euler’s Method

2nd approximation:

y2 = y1 + hf(x1, y1)

= 1.1 + (0.1)f(0.1, 1.1)

= 1.1 + (0.1)

(0.1 − 2(0.1)

1.1

)= 1.1918

x2 = x1 + h = 0.1 + 0.1 = 0.2

∴ y(0.2) = 1.1918

Dr. N. B. Vyas Numerical Methods Ordinary Differential Equations - 2

Page 41: Numerical Methods - Oridnary Differential Equations - 2

Euler’s Method

2nd approximation:

y2 = y1 + hf(x1, y1)

= 1.1 + (0.1)f(0.1, 1.1)

= 1.1 + (0.1)

(0.1 − 2(0.1)

1.1

)= 1.1918

x2 = x1 + h = 0.1 + 0.1 = 0.2

∴ y(0.2) = 1.1918

Dr. N. B. Vyas Numerical Methods Ordinary Differential Equations - 2

Page 42: Numerical Methods - Oridnary Differential Equations - 2

Euler’s Method

2nd approximation:

y2 = y1 + hf(x1, y1)

= 1.1 + (0.1)f(0.1, 1.1)

= 1.1 + (0.1)

(0.1 − 2(0.1)

1.1

)= 1.1918

x2 = x1 + h = 0.1 + 0.1 = 0.2

∴ y(0.2) = 1.1918

Dr. N. B. Vyas Numerical Methods Ordinary Differential Equations - 2

Page 43: Numerical Methods - Oridnary Differential Equations - 2

Euler’s Method

Ex.: Use Euler’s method to obtain an approx value

of y(0.4) for the equationdy

dx= x + y, y(0) = 1 with

h = 0.1.

Dr. N. B. Vyas Numerical Methods Ordinary Differential Equations - 2

Page 44: Numerical Methods - Oridnary Differential Equations - 2

Euler’s Method

Sol.:

Here x0 = 0, y0 = 1, h = 0.1 anddy

dx= f(x, y) = x + y

1st approximation:

y1 = y0 + hf(x0, y0)

= 1 + (0.1)(0 + 1)

= 1.1

x1 = x0 + h = 0 + 0.1 = 0.1

Dr. N. B. Vyas Numerical Methods Ordinary Differential Equations - 2

Page 45: Numerical Methods - Oridnary Differential Equations - 2

Euler’s Method

Sol.:

Here x0 = 0, y0 = 1, h = 0.1 anddy

dx= f(x, y) = x + y

1st approximation:

y1 = y0 + hf(x0, y0)

= 1 + (0.1)(0 + 1)

= 1.1

x1 = x0 + h = 0 + 0.1 = 0.1

Dr. N. B. Vyas Numerical Methods Ordinary Differential Equations - 2

Page 46: Numerical Methods - Oridnary Differential Equations - 2

Euler’s Method

Sol.:

Here x0 = 0, y0 = 1, h = 0.1 anddy

dx= f(x, y) = x + y

1st approximation:

y1 = y0 + hf(x0, y0)

= 1 + (0.1)(0 + 1)

= 1.1

x1 = x0 + h = 0 + 0.1 = 0.1

Dr. N. B. Vyas Numerical Methods Ordinary Differential Equations - 2

Page 47: Numerical Methods - Oridnary Differential Equations - 2

Euler’s Method

Sol.:

Here x0 = 0, y0 = 1, h = 0.1 anddy

dx= f(x, y) = x + y

1st approximation:

y1 = y0 + hf(x0, y0)

= 1 + (0.1)(0 + 1)

= 1.1

x1 = x0 + h = 0 + 0.1 = 0.1

Dr. N. B. Vyas Numerical Methods Ordinary Differential Equations - 2

Page 48: Numerical Methods - Oridnary Differential Equations - 2

Euler’s Method

Sol.:

Here x0 = 0, y0 = 1, h = 0.1 anddy

dx= f(x, y) = x + y

1st approximation:

y1 = y0 + hf(x0, y0)

= 1 + (0.1)(0 + 1)

= 1.1

x1 = x0 + h = 0 + 0.1 = 0.1

Dr. N. B. Vyas Numerical Methods Ordinary Differential Equations - 2

Page 49: Numerical Methods - Oridnary Differential Equations - 2

Euler’s Method

Sol.:

Here x0 = 0, y0 = 1, h = 0.1 anddy

dx= f(x, y) = x + y

1st approximation:

y1 = y0 + hf(x0, y0)

= 1 + (0.1)(0 + 1)

= 1.1

x1 = x0 + h = 0 + 0.1 = 0.1

Dr. N. B. Vyas Numerical Methods Ordinary Differential Equations - 2

Page 50: Numerical Methods - Oridnary Differential Equations - 2

Euler’s Method

2nd approximation:

y2 = y1 + hf(x1, y1)

= 1.1 + (0.1)f(0.1, 1.1)

= 1.1 + (0.1)(0.1 + 1.1)

= 1.22

x2 = x1 + h = 0.1 + 0.1 = 0.2

3rd approximation:

y3 = y2 + hf(x2, y2)

= 1.22 + (0.1)(0.2 + 1.22)

= 1.362

x3 = x2 + h = 0.2 + 0.1 = 0.3

Dr. N. B. Vyas Numerical Methods Ordinary Differential Equations - 2

Page 51: Numerical Methods - Oridnary Differential Equations - 2

Euler’s Method

2nd approximation:

y2 = y1 + hf(x1, y1)

= 1.1 + (0.1)f(0.1, 1.1)

= 1.1 + (0.1)(0.1 + 1.1)

= 1.22

x2 = x1 + h = 0.1 + 0.1 = 0.2

3rd approximation:

y3 = y2 + hf(x2, y2)

= 1.22 + (0.1)(0.2 + 1.22)

= 1.362

x3 = x2 + h = 0.2 + 0.1 = 0.3

Dr. N. B. Vyas Numerical Methods Ordinary Differential Equations - 2

Page 52: Numerical Methods - Oridnary Differential Equations - 2

Euler’s Method

2nd approximation:

y2 = y1 + hf(x1, y1)

= 1.1 + (0.1)f(0.1, 1.1)

= 1.1 + (0.1)(0.1 + 1.1)

= 1.22

x2 = x1 + h = 0.1 + 0.1 = 0.2

3rd approximation:

y3 = y2 + hf(x2, y2)

= 1.22 + (0.1)(0.2 + 1.22)

= 1.362

x3 = x2 + h = 0.2 + 0.1 = 0.3

Dr. N. B. Vyas Numerical Methods Ordinary Differential Equations - 2

Page 53: Numerical Methods - Oridnary Differential Equations - 2

Euler’s Method

2nd approximation:

y2 = y1 + hf(x1, y1)

= 1.1 + (0.1)f(0.1, 1.1)

= 1.1 + (0.1)(0.1 + 1.1)

= 1.22

x2 = x1 + h = 0.1 + 0.1 = 0.2

3rd approximation:

y3 = y2 + hf(x2, y2)

= 1.22 + (0.1)(0.2 + 1.22)

= 1.362

x3 = x2 + h = 0.2 + 0.1 = 0.3

Dr. N. B. Vyas Numerical Methods Ordinary Differential Equations - 2

Page 54: Numerical Methods - Oridnary Differential Equations - 2

Euler’s Method

2nd approximation:

y2 = y1 + hf(x1, y1)

= 1.1 + (0.1)f(0.1, 1.1)

= 1.1 + (0.1)(0.1 + 1.1)

= 1.22

x2 = x1 + h = 0.1 + 0.1 = 0.2

3rd approximation:

y3 = y2 + hf(x2, y2)

= 1.22 + (0.1)(0.2 + 1.22)

= 1.362

x3 = x2 + h = 0.2 + 0.1 = 0.3

Dr. N. B. Vyas Numerical Methods Ordinary Differential Equations - 2

Page 55: Numerical Methods - Oridnary Differential Equations - 2

Euler’s Method

2nd approximation:

y2 = y1 + hf(x1, y1)

= 1.1 + (0.1)f(0.1, 1.1)

= 1.1 + (0.1)(0.1 + 1.1)

= 1.22

x2 = x1 + h = 0.1 + 0.1 = 0.2

3rd approximation:

y3 = y2 + hf(x2, y2)

= 1.22 + (0.1)(0.2 + 1.22)

= 1.362

x3 = x2 + h = 0.2 + 0.1 = 0.3

Dr. N. B. Vyas Numerical Methods Ordinary Differential Equations - 2

Page 56: Numerical Methods - Oridnary Differential Equations - 2

Euler’s Method

2nd approximation:

y2 = y1 + hf(x1, y1)

= 1.1 + (0.1)f(0.1, 1.1)

= 1.1 + (0.1)(0.1 + 1.1)

= 1.22

x2 = x1 + h = 0.1 + 0.1 = 0.2

3rd approximation:

y3 = y2 + hf(x2, y2)

= 1.22 + (0.1)(0.2 + 1.22)

= 1.362

x3 = x2 + h = 0.2 + 0.1 = 0.3

Dr. N. B. Vyas Numerical Methods Ordinary Differential Equations - 2

Page 57: Numerical Methods - Oridnary Differential Equations - 2

Euler’s Method

2nd approximation:

y2 = y1 + hf(x1, y1)

= 1.1 + (0.1)f(0.1, 1.1)

= 1.1 + (0.1)(0.1 + 1.1)

= 1.22

x2 = x1 + h = 0.1 + 0.1 = 0.2

3rd approximation:

y3 = y2 + hf(x2, y2)

= 1.22 + (0.1)(0.2 + 1.22)

= 1.362

x3 = x2 + h = 0.2 + 0.1 = 0.3

Dr. N. B. Vyas Numerical Methods Ordinary Differential Equations - 2

Page 58: Numerical Methods - Oridnary Differential Equations - 2

Euler’s Method

2nd approximation:

y2 = y1 + hf(x1, y1)

= 1.1 + (0.1)f(0.1, 1.1)

= 1.1 + (0.1)(0.1 + 1.1)

= 1.22

x2 = x1 + h = 0.1 + 0.1 = 0.2

3rd approximation:

y3 = y2 + hf(x2, y2)

= 1.22 + (0.1)(0.2 + 1.22)

= 1.362

x3 = x2 + h = 0.2 + 0.1 = 0.3

Dr. N. B. Vyas Numerical Methods Ordinary Differential Equations - 2

Page 59: Numerical Methods - Oridnary Differential Equations - 2

Euler’s Method

2nd approximation:

y2 = y1 + hf(x1, y1)

= 1.1 + (0.1)f(0.1, 1.1)

= 1.1 + (0.1)(0.1 + 1.1)

= 1.22

x2 = x1 + h = 0.1 + 0.1 = 0.2

3rd approximation:

y3 = y2 + hf(x2, y2)

= 1.22 + (0.1)(0.2 + 1.22)

= 1.362

x3 = x2 + h = 0.2 + 0.1 = 0.3

Dr. N. B. Vyas Numerical Methods Ordinary Differential Equations - 2

Page 60: Numerical Methods - Oridnary Differential Equations - 2

Euler’s Method

2nd approximation:

y2 = y1 + hf(x1, y1)

= 1.1 + (0.1)f(0.1, 1.1)

= 1.1 + (0.1)(0.1 + 1.1)

= 1.22

x2 = x1 + h = 0.1 + 0.1 = 0.2

3rd approximation:

y3 = y2 + hf(x2, y2)

= 1.22 + (0.1)(0.2 + 1.22)

= 1.362

x3 = x2 + h = 0.2 + 0.1 = 0.3

Dr. N. B. Vyas Numerical Methods Ordinary Differential Equations - 2

Page 61: Numerical Methods - Oridnary Differential Equations - 2

Euler’s Method

2nd approximation:

y2 = y1 + hf(x1, y1)

= 1.1 + (0.1)f(0.1, 1.1)

= 1.1 + (0.1)(0.1 + 1.1)

= 1.22

x2 = x1 + h = 0.1 + 0.1 = 0.2

3rd approximation:

y3 = y2 + hf(x2, y2)

= 1.22 + (0.1)(0.2 + 1.22)

= 1.362

x3 = x2 + h = 0.2 + 0.1 = 0.3

Dr. N. B. Vyas Numerical Methods Ordinary Differential Equations - 2

Page 62: Numerical Methods - Oridnary Differential Equations - 2

Euler’s Method

4th approximation:

y4 = y3 + hf(x3, y3)

= 1.362 + (0.1)f(0.3, 1.362)

= 1.362 + (0.1)(0.3 + 1.362)

= 1.5282

x4 = x3 + h = 0.3 + 0.1 = 0.4

∴ y(0.4) = 1.5282

Dr. N. B. Vyas Numerical Methods Ordinary Differential Equations - 2

Page 63: Numerical Methods - Oridnary Differential Equations - 2

Euler’s Method

4th approximation:

y4 = y3 + hf(x3, y3)

= 1.362 + (0.1)f(0.3, 1.362)

= 1.362 + (0.1)(0.3 + 1.362)

= 1.5282

x4 = x3 + h = 0.3 + 0.1 = 0.4

∴ y(0.4) = 1.5282

Dr. N. B. Vyas Numerical Methods Ordinary Differential Equations - 2

Page 64: Numerical Methods - Oridnary Differential Equations - 2

Euler’s Method

4th approximation:

y4 = y3 + hf(x3, y3)

= 1.362 + (0.1)f(0.3, 1.362)

= 1.362 + (0.1)(0.3 + 1.362)

= 1.5282

x4 = x3 + h = 0.3 + 0.1 = 0.4

∴ y(0.4) = 1.5282

Dr. N. B. Vyas Numerical Methods Ordinary Differential Equations - 2

Page 65: Numerical Methods - Oridnary Differential Equations - 2

Euler’s Method

4th approximation:

y4 = y3 + hf(x3, y3)

= 1.362 + (0.1)f(0.3, 1.362)

= 1.362 + (0.1)(0.3 + 1.362)

= 1.5282

x4 = x3 + h = 0.3 + 0.1 = 0.4

∴ y(0.4) = 1.5282

Dr. N. B. Vyas Numerical Methods Ordinary Differential Equations - 2

Page 66: Numerical Methods - Oridnary Differential Equations - 2

Euler’s Method

4th approximation:

y4 = y3 + hf(x3, y3)

= 1.362 + (0.1)f(0.3, 1.362)

= 1.362 + (0.1)(0.3 + 1.362)

= 1.5282

x4 = x3 + h = 0.3 + 0.1 = 0.4

∴ y(0.4) = 1.5282

Dr. N. B. Vyas Numerical Methods Ordinary Differential Equations - 2

Page 67: Numerical Methods - Oridnary Differential Equations - 2

Euler’s Method

4th approximation:

y4 = y3 + hf(x3, y3)

= 1.362 + (0.1)f(0.3, 1.362)

= 1.362 + (0.1)(0.3 + 1.362)

= 1.5282

x4 = x3 + h = 0.3 + 0.1 = 0.4

∴ y(0.4) = 1.5282

Dr. N. B. Vyas Numerical Methods Ordinary Differential Equations - 2

Page 68: Numerical Methods - Oridnary Differential Equations - 2

Euler’s Method

4th approximation:

y4 = y3 + hf(x3, y3)

= 1.362 + (0.1)f(0.3, 1.362)

= 1.362 + (0.1)(0.3 + 1.362)

= 1.5282

x4 = x3 + h = 0.3 + 0.1 = 0.4

∴ y(0.4) = 1.5282

Dr. N. B. Vyas Numerical Methods Ordinary Differential Equations - 2

Page 69: Numerical Methods - Oridnary Differential Equations - 2

Euler’s Method

Ex.: Givendy

dx=

y − x

y + x, y(0) = 1.

Find y(0.1) by Euler’s method in 5 steps.

Dr. N. B. Vyas Numerical Methods Ordinary Differential Equations - 2

Page 70: Numerical Methods - Oridnary Differential Equations - 2

Euler’s Method

Sol.:

Here x0 = 0, y0 = 1, h = 0.02 anddy

dx= f(x, y) =

y − x

y + x

1st approximation:

y1 = y0 + hf(x0, y0)

= 1 + (0.02)

(1 − 0

1 + 0

)= 1.02

x1 = x0 + h = 0 + 0.02 = 0.02

Dr. N. B. Vyas Numerical Methods Ordinary Differential Equations - 2

Page 71: Numerical Methods - Oridnary Differential Equations - 2

Euler’s Method

Sol.:

Here x0 = 0, y0 = 1, h = 0.02 anddy

dx= f(x, y) =

y − x

y + x

1st approximation:

y1 = y0 + hf(x0, y0)

= 1 + (0.02)

(1 − 0

1 + 0

)= 1.02

x1 = x0 + h = 0 + 0.02 = 0.02

Dr. N. B. Vyas Numerical Methods Ordinary Differential Equations - 2

Page 72: Numerical Methods - Oridnary Differential Equations - 2

Euler’s Method

Sol.:

Here x0 = 0, y0 = 1, h = 0.02 anddy

dx= f(x, y) =

y − x

y + x

1st approximation:

y1 = y0 + hf(x0, y0)

= 1 + (0.02)

(1 − 0

1 + 0

)= 1.02

x1 = x0 + h = 0 + 0.02 = 0.02

Dr. N. B. Vyas Numerical Methods Ordinary Differential Equations - 2

Page 73: Numerical Methods - Oridnary Differential Equations - 2

Euler’s Method

Sol.:

Here x0 = 0, y0 = 1, h = 0.02 anddy

dx= f(x, y) =

y − x

y + x

1st approximation:

y1 = y0 + hf(x0, y0)

= 1 + (0.02)

(1 − 0

1 + 0

)

= 1.02

x1 = x0 + h = 0 + 0.02 = 0.02

Dr. N. B. Vyas Numerical Methods Ordinary Differential Equations - 2

Page 74: Numerical Methods - Oridnary Differential Equations - 2

Euler’s Method

Sol.:

Here x0 = 0, y0 = 1, h = 0.02 anddy

dx= f(x, y) =

y − x

y + x

1st approximation:

y1 = y0 + hf(x0, y0)

= 1 + (0.02)

(1 − 0

1 + 0

)= 1.02

x1 = x0 + h = 0 + 0.02 = 0.02

Dr. N. B. Vyas Numerical Methods Ordinary Differential Equations - 2

Page 75: Numerical Methods - Oridnary Differential Equations - 2

Euler’s Method

Sol.:

Here x0 = 0, y0 = 1, h = 0.02 anddy

dx= f(x, y) =

y − x

y + x

1st approximation:

y1 = y0 + hf(x0, y0)

= 1 + (0.02)

(1 − 0

1 + 0

)= 1.02

x1 = x0 + h = 0 + 0.02 = 0.02

Dr. N. B. Vyas Numerical Methods Ordinary Differential Equations - 2

Page 76: Numerical Methods - Oridnary Differential Equations - 2

Euler’s Method

2nd approximation:

y2 = y1 + hf(x1, y1)

= 1.02 + (0.02)

(1.02 − 0.02

1.02 + 0.02

)= 1.0392

x2 = x1 + h = 0.02 + 0.02 = 0.04

Dr. N. B. Vyas Numerical Methods Ordinary Differential Equations - 2

Page 77: Numerical Methods - Oridnary Differential Equations - 2

Euler’s Method

2nd approximation:

y2 = y1 + hf(x1, y1)

= 1.02 + (0.02)

(1.02 − 0.02

1.02 + 0.02

)= 1.0392

x2 = x1 + h = 0.02 + 0.02 = 0.04

Dr. N. B. Vyas Numerical Methods Ordinary Differential Equations - 2

Page 78: Numerical Methods - Oridnary Differential Equations - 2

Euler’s Method

2nd approximation:

y2 = y1 + hf(x1, y1)

= 1.02 + (0.02)

(1.02 − 0.02

1.02 + 0.02

)

= 1.0392

x2 = x1 + h = 0.02 + 0.02 = 0.04

Dr. N. B. Vyas Numerical Methods Ordinary Differential Equations - 2

Page 79: Numerical Methods - Oridnary Differential Equations - 2

Euler’s Method

2nd approximation:

y2 = y1 + hf(x1, y1)

= 1.02 + (0.02)

(1.02 − 0.02

1.02 + 0.02

)= 1.0392

x2 = x1 + h = 0.02 + 0.02 = 0.04

Dr. N. B. Vyas Numerical Methods Ordinary Differential Equations - 2

Page 80: Numerical Methods - Oridnary Differential Equations - 2

Euler’s Method

2nd approximation:

y2 = y1 + hf(x1, y1)

= 1.02 + (0.02)

(1.02 − 0.02

1.02 + 0.02

)= 1.0392

x2 = x1 + h = 0.02 + 0.02 = 0.04

Dr. N. B. Vyas Numerical Methods Ordinary Differential Equations - 2

Page 81: Numerical Methods - Oridnary Differential Equations - 2

Euler’s Method

3rd approximation:

y3 = y2 + hf(x2, y2)

= 1.0392 + (0.02)

(1.0392 − 0.04

1.0392 + 0.04

)= 1.0577

x3 = x2 + h = 0.04 + 0.02 = 0.06

Dr. N. B. Vyas Numerical Methods Ordinary Differential Equations - 2

Page 82: Numerical Methods - Oridnary Differential Equations - 2

Euler’s Method

3rd approximation:

y3 = y2 + hf(x2, y2)

= 1.0392 + (0.02)

(1.0392 − 0.04

1.0392 + 0.04

)

= 1.0577

x3 = x2 + h = 0.04 + 0.02 = 0.06

Dr. N. B. Vyas Numerical Methods Ordinary Differential Equations - 2

Page 83: Numerical Methods - Oridnary Differential Equations - 2

Euler’s Method

3rd approximation:

y3 = y2 + hf(x2, y2)

= 1.0392 + (0.02)

(1.0392 − 0.04

1.0392 + 0.04

)= 1.0577

x3 = x2 + h = 0.04 + 0.02 = 0.06

Dr. N. B. Vyas Numerical Methods Ordinary Differential Equations - 2

Page 84: Numerical Methods - Oridnary Differential Equations - 2

Euler’s Method

3rd approximation:

y3 = y2 + hf(x2, y2)

= 1.0392 + (0.02)

(1.0392 − 0.04

1.0392 + 0.04

)= 1.0577

x3 = x2 + h = 0.04 + 0.02 = 0.06

Dr. N. B. Vyas Numerical Methods Ordinary Differential Equations - 2

Page 85: Numerical Methods - Oridnary Differential Equations - 2

Euler’s Method

4th approximation:

y4 = y3 + hf(x3, y3)

= 1.0577 + (0.02)

(1.0577 − 0.06

1.0577 + 0.06

)= 1.0755

x4 = x3 + h = 0.06 + 0.02 = 0.08

Dr. N. B. Vyas Numerical Methods Ordinary Differential Equations - 2

Page 86: Numerical Methods - Oridnary Differential Equations - 2

Euler’s Method

4th approximation:

y4 = y3 + hf(x3, y3)

= 1.0577 + (0.02)

(1.0577 − 0.06

1.0577 + 0.06

)= 1.0755

x4 = x3 + h = 0.06 + 0.02 = 0.08

Dr. N. B. Vyas Numerical Methods Ordinary Differential Equations - 2

Page 87: Numerical Methods - Oridnary Differential Equations - 2

Euler’s Method

4th approximation:

y4 = y3 + hf(x3, y3)

= 1.0577 + (0.02)

(1.0577 − 0.06

1.0577 + 0.06

)

= 1.0755

x4 = x3 + h = 0.06 + 0.02 = 0.08

Dr. N. B. Vyas Numerical Methods Ordinary Differential Equations - 2

Page 88: Numerical Methods - Oridnary Differential Equations - 2

Euler’s Method

4th approximation:

y4 = y3 + hf(x3, y3)

= 1.0577 + (0.02)

(1.0577 − 0.06

1.0577 + 0.06

)= 1.0755

x4 = x3 + h = 0.06 + 0.02 = 0.08

Dr. N. B. Vyas Numerical Methods Ordinary Differential Equations - 2

Page 89: Numerical Methods - Oridnary Differential Equations - 2

Euler’s Method

4th approximation:

y4 = y3 + hf(x3, y3)

= 1.0577 + (0.02)

(1.0577 − 0.06

1.0577 + 0.06

)= 1.0755

x4 = x3 + h = 0.06 + 0.02 = 0.08

Dr. N. B. Vyas Numerical Methods Ordinary Differential Equations - 2

Page 90: Numerical Methods - Oridnary Differential Equations - 2

Euler’s Method

4th approximation:

y4 = y3 + hf(x3, y3)

= 1.0577 + (0.02)

(1.0577 − 0.06

1.0577 + 0.06

)= 1.0755

x4 = x3 + h = 0.06 + 0.02 = 0.08

Dr. N. B. Vyas Numerical Methods Ordinary Differential Equations - 2

Page 91: Numerical Methods - Oridnary Differential Equations - 2

Euler’s Method

5th approximation:

y4 = y3 + hf(x3, y3)

= 1.0755 + (0.02)

(1.0755 − 0.08

1.0755 + 0.08

)= 1.0928

x5 = x4 + h = 0.08 + 0.02 = 1

∴ y(1) = 1.0928

Dr. N. B. Vyas Numerical Methods Ordinary Differential Equations - 2

Page 92: Numerical Methods - Oridnary Differential Equations - 2

Euler’s Method

5th approximation:

y4 = y3 + hf(x3, y3)

= 1.0755 + (0.02)

(1.0755 − 0.08

1.0755 + 0.08

)= 1.0928

x5 = x4 + h = 0.08 + 0.02 = 1

∴ y(1) = 1.0928

Dr. N. B. Vyas Numerical Methods Ordinary Differential Equations - 2

Page 93: Numerical Methods - Oridnary Differential Equations - 2

Euler’s Method

5th approximation:

y4 = y3 + hf(x3, y3)

= 1.0755 + (0.02)

(1.0755 − 0.08

1.0755 + 0.08

)

= 1.0928

x5 = x4 + h = 0.08 + 0.02 = 1

∴ y(1) = 1.0928

Dr. N. B. Vyas Numerical Methods Ordinary Differential Equations - 2

Page 94: Numerical Methods - Oridnary Differential Equations - 2

Euler’s Method

5th approximation:

y4 = y3 + hf(x3, y3)

= 1.0755 + (0.02)

(1.0755 − 0.08

1.0755 + 0.08

)= 1.0928

x5 = x4 + h = 0.08 + 0.02 = 1

∴ y(1) = 1.0928

Dr. N. B. Vyas Numerical Methods Ordinary Differential Equations - 2

Page 95: Numerical Methods - Oridnary Differential Equations - 2

Euler’s Method

5th approximation:

y4 = y3 + hf(x3, y3)

= 1.0755 + (0.02)

(1.0755 − 0.08

1.0755 + 0.08

)= 1.0928

x5 = x4 + h = 0.08 + 0.02 = 1

∴ y(1) = 1.0928

Dr. N. B. Vyas Numerical Methods Ordinary Differential Equations - 2

Page 96: Numerical Methods - Oridnary Differential Equations - 2

Euler’s Method

5th approximation:

y4 = y3 + hf(x3, y3)

= 1.0755 + (0.02)

(1.0755 − 0.08

1.0755 + 0.08

)= 1.0928

x5 = x4 + h = 0.08 + 0.02 = 1

∴ y(1) = 1.0928

Dr. N. B. Vyas Numerical Methods Ordinary Differential Equations - 2

Page 97: Numerical Methods - Oridnary Differential Equations - 2

Euler’s Method

Ex.: Find y(2) fordy

dx=

y

x, y(1) = 1.

using Euler’s method, take h = 0.2.

Dr. N. B. Vyas Numerical Methods Ordinary Differential Equations - 2

Page 98: Numerical Methods - Oridnary Differential Equations - 2

Ordinary Differential Equations

Modified Euler’s Method:

By Euler’s method

y1 = y0 + hf(x0, y0)

For better approximation y(1)1 of y1, we take

y(1)1 = y0 +

h

2[f(x0, y0) + f(x1, y1)]

where x1 = x0 + h

For still better approximation y(2)1 of y1,

y(2)1 = y0 +

h

2

[f(x0, y0) + f(x1, y

(2)1 )]

we repeat this process till two consecutive valuesof y agree.

Dr. N. B. Vyas Numerical Methods Ordinary Differential Equations - 2

Page 99: Numerical Methods - Oridnary Differential Equations - 2

Ordinary Differential Equations

Modified Euler’s Method:

By Euler’s method

y1 = y0 + hf(x0, y0)

For better approximation y(1)1 of y1, we take

y(1)1 = y0 +

h

2[f(x0, y0) + f(x1, y1)]

where x1 = x0 + h

For still better approximation y(2)1 of y1,

y(2)1 = y0 +

h

2

[f(x0, y0) + f(x1, y

(2)1 )]

we repeat this process till two consecutive valuesof y agree.

Dr. N. B. Vyas Numerical Methods Ordinary Differential Equations - 2

Page 100: Numerical Methods - Oridnary Differential Equations - 2

Ordinary Differential Equations

Modified Euler’s Method:

By Euler’s method

y1 = y0 + hf(x0, y0)

For better approximation y(1)1 of y1, we take

y(1)1 = y0 +

h

2[f(x0, y0) + f(x1, y1)]

where x1 = x0 + h

For still better approximation y(2)1 of y1,

y(2)1 = y0 +

h

2

[f(x0, y0) + f(x1, y

(2)1 )]

we repeat this process till two consecutive valuesof y agree.

Dr. N. B. Vyas Numerical Methods Ordinary Differential Equations - 2

Page 101: Numerical Methods - Oridnary Differential Equations - 2

Ordinary Differential Equations

Modified Euler’s Method:

By Euler’s method

y1 = y0 + hf(x0, y0)

For better approximation y(1)1 of y1, we take

y(1)1 = y0 +

h

2[f(x0, y0) + f(x1, y1)]

where x1 = x0 + h

For still better approximation y(2)1 of y1,

y(2)1 = y0 +

h

2

[f(x0, y0) + f(x1, y

(2)1 )]

we repeat this process till two consecutive valuesof y agree.

Dr. N. B. Vyas Numerical Methods Ordinary Differential Equations - 2

Page 102: Numerical Methods - Oridnary Differential Equations - 2

Ordinary Differential Equations

Modified Euler’s Method:

By Euler’s method

y1 = y0 + hf(x0, y0)

For better approximation y(1)1 of y1, we take

y(1)1 = y0 +

h

2[f(x0, y0) + f(x1, y1)]

where x1 = x0 + h

For still better approximation y(2)1 of y1,

y(2)1 = y0 +

h

2

[f(x0, y0) + f(x1, y

(2)1 )]

we repeat this process till two consecutive valuesof y agree.

Dr. N. B. Vyas Numerical Methods Ordinary Differential Equations - 2

Page 103: Numerical Methods - Oridnary Differential Equations - 2

Ordinary Differential Equations

Modified Euler’s Method:

By Euler’s method

y1 = y0 + hf(x0, y0)

For better approximation y(1)1 of y1, we take

y(1)1 = y0 +

h

2[f(x0, y0) + f(x1, y1)]

where x1 = x0 + h

For still better approximation y(2)1 of y1,

y(2)1 = y0 +

h

2

[f(x0, y0) + f(x1, y

(2)1 )]

we repeat this process till two consecutive valuesof y agree.

Dr. N. B. Vyas Numerical Methods Ordinary Differential Equations - 2

Page 104: Numerical Methods - Oridnary Differential Equations - 2

Ordinary Differential Equations

Modified Euler’s Method:

By Euler’s method

y1 = y0 + hf(x0, y0)

For better approximation y(1)1 of y1, we take

y(1)1 = y0 +

h

2[f(x0, y0) + f(x1, y1)]

where x1 = x0 + h

For still better approximation y(2)1 of y1,

y(2)1 = y0 +

h

2

[f(x0, y0) + f(x1, y

(2)1 )]

we repeat this process till two consecutive valuesof y agree.

Dr. N. B. Vyas Numerical Methods Ordinary Differential Equations - 2

Page 105: Numerical Methods - Oridnary Differential Equations - 2

Modified Euler’s Method

Once y1 is obtained to desired degree of accuracy,we find y2

y2 = y1 + hf(x1, y1)

For better approximation y(1)2 of y2, we take

y(1)2 = y1 +

h

2[f(x1, y1) + f(x2, y2)]

where x2 = x1 + h

For still better approximation y(2)2 of y2,

y(2)2 = y1 +

h

2

[f(x1, y1) + f(x2, y

(2)2 )]

we repeat this step until y2 becomes stationary.Then we proceed to calculate y3 in the same wayas above.

Dr. N. B. Vyas Numerical Methods Ordinary Differential Equations - 2

Page 106: Numerical Methods - Oridnary Differential Equations - 2

Modified Euler’s Method

Once y1 is obtained to desired degree of accuracy,we find y2y2 = y1 + hf(x1, y1)

For better approximation y(1)2 of y2, we take

y(1)2 = y1 +

h

2[f(x1, y1) + f(x2, y2)]

where x2 = x1 + h

For still better approximation y(2)2 of y2,

y(2)2 = y1 +

h

2

[f(x1, y1) + f(x2, y

(2)2 )]

we repeat this step until y2 becomes stationary.Then we proceed to calculate y3 in the same wayas above.

Dr. N. B. Vyas Numerical Methods Ordinary Differential Equations - 2

Page 107: Numerical Methods - Oridnary Differential Equations - 2

Modified Euler’s Method

Once y1 is obtained to desired degree of accuracy,we find y2y2 = y1 + hf(x1, y1)

For better approximation y(1)2 of y2, we take

y(1)2 = y1 +

h

2[f(x1, y1) + f(x2, y2)]

where x2 = x1 + h

For still better approximation y(2)2 of y2,

y(2)2 = y1 +

h

2

[f(x1, y1) + f(x2, y

(2)2 )]

we repeat this step until y2 becomes stationary.Then we proceed to calculate y3 in the same wayas above.

Dr. N. B. Vyas Numerical Methods Ordinary Differential Equations - 2

Page 108: Numerical Methods - Oridnary Differential Equations - 2

Modified Euler’s Method

Once y1 is obtained to desired degree of accuracy,we find y2y2 = y1 + hf(x1, y1)

For better approximation y(1)2 of y2, we take

y(1)2 = y1 +

h

2[f(x1, y1) + f(x2, y2)]

where x2 = x1 + h

For still better approximation y(2)2 of y2,

y(2)2 = y1 +

h

2

[f(x1, y1) + f(x2, y

(2)2 )]

we repeat this step until y2 becomes stationary.Then we proceed to calculate y3 in the same wayas above.

Dr. N. B. Vyas Numerical Methods Ordinary Differential Equations - 2

Page 109: Numerical Methods - Oridnary Differential Equations - 2

Modified Euler’s Method

Once y1 is obtained to desired degree of accuracy,we find y2y2 = y1 + hf(x1, y1)

For better approximation y(1)2 of y2, we take

y(1)2 = y1 +

h

2[f(x1, y1) + f(x2, y2)]

where x2 = x1 + h

For still better approximation y(2)2 of y2,

y(2)2 = y1 +

h

2

[f(x1, y1) + f(x2, y

(2)2 )]

we repeat this step until y2 becomes stationary.Then we proceed to calculate y3 in the same wayas above.

Dr. N. B. Vyas Numerical Methods Ordinary Differential Equations - 2

Page 110: Numerical Methods - Oridnary Differential Equations - 2

Modified Euler’s Method

Once y1 is obtained to desired degree of accuracy,we find y2y2 = y1 + hf(x1, y1)

For better approximation y(1)2 of y2, we take

y(1)2 = y1 +

h

2[f(x1, y1) + f(x2, y2)]

where x2 = x1 + h

For still better approximation y(2)2 of y2,

y(2)2 = y1 +

h

2

[f(x1, y1) + f(x2, y

(2)2 )]

we repeat this step until y2 becomes stationary.Then we proceed to calculate y3 in the same wayas above.

Dr. N. B. Vyas Numerical Methods Ordinary Differential Equations - 2

Page 111: Numerical Methods - Oridnary Differential Equations - 2

Modified Euler’s Method

Once y1 is obtained to desired degree of accuracy,we find y2y2 = y1 + hf(x1, y1)

For better approximation y(1)2 of y2, we take

y(1)2 = y1 +

h

2[f(x1, y1) + f(x2, y2)]

where x2 = x1 + h

For still better approximation y(2)2 of y2,

y(2)2 = y1 +

h

2

[f(x1, y1) + f(x2, y

(2)2 )]

we repeat this step until y2 becomes stationary.Then we proceed to calculate y3 in the same wayas above.

Dr. N. B. Vyas Numerical Methods Ordinary Differential Equations - 2

Page 112: Numerical Methods - Oridnary Differential Equations - 2

Modified Euler’s Method

Ex.: Solvedy

dx= x + y , y(0) = 1.

by Euler’s modified method for x = 0.1

correct upto four decimal places by taking h = 0.05.

Dr. N. B. Vyas Numerical Methods Ordinary Differential Equations - 2

Page 113: Numerical Methods - Oridnary Differential Equations - 2

Modified Euler’s Method

Sol.:

Here x0 = 0, y0 = 1, h = 0.05 anddy

dx= f(x, y) = x + y

x1 = x0 + h = 0 + 0.05 = 0.05

y1 = y0 + hf(x0, y0)

= 1 + (0.05)(1)

= 1.05

Dr. N. B. Vyas Numerical Methods Ordinary Differential Equations - 2

Page 114: Numerical Methods - Oridnary Differential Equations - 2

Modified Euler’s Method

Sol.:

Here x0 = 0, y0 = 1, h = 0.05 anddy

dx= f(x, y) = x + y

x1 = x0 + h = 0 + 0.05 = 0.05

y1 = y0 + hf(x0, y0)

= 1 + (0.05)(1)

= 1.05

Dr. N. B. Vyas Numerical Methods Ordinary Differential Equations - 2

Page 115: Numerical Methods - Oridnary Differential Equations - 2

Modified Euler’s Method

Sol.:

Here x0 = 0, y0 = 1, h = 0.05 anddy

dx= f(x, y) = x + y

x1 = x0 + h = 0 + 0.05 = 0.05

y1 = y0 + hf(x0, y0)

= 1 + (0.05)(1)

= 1.05

Dr. N. B. Vyas Numerical Methods Ordinary Differential Equations - 2

Page 116: Numerical Methods - Oridnary Differential Equations - 2

Modified Euler’s Method

Sol.:

Here x0 = 0, y0 = 1, h = 0.05 anddy

dx= f(x, y) = x + y

x1 = x0 + h = 0 + 0.05 = 0.05

y1 = y0 + hf(x0, y0)

= 1 + (0.05)(1)

= 1.05

Dr. N. B. Vyas Numerical Methods Ordinary Differential Equations - 2

Page 117: Numerical Methods - Oridnary Differential Equations - 2

Modified Euler’s Method

Sol.:

Here x0 = 0, y0 = 1, h = 0.05 anddy

dx= f(x, y) = x + y

x1 = x0 + h = 0 + 0.05 = 0.05

y1 = y0 + hf(x0, y0)

= 1 + (0.05)(1)

= 1.05

Dr. N. B. Vyas Numerical Methods Ordinary Differential Equations - 2

Page 118: Numerical Methods - Oridnary Differential Equations - 2

Modified Euler’s Method

1st approximation:

y(1)1 = y0 +

h

2[f(x0, y0) + f(x1, y1)]

= 1 + 0.052 [(0 + 1) + (0.05 + 1.05)] = 1.0525

2nd approximation:

y(2)1 = y0 +

h

2

[f(x0, y0) + f(x1, y

(1)1 )]

= 1 + 0.052 [(0 + 1) + (0.05 + 1.0525)] = 1.05256

∴ y1 = 1.05256 correct up to 4 decimal places.

Dr. N. B. Vyas Numerical Methods Ordinary Differential Equations - 2

Page 119: Numerical Methods - Oridnary Differential Equations - 2

Modified Euler’s Method

1st approximation:

y(1)1 = y0 +

h

2[f(x0, y0) + f(x1, y1)]

= 1 + 0.052 [(0 + 1) + (0.05 + 1.05)] = 1.0525

2nd approximation:

y(2)1 = y0 +

h

2

[f(x0, y0) + f(x1, y

(1)1 )]

= 1 + 0.052 [(0 + 1) + (0.05 + 1.0525)] = 1.05256

∴ y1 = 1.05256 correct up to 4 decimal places.

Dr. N. B. Vyas Numerical Methods Ordinary Differential Equations - 2

Page 120: Numerical Methods - Oridnary Differential Equations - 2

Modified Euler’s Method

1st approximation:

y(1)1 = y0 +

h

2[f(x0, y0) + f(x1, y1)]

= 1 + 0.052 [(0 + 1) + (0.05 + 1.05)] =

1.0525

2nd approximation:

y(2)1 = y0 +

h

2

[f(x0, y0) + f(x1, y

(1)1 )]

= 1 + 0.052 [(0 + 1) + (0.05 + 1.0525)] = 1.05256

∴ y1 = 1.05256 correct up to 4 decimal places.

Dr. N. B. Vyas Numerical Methods Ordinary Differential Equations - 2

Page 121: Numerical Methods - Oridnary Differential Equations - 2

Modified Euler’s Method

1st approximation:

y(1)1 = y0 +

h

2[f(x0, y0) + f(x1, y1)]

= 1 + 0.052 [(0 + 1) + (0.05 + 1.05)] = 1.0525

2nd approximation:

y(2)1 = y0 +

h

2

[f(x0, y0) + f(x1, y

(1)1 )]

= 1 + 0.052 [(0 + 1) + (0.05 + 1.0525)] = 1.05256

∴ y1 = 1.05256 correct up to 4 decimal places.

Dr. N. B. Vyas Numerical Methods Ordinary Differential Equations - 2

Page 122: Numerical Methods - Oridnary Differential Equations - 2

Modified Euler’s Method

1st approximation:

y(1)1 = y0 +

h

2[f(x0, y0) + f(x1, y1)]

= 1 + 0.052 [(0 + 1) + (0.05 + 1.05)] = 1.0525

2nd approximation:

y(2)1 = y0 +

h

2

[f(x0, y0) +

f(x1, y(1)1 )]

= 1 + 0.052 [(0 + 1) + (0.05 + 1.0525)] = 1.05256

∴ y1 = 1.05256 correct up to 4 decimal places.

Dr. N. B. Vyas Numerical Methods Ordinary Differential Equations - 2

Page 123: Numerical Methods - Oridnary Differential Equations - 2

Modified Euler’s Method

1st approximation:

y(1)1 = y0 +

h

2[f(x0, y0) + f(x1, y1)]

= 1 + 0.052 [(0 + 1) + (0.05 + 1.05)] = 1.0525

2nd approximation:

y(2)1 = y0 +

h

2

[f(x0, y0) + f(x1, y

(1)1 )]

= 1 + 0.052 [(0 + 1) + (0.05 + 1.0525)] = 1.05256

∴ y1 = 1.05256 correct up to 4 decimal places.

Dr. N. B. Vyas Numerical Methods Ordinary Differential Equations - 2

Page 124: Numerical Methods - Oridnary Differential Equations - 2

Modified Euler’s Method

1st approximation:

y(1)1 = y0 +

h

2[f(x0, y0) + f(x1, y1)]

= 1 + 0.052 [(0 + 1) + (0.05 + 1.05)] = 1.0525

2nd approximation:

y(2)1 = y0 +

h

2

[f(x0, y0) + f(x1, y

(1)1 )]

= 1 + 0.052 [(0 + 1) + (0.05 + 1.0525)] =

1.05256

∴ y1 = 1.05256 correct up to 4 decimal places.

Dr. N. B. Vyas Numerical Methods Ordinary Differential Equations - 2

Page 125: Numerical Methods - Oridnary Differential Equations - 2

Modified Euler’s Method

1st approximation:

y(1)1 = y0 +

h

2[f(x0, y0) + f(x1, y1)]

= 1 + 0.052 [(0 + 1) + (0.05 + 1.05)] = 1.0525

2nd approximation:

y(2)1 = y0 +

h

2

[f(x0, y0) + f(x1, y

(1)1 )]

= 1 + 0.052 [(0 + 1) + (0.05 + 1.0525)] = 1.05256

∴ y1 = 1.05256 correct up to 4 decimal places.

Dr. N. B. Vyas Numerical Methods Ordinary Differential Equations - 2

Page 126: Numerical Methods - Oridnary Differential Equations - 2

Modified Euler’s Method

x2 = x1 + h = 0.05 + 0.05 = 0.1

y2 = y1 + hf(x1, y1)

= 1.05256 + (0.05)(0.1 + 1.05256)

= 1.10769

Dr. N. B. Vyas Numerical Methods Ordinary Differential Equations - 2

Page 127: Numerical Methods - Oridnary Differential Equations - 2

Modified Euler’s Method

x2 = x1 + h = 0.05 + 0.05 = 0.1

y2 = y1 + hf(x1, y1)

= 1.05256 + (0.05)(0.1 + 1.05256)

= 1.10769

Dr. N. B. Vyas Numerical Methods Ordinary Differential Equations - 2

Page 128: Numerical Methods - Oridnary Differential Equations - 2

Modified Euler’s Method

x2 = x1 + h = 0.05 + 0.05 = 0.1

y2 = y1 + hf(x1, y1)

= 1.05256 + (0.05)(0.1 + 1.05256)

= 1.10769

Dr. N. B. Vyas Numerical Methods Ordinary Differential Equations - 2

Page 129: Numerical Methods - Oridnary Differential Equations - 2

Modified Euler’s Method

x2 = x1 + h = 0.05 + 0.05 = 0.1

y2 = y1 + hf(x1, y1)

= 1.05256 + (0.05)(0.1 + 1.05256)

= 1.10769

Dr. N. B. Vyas Numerical Methods Ordinary Differential Equations - 2

Page 130: Numerical Methods - Oridnary Differential Equations - 2

Modified Euler’s Method

1st approximation:

y(1)2 = y1 +

h

2[f(x1, y1) + f(x2, y2)]

=1.05256 + 0.05

2 [(0.05 + 1.05256) + (0.1 + 1.10769)]=

2nd approximation:

y(2)2 = y1 +

h

2

[f(x1, y1) + f(x2, y

(1)2 )]

∴ y2 = .... correct up to 4 decimal places.

Dr. N. B. Vyas Numerical Methods Ordinary Differential Equations - 2

Page 131: Numerical Methods - Oridnary Differential Equations - 2

Modified Euler’s Method

1st approximation:

y(1)2 = y1 +

h

2[f(x1, y1) + f(x2, y2)]

=1.05256 + 0.05

2 [(0.05 + 1.05256) + (0.1 + 1.10769)]=

2nd approximation:

y(2)2 = y1 +

h

2

[f(x1, y1) + f(x2, y

(1)2 )]

∴ y2 = .... correct up to 4 decimal places.

Dr. N. B. Vyas Numerical Methods Ordinary Differential Equations - 2

Page 132: Numerical Methods - Oridnary Differential Equations - 2

Modified Euler’s Method

1st approximation:

y(1)2 = y1 +

h

2[f(x1, y1) + f(x2, y2)]

=1.05256 + 0.05

2 [(0.05 + 1.05256) + (0.1 + 1.10769)]=

2nd approximation:

y(2)2 = y1 +

h

2

[f(x1, y1) + f(x2, y

(1)2 )]

∴ y2 = .... correct up to 4 decimal places.

Dr. N. B. Vyas Numerical Methods Ordinary Differential Equations - 2

Page 133: Numerical Methods - Oridnary Differential Equations - 2

Modified Euler’s Method

Ex.: Using modified Euler’s method , find y(0.2)and y(0.4) given that

dy

dx= y + ex, y(0) = 0

Dr. N. B. Vyas Numerical Methods Ordinary Differential Equations - 2

Page 134: Numerical Methods - Oridnary Differential Equations - 2

Modified Euler’s Method

Sol.:

Here x0 = 0, y0 = 0, h = 0.2 anddy

dx= f(x, y) = y + ex

x1 = x0 + h = 0.2

y1 = y0 + hf(x0, y0)

= 0 + (0.2)(0 + e0)

= 0.2

Dr. N. B. Vyas Numerical Methods Ordinary Differential Equations - 2

Page 135: Numerical Methods - Oridnary Differential Equations - 2

Modified Euler’s Method

Sol.:

Here x0 = 0, y0 = 0, h = 0.2 anddy

dx= f(x, y) = y + ex

x1 = x0 + h = 0.2

y1 = y0 + hf(x0, y0)

= 0 + (0.2)(0 + e0)

= 0.2

Dr. N. B. Vyas Numerical Methods Ordinary Differential Equations - 2

Page 136: Numerical Methods - Oridnary Differential Equations - 2

Modified Euler’s Method

Sol.:

Here x0 = 0, y0 = 0, h = 0.2 anddy

dx= f(x, y) = y + ex

x1 = x0 + h = 0.2

y1 = y0 + hf(x0, y0)

= 0 + (0.2)(0 + e0)

= 0.2

Dr. N. B. Vyas Numerical Methods Ordinary Differential Equations - 2

Page 137: Numerical Methods - Oridnary Differential Equations - 2

Modified Euler’s Method

Sol.:

Here x0 = 0, y0 = 0, h = 0.2 anddy

dx= f(x, y) = y + ex

x1 = x0 + h = 0.2

y1 = y0 + hf(x0, y0)

= 0 + (0.2)(0 + e0)

= 0.2

Dr. N. B. Vyas Numerical Methods Ordinary Differential Equations - 2

Page 138: Numerical Methods - Oridnary Differential Equations - 2

Modified Euler’s Method

1st approximation:

y(1)1 = y0 +

h

2[f(x0, y0) + f(x1, y1)]

= 0 + 0.22 [f(0, 0) + f(0.2, 0.2)] = 0.24214

2nd approximation:

y(2)1 = y0 +

h

2

[f(x0, y0) + f(x1, y

(1)1 )]

= 0 + 0.22 [f(0, 0) + f(0.2, 0.24214)] = 0.24635

Dr. N. B. Vyas Numerical Methods Ordinary Differential Equations - 2

Page 139: Numerical Methods - Oridnary Differential Equations - 2

Modified Euler’s Method

1st approximation:

y(1)1 = y0 +

h

2[f(x0, y0) + f(x1, y1)]

= 0 + 0.22 [f(0, 0) + f(0.2, 0.2)] = 0.24214

2nd approximation:

y(2)1 = y0 +

h

2

[f(x0, y0) + f(x1, y

(1)1 )]

= 0 + 0.22 [f(0, 0) + f(0.2, 0.24214)] = 0.24635

Dr. N. B. Vyas Numerical Methods Ordinary Differential Equations - 2

Page 140: Numerical Methods - Oridnary Differential Equations - 2

Modified Euler’s Method

1st approximation:

y(1)1 = y0 +

h

2[f(x0, y0) + f(x1, y1)]

= 0 + 0.22 [f(0, 0) + f(0.2, 0.2)] =

0.24214

2nd approximation:

y(2)1 = y0 +

h

2

[f(x0, y0) + f(x1, y

(1)1 )]

= 0 + 0.22 [f(0, 0) + f(0.2, 0.24214)] = 0.24635

Dr. N. B. Vyas Numerical Methods Ordinary Differential Equations - 2

Page 141: Numerical Methods - Oridnary Differential Equations - 2

Modified Euler’s Method

1st approximation:

y(1)1 = y0 +

h

2[f(x0, y0) + f(x1, y1)]

= 0 + 0.22 [f(0, 0) + f(0.2, 0.2)] = 0.24214

2nd approximation:

y(2)1 = y0 +

h

2

[f(x0, y0) + f(x1, y

(1)1 )]

= 0 + 0.22 [f(0, 0) + f(0.2, 0.24214)] = 0.24635

Dr. N. B. Vyas Numerical Methods Ordinary Differential Equations - 2

Page 142: Numerical Methods - Oridnary Differential Equations - 2

Modified Euler’s Method

1st approximation:

y(1)1 = y0 +

h

2[f(x0, y0) + f(x1, y1)]

= 0 + 0.22 [f(0, 0) + f(0.2, 0.2)] = 0.24214

2nd approximation:

y(2)1 = y0 +

h

2

[f(x0, y0) + f(x1, y

(1)1 )]

= 0 + 0.22 [f(0, 0) + f(0.2, 0.24214)] = 0.24635

Dr. N. B. Vyas Numerical Methods Ordinary Differential Equations - 2

Page 143: Numerical Methods - Oridnary Differential Equations - 2

Modified Euler’s Method

1st approximation:

y(1)1 = y0 +

h

2[f(x0, y0) + f(x1, y1)]

= 0 + 0.22 [f(0, 0) + f(0.2, 0.2)] = 0.24214

2nd approximation:

y(2)1 = y0 +

h

2

[f(x0, y0) + f(x1, y

(1)1 )]

= 0 + 0.22 [f(0, 0) + f(0.2, 0.24214)] =

0.24635

Dr. N. B. Vyas Numerical Methods Ordinary Differential Equations - 2

Page 144: Numerical Methods - Oridnary Differential Equations - 2

Modified Euler’s Method

1st approximation:

y(1)1 = y0 +

h

2[f(x0, y0) + f(x1, y1)]

= 0 + 0.22 [f(0, 0) + f(0.2, 0.2)] = 0.24214

2nd approximation:

y(2)1 = y0 +

h

2

[f(x0, y0) + f(x1, y

(1)1 )]

= 0 + 0.22 [f(0, 0) + f(0.2, 0.24214)] = 0.24635

Dr. N. B. Vyas Numerical Methods Ordinary Differential Equations - 2

Page 145: Numerical Methods - Oridnary Differential Equations - 2

Modified Euler’s Method

3rd approximation:

y(3)1 = y0 +

h

2

[f(x0, y0) + f(x1, y

(2)1 )]

= 0 + 0.22 [f(0, 0) + f(0.2, 0.24635)] = 0.24678

4th approximation:

y(4)1 = y0 +

h

2

[f(x0, y0) + f(x1, y

(3)1 )]

= 0 + 0.22 [f(0, 0) + f(0.2, 0.24678)] = 0.24681

Dr. N. B. Vyas Numerical Methods Ordinary Differential Equations - 2

Page 146: Numerical Methods - Oridnary Differential Equations - 2

Modified Euler’s Method

3rd approximation:

y(3)1 = y0 +

h

2

[f(x0, y0) + f(x1, y

(2)1 )]

= 0 + 0.22 [f(0, 0) + f(0.2, 0.24635)] = 0.24678

4th approximation:

y(4)1 = y0 +

h

2

[f(x0, y0) + f(x1, y

(3)1 )]

= 0 + 0.22 [f(0, 0) + f(0.2, 0.24678)] = 0.24681

Dr. N. B. Vyas Numerical Methods Ordinary Differential Equations - 2

Page 147: Numerical Methods - Oridnary Differential Equations - 2

Modified Euler’s Method

3rd approximation:

y(3)1 = y0 +

h

2

[f(x0, y0) + f(x1, y

(2)1 )]

= 0 + 0.22 [f(0, 0) + f(0.2, 0.24635)] =

0.24678

4th approximation:

y(4)1 = y0 +

h

2

[f(x0, y0) + f(x1, y

(3)1 )]

= 0 + 0.22 [f(0, 0) + f(0.2, 0.24678)] = 0.24681

Dr. N. B. Vyas Numerical Methods Ordinary Differential Equations - 2

Page 148: Numerical Methods - Oridnary Differential Equations - 2

Modified Euler’s Method

3rd approximation:

y(3)1 = y0 +

h

2

[f(x0, y0) + f(x1, y

(2)1 )]

= 0 + 0.22 [f(0, 0) + f(0.2, 0.24635)] = 0.24678

4th approximation:

y(4)1 = y0 +

h

2

[f(x0, y0) + f(x1, y

(3)1 )]

= 0 + 0.22 [f(0, 0) + f(0.2, 0.24678)] = 0.24681

Dr. N. B. Vyas Numerical Methods Ordinary Differential Equations - 2

Page 149: Numerical Methods - Oridnary Differential Equations - 2

Modified Euler’s Method

3rd approximation:

y(3)1 = y0 +

h

2

[f(x0, y0) + f(x1, y

(2)1 )]

= 0 + 0.22 [f(0, 0) + f(0.2, 0.24635)] = 0.24678

4th approximation:

y(4)1 = y0 +

h

2

[f(x0, y0) + f(x1, y

(3)1 )]

= 0 + 0.22 [f(0, 0) + f(0.2, 0.24678)] = 0.24681

Dr. N. B. Vyas Numerical Methods Ordinary Differential Equations - 2

Page 150: Numerical Methods - Oridnary Differential Equations - 2

Modified Euler’s Method

3rd approximation:

y(3)1 = y0 +

h

2

[f(x0, y0) + f(x1, y

(2)1 )]

= 0 + 0.22 [f(0, 0) + f(0.2, 0.24635)] = 0.24678

4th approximation:

y(4)1 = y0 +

h

2

[f(x0, y0) + f(x1, y

(3)1 )]

= 0 + 0.22 [f(0, 0) + f(0.2, 0.24678)] =

0.24681

Dr. N. B. Vyas Numerical Methods Ordinary Differential Equations - 2

Page 151: Numerical Methods - Oridnary Differential Equations - 2

Modified Euler’s Method

3rd approximation:

y(3)1 = y0 +

h

2

[f(x0, y0) + f(x1, y

(2)1 )]

= 0 + 0.22 [f(0, 0) + f(0.2, 0.24635)] = 0.24678

4th approximation:

y(4)1 = y0 +

h

2

[f(x0, y0) + f(x1, y

(3)1 )]

= 0 + 0.22 [f(0, 0) + f(0.2, 0.24678)] = 0.24681

Dr. N. B. Vyas Numerical Methods Ordinary Differential Equations - 2

Page 152: Numerical Methods - Oridnary Differential Equations - 2

Modified Euler’s Method

5th approximation:

y(5)1 = y0 +

h

2

[f(x0, y0) + f(x1, y

(4)1 )]

= 0.24682

∴ y1 = 0.24682 correct up to 4 decimal places.

Dr. N. B. Vyas Numerical Methods Ordinary Differential Equations - 2

Page 153: Numerical Methods - Oridnary Differential Equations - 2

Modified Euler’s Method

5th approximation:

y(5)1 = y0 +

h

2

[f(x0, y0) + f(x1, y

(4)1 )]

= 0.24682

∴ y1 = 0.24682 correct up to 4 decimal places.

Dr. N. B. Vyas Numerical Methods Ordinary Differential Equations - 2

Page 154: Numerical Methods - Oridnary Differential Equations - 2

Modified Euler’s Method

5th approximation:

y(5)1 = y0 +

h

2

[f(x0, y0) + f(x1, y

(4)1 )]

= 0.24682

∴ y1 = 0.24682 correct up to 4 decimal places.

Dr. N. B. Vyas Numerical Methods Ordinary Differential Equations - 2

Page 155: Numerical Methods - Oridnary Differential Equations - 2

Modified Euler’s Method

x2 = x1 + h = 0.4

y2 = y1 + hf(x1, y1)

= 0.24682 + (0.2)f(0.2, 0.24682)

= 0.54046

Dr. N. B. Vyas Numerical Methods Ordinary Differential Equations - 2

Page 156: Numerical Methods - Oridnary Differential Equations - 2

Modified Euler’s Method

x2 = x1 + h = 0.4

y2 = y1 + hf(x1, y1)

= 0.24682 + (0.2)f(0.2, 0.24682)

= 0.54046

Dr. N. B. Vyas Numerical Methods Ordinary Differential Equations - 2

Page 157: Numerical Methods - Oridnary Differential Equations - 2

Modified Euler’s Method

x2 = x1 + h = 0.4

y2 = y1 + hf(x1, y1)

= 0.24682 + (0.2)f(0.2, 0.24682)

= 0.54046

Dr. N. B. Vyas Numerical Methods Ordinary Differential Equations - 2

Page 158: Numerical Methods - Oridnary Differential Equations - 2

Modified Euler’s Method

x2 = x1 + h = 0.4

y2 = y1 + hf(x1, y1)

= 0.24682 + (0.2)f(0.2, 0.24682)

= 0.54046

Dr. N. B. Vyas Numerical Methods Ordinary Differential Equations - 2

Page 159: Numerical Methods - Oridnary Differential Equations - 2

Modified Euler’s Method

1st approximation:

y(1)2 = y1 +

h

2[f(x1, y1) + f(x2, y2)]

= 0.59687

2nd approximation:

y(2)2 = y1 +

h

2

[f(x1, y1) + f(x2, y

(1)2 )]

=0.60251

Dr. N. B. Vyas Numerical Methods Ordinary Differential Equations - 2

Page 160: Numerical Methods - Oridnary Differential Equations - 2

Modified Euler’s Method

1st approximation:

y(1)2 = y1 +

h

2[f(x1, y1) + f(x2, y2)]

= 0.59687

2nd approximation:

y(2)2 = y1 +

h

2

[f(x1, y1) + f(x2, y

(1)2 )]

=0.60251

Dr. N. B. Vyas Numerical Methods Ordinary Differential Equations - 2

Page 161: Numerical Methods - Oridnary Differential Equations - 2

Modified Euler’s Method

1st approximation:

y(1)2 = y1 +

h

2[f(x1, y1) + f(x2, y2)]

= 0.59687

2nd approximation:

y(2)2 = y1 +

h

2

[f(x1, y1) + f(x2, y

(1)2 )]

=0.60251

Dr. N. B. Vyas Numerical Methods Ordinary Differential Equations - 2

Page 162: Numerical Methods - Oridnary Differential Equations - 2

Modified Euler’s Method

1st approximation:

y(1)2 = y1 +

h

2[f(x1, y1) + f(x2, y2)]

= 0.59687

2nd approximation:

y(2)2 = y1 +

h

2

[f(x1, y1) + f(x2, y

(1)2 )]

=0.60251

Dr. N. B. Vyas Numerical Methods Ordinary Differential Equations - 2

Page 163: Numerical Methods - Oridnary Differential Equations - 2

Modified Euler’s Method

1st approximation:

y(1)2 = y1 +

h

2[f(x1, y1) + f(x2, y2)]

= 0.59687

2nd approximation:

y(2)2 = y1 +

h

2

[f(x1, y1) + f(x2, y

(1)2 )]

=0.60251

Dr. N. B. Vyas Numerical Methods Ordinary Differential Equations - 2

Page 164: Numerical Methods - Oridnary Differential Equations - 2

Modified Euler’s Method

3rd approximation:

y(3)2 = y1 +

h

2

[f(x1, y1) + f(x2, y

(2)2 )]

= 0.60308

4th approximation:

y(4)2 = y1 +

h

2

[f(x1, y1) + f(x2, y

(3)2 )]

= 0.60313

Dr. N. B. Vyas Numerical Methods Ordinary Differential Equations - 2

Page 165: Numerical Methods - Oridnary Differential Equations - 2

Modified Euler’s Method

3rd approximation:

y(3)2 = y1 +

h

2

[f(x1, y1) + f(x2, y

(2)2 )]

= 0.60308

4th approximation:

y(4)2 = y1 +

h

2

[f(x1, y1) + f(x2, y

(3)2 )]

= 0.60313

Dr. N. B. Vyas Numerical Methods Ordinary Differential Equations - 2

Page 166: Numerical Methods - Oridnary Differential Equations - 2

Modified Euler’s Method

3rd approximation:

y(3)2 = y1 +

h

2

[f(x1, y1) + f(x2, y

(2)2 )]

= 0.60308

4th approximation:

y(4)2 = y1 +

h

2

[f(x1, y1) + f(x2, y

(3)2 )]

= 0.60313

Dr. N. B. Vyas Numerical Methods Ordinary Differential Equations - 2

Page 167: Numerical Methods - Oridnary Differential Equations - 2

Modified Euler’s Method

3rd approximation:

y(3)2 = y1 +

h

2

[f(x1, y1) + f(x2, y

(2)2 )]

= 0.60308

4th approximation:

y(4)2 = y1 +

h

2

[f(x1, y1) + f(x2, y

(3)2 )]

= 0.60313

Dr. N. B. Vyas Numerical Methods Ordinary Differential Equations - 2

Page 168: Numerical Methods - Oridnary Differential Equations - 2

Modified Euler’s Method

5th approximation:

y(5)2 = y1 +

h

2

[f(x1, y1) + f(x2, y

(4)2 )]

= 0.60314

∴ y2 = 0.60314 correct up to 4 decimal places.

Dr. N. B. Vyas Numerical Methods Ordinary Differential Equations - 2

Page 169: Numerical Methods - Oridnary Differential Equations - 2

Modified Euler’s Method

5th approximation:

y(5)2 = y1 +

h

2

[f(x1, y1) + f(x2, y

(4)2 )]

= 0.60314

∴ y2 = 0.60314 correct up to 4 decimal places.

Dr. N. B. Vyas Numerical Methods Ordinary Differential Equations - 2

Page 170: Numerical Methods - Oridnary Differential Equations - 2

Modified Euler’s Method

5th approximation:

y(5)2 = y1 +

h

2

[f(x1, y1) + f(x2, y

(4)2 )]

= 0.60314

∴ y2 = 0.60314 correct up to 4 decimal places.

Dr. N. B. Vyas Numerical Methods Ordinary Differential Equations - 2


Recommended