4. 26 Numerical Methods Predictor and Corrector Methods

13
4. 26 Numerical Methods 4 0 0 3 0 3 , , k hf x hy k z (0.1) 0.1,0.9951, 0.0995 f (0.1)( 0.0995) 0.00995 4 0 0 3 0 3 , , hg x hy k z (0.1) 0.1,0.9951, 0.0995 g (0.1) (0.1)( 0.0995) 0.9951 0.0985 1 2 3 4 1 2 2 6 y k k k k 1 0 2( 0.005) 2( 0.0049) ( 0.00995) 0.00496 6 The solution is 0 0 ( ) yx h y y (0.1) 1 0.00496 0.995 y Do Yourself: Solve dy xy dx given that (0.1) 2 y , compute (1.2) y and (1.4) y by using R-K method of fourth order. (A/M 2018) Predictor and Corrector Methods 1, 3 2 1 4 2 2 3 n p n n n n h y y y y y Corrector Formula: 1, 1 1 1 4 3 n c n n n n h y y y y y

Transcript of 4. 26 Numerical Methods Predictor and Corrector Methods

4. 26 Numerical Methods

4 0 0 3 0 3, ,k h f x h y k z

(0.1) 0.1,0.9951, 0.0995f

(0.1)( 0.0995) 0.00995

4 0 0 3 0 3, ,h g x h y k z

(0.1) 0.1,0.9951, 0.0995g

(0.1) (0.1)( 0.0995) 0.9951 0.0985

1 2 3 41

2 26

y k k k k

10 2( 0.005) 2( 0.0049) ( 0.00995) 0.00496

6

The solution is 0 0( )y x h y y

(0.1) 1 0.00496 0.995y

Do Yourself:

Solve dy

xydx

given that (0.1) 2y , compute (1.2)y and

(1.4)y by using R-K method of fourth order. (A/M 2018)

Predictor and Corrector Methods

1, 3 2 14

2 23n p n n n nh

y y y y y

Corrector Formula:

1, 1 1 143n c n n n nh

y y y y y

4. 27 Initial Value Problems for ODE

Problem 4.14:

Given 2dyx y

dx, (0) 0, (0.2) 0.02, (0.4) 0.0795y y y

and (0.6) 0.1762y . Compute (0.8)y

(N/D 2016)

Solution:

Given 2dyx y

dx, (0) 0, (0.2) 0.02, (0.4) 0.0795y y y

and (0.6) 0.1762y .

2y x y and 0.2h .

0 0x 0 0y

1 0.2x 1 0.02y

2 0.4x 2 0.0795y

3 0.6x 3 0.1762y

4 0.8x 4 ?y Predictor Formula:

4, 0 1 2 34

2 23ph

y y y y y

2 21 1 1 0.2 (0.02) 0.1996y x y

2 22 2 2 0.4 (0.0795) 0.3937y x y

2 23 3 3 0.6 (0.1762) 0.569y x y

Substituting in (1), we get

4,4(0.2)

0 2(0.1996) (0.3937) 2(0.569)3py

4, 0 0.3049 0.3049py

4. 28 Numerical Methods

Corrector Formula:

4, 2 2 3 443ch

y y y y y

2 24 4 4 0.8 (0.3049) 0.707y x y

Substituting in (2), we get

4,0.2

0.0795 0.3937 4(0.569) 0.7073cy

4, 0.0795 0.2251 0.3046cy

(0.8) 0.3046y

Problem 4.15:

corrector formula to find (0.4)y , given 2 2(1 )

2

dy x y

dx, (0) 1, (0.1) 1.06, (0.2) 1.12y y y and

(0.3) 1.21y . (A/M 2010)

Or

Given that 2 21(1 ) ;

2

dyx y

dx (0) 1; (0.1) 1.06;y y

(0.2) 1.12y and (0.3) 1.21y . Evaluate (0.4)y

predictor corrector method. (N/D 2011),(N/D 2018)

Solution:

Given 2 21(1 )

2

dyx y

dx, (0) 1, (0.1) 1.06, (0.2) 1.12y y y

and (0.3) 1.21y .

2 21(1 )

2y x y and 0.1h .

4. 29 Initial Value Problems for ODE

0 0x 0 2y

1 0.1x 1 2.073y

2 0.2x 2 2.452y

3 0.3x 3 3.023y

4 0.4x 4 ?y

4, 0 1 2 34

2 23ph

y y y y y

2 2 2 21 1 1

1 11 1 (0.1) (1.06) 0.5674

2 2y x y

2 2 2 22 2 2

1 11 1 (0.2) (1.12) 0.6523

2 2y x y

2 2 2 23 3 3

1 11 1 (0.3) (1.21) 0.7979

2 2y x y

Substituting in (1), we get

4,4(0.1)

1 2(0.5674) (0.6523) 2(0.7979)3py

4, 1 0.2771 1.2771py

Corrector Formula:

4, 2 2 3 443ch

y y y y y

2 2 2 24 4 4

1 11 1 (0.4) (1.2771) 0.9460

2 2y x y

Substituting in (2), we get

4,0.1

1.12 0.6523 4(0.7979) 0.94603cy

4. 30 Numerical Methods

4, 1.12 0.1597 1.2797cy

(0.4) 1.2797y

Problem 4.16:

Given 25 2 0xy y , (4) 1,y (4.1) 1.0049,y

(4.2) 1.0097y and (4.3) 1.0143y . Compute (4.4)y using

(N/D 2014),(A/M 2015)

Solution:

Given 25 2 0xy y , (4) 1,y (4.1) 1.0049,y

(4.2) 1.0097y and (4.3) 1.0143y .

22

5

yy

x and 0.1h .

0 4x 0 1y

1 4.1x 1 1.0049y

2 4.2x 2 1.0097y

3 4.3x 3 1.0143y

4 4.4x 4 ?y

4, 0 1 2 34

2 23ph

y y y y y

2 21

11

2 2 (1.0049)0.0483

5 5(4.1)

yy

x

2 22

22

2 2 (1.0097)0.0467

5 5(4.2)

yy

x

2 23

33

2 2 (1.0143)0.0452

5 5(4.3)

yy

x

4. 31 Initial Value Problems for ODE

Substituting in (1), we get

4,4(0.1)

1 2(0.0483) (0.0467) 2(0.0452)3py

4, 1 0.0187 1.0187py

Corrector Formula:

4, 2 2 3 443ch

y y y y y

2 24

44

2 2 (1.0187)0.0437

5 5(4.4)

yy

x

Substituting in (2), we get

4,0.1

1.0097 0.0467 4(0.0452) 0.04373cy

4, 1.0097 0.009 1.0187cy

(4.4) 1.0187y

Problem 4.17:

Given 2dyxy y

dx, (0) 1y , (0.1) 1.1169y and

(0.2) 1.2773y , find (i) (0.3)y by R-K method of fourth order

and (ii) (0.4)y

(N/D 2017),(A/M 2018)

Solution:

Given 2dyxy y

dx, (0) 1, (0.1) 1.1169, (0.2) 1.2773y y y .

2y xy y and 0.1h .

4. 32 Numerical Methods

i) R-K Method

(0.3) 1.5023y

ii)

0 0x 0 1y

1 0.1x 1 1.1169y

2 0.2x 2 1.2773y

3 0.3x 3 1.5023y

4 0.4x 4 ?y

4, 0 1 2 34

2 23ph

y y y y y

2 21 1 1 1 (0.1)(1.1169) (1.1169) 1.3587y x y y

2 22 2 2 2 (0.2)(1.2773) (1.2773) 1.8853y x y y

2 23 3 3 3 (0.3)(1.5023) (1.5023) 2.7076y x y y

Substituting in (1), we get

4,4(0.1)

1 2(1.3587) (1.8853) 2(2.7076)3py

4, 1.8330py

Corrector Formula:

4, 2 2 3 443ch

y y y y y

2 24 4 4 4 (0.4)(1.8330) (1.8330) 4.0930y x y y

4. 33 Initial Value Problems for ODE

Substituting in (2), we get

4,0.1

1.2773 1.8853 4(2.7076) 4.09303cy

4, 1.8370cy

(0.4) 1.8370y

Problem 4.18:

Using Runge Kutta method of fourth order, find the value of y

at 0.2, 0.4, 0.6x given 3 , (0) 2dy

x y ydx

. Also find the

value of y at 0.8x

method. (M/J 2014)

Solution:

Given 3dyx y

dx, (0) 2y .

3( , )f x y x y and (0) 2y .

0 00, 2x y and 0.2h .

i) R-K Method First Formula:

1 0 0( , ) 0.2 (0,2)k h f x y f

30.2 (0) 2

0.4

12 0 0,

2 2

khk h f x y

0.2 0.40.2 0 , 2

2 2f

0.2 (0.1, 2.2)f

4. 34 Numerical Methods

30.2 (0.1) 2.2 0.4402

23 0 0,

2 2

khk h f x y

0.2 0.44020.2 0 , 2

2 2f

0.2 (0.1, 2.2201)f

30.2 (0.1) 2.2201 0.4442

4 0 0 3,k h f x h y k

0.2 0 0.2, 2 0.4442f

0.2 (0.2, 2.4442)f

30.2 (0.2) 2.4442 0.4904

1 2 3 41

2 26

y k k k k

10.4 2(0.4402) 2(0.4442) 0.4904

6

12.6592 0.4432

6

1 0(0.2)y y y y 2 0.4432

(0.2) 2.4432y

1 10.2, 2.4432x y

ii) R-K Method Second Formula:

1 1 1( , ) 0.2 (0.2, 2.4432)k h f x y f

4. 35 Initial Value Problems for ODE

30.2 (0.2) 2.4432

0.4902

12 1 1,

2 2

khk h f x y

0.2 0.49020.2 0.2 , 2.4432

2 2f

0.2 (0.3, 2.6883)f

30.2 (0.3) 2.6883 0.5431

23 1 1,

2 2

khk h f x y

0.2 0.54310.2 0.2 , 2.4432

2 2f

0.2 (0.3, 2.7148)f

30.2 (0.3) 2.7148 0.5484

4 1 1 3,k h f x h y k

0.2 0.2 0.2, 2.4432 0.5484f

0.2 (0.4, 2.9916)f

30.2 (0.4) 2.9916 0.6111

1 2 3 41

2 26

y k k k k

10.4902 2(0.5431) 2(0.5484) 0.6111

6

13.2843 0.5474

6

4. 36 Numerical Methods

2 1(0.4)y y y y 2.4432 0.5474

(0.4) 2.9906y

2 20.4, 2.9906x y

iii) R-K Method Third Formula:

1 2 2( , ) 0.2 (0.4, 2.9906)k h f x y f

30.2 (0.4) 2.9906

0.6109

12 2 2,

2 2

khk h f x y

0.2 0.61090.2 0.4 , 2.9906

2 2f

0.2 (0.5, 3.2961)f

30.2 (0.5) 3.2961 0.6842

23 2 2,

2 2

khk h f x y

0.2 0.68420.2 0.4 , 2.9906

2 2f

0.2 (0.5, 3.3327)f

30.2 (0.5) 3.3327 0.6915

4 2 2 3,k h f x h y k

0.2 0.4 0.2, 2.9906 0.6915f

0.2 (0.6, 3.6821)f

4. 37 Initial Value Problems for ODE

30.2 (0.6) 3.6821 0.7796

1 2 3 41

2 26

y k k k k

10.6109 2(0.6842) 2(0.6915) 0.7796

6

14.1419 0.6903

6

3 2(0.6)y y y y 2.9906 0.6903

(0.6) 3.6809y

3 30.6, 3.6809x y

iv)

0 0x 0 2y

1 0.2x 1 2.4432y

2 0.4x 2 2.9906y

3 0.6x 3 3.6809y

4 0.8x 4 ?y

4, 0 1 2 34

2 23ph

y y y y y

3 31 1 1 (0.2) 2.4432 2.4512y x y

3 32 2 2 (0.4) 2.9906 3.0546y x y

3 33 3 3 (0.6) 3.6809 3.8969y x y

Substituting in (1), we get

4. 38 Numerical Methods

4,4(0.2)

2 2(2.4512) (3.0546) 2(3.8969)3py

4, 2 2.5711 4.5711py

Corrector Formula:

4, 2 2 3 443ch

y y y y y 2)

3 34 4 4 (0.8) 4.5711 5.0831y x y

Substituting in (2), we get

4,0.2

2.9906 3.0546 4(3.8969) 5.08313cy

4, 2.9906 1.5817 4.5723cy

(0.8) 4.5723y

Do yourself:

1) Given 1

,yx y

(0) 2,y (0.2) 2.0933,y

(0.4) 2.1755,y (0.6) 2.2493y find (0.8)y using

(M/J 2012)

2) Given that 21dy

ydx

; (0.6) 0.6841,y

(0.4) 0.4228,y

(0.2) 0.2027,y (0) 0y , find ( 0.2)y

method. (N/D 2012)