Date post: | 09-Jan-2017 |

Category: |
## Education |

Upload: | dr-nirav-vyas |

View: | 785 times |

Download: | 2 times |

Share this document with a friend

of 170
/170

Transcript

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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 )]

Dr. N. B. Vyas Numerical Methods Ordinary 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 )]

Dr. N. B. Vyas Numerical Methods Ordinary 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 )]

Dr. N. B. Vyas Numerical Methods Ordinary 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 )]

Dr. N. B. Vyas Numerical Methods Ordinary 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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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