A textbook of Computer Based Numerical and Statiscal Techniques part 36 docx

10 316 0
A textbook of Computer Based Numerical and Statiscal Techniques part 36 docx

Đang tải... (xem toàn văn)

Thông tin tài liệu

336 COMPUTER BASED NUMERICAL AND STATISTICAL TECHNIQUES () ( ) () () () () () () () () 23 4 5 .2 .2 .2 .2 .4 .21 .2 1.084 .8536 4.67744 6.992576 40.21655 2 6 24 120 y =+ + + + + = .45068 = .451. Ans. 7.3 PICARD’S METHOD OF SUCCESSIVE APPROXIMATIONS Consider first order differential equation () , dy fxy dx = (1) with the initial condition 0 yy= at 0 xx= Integrating (1) with respect to x between x 0 and x, we have () 00 , yx yx dy f x y dx = ∫∫ or () 0 0 , x x yy xydx = ∫ (2) Now, we solve (2) by the method of successive approximation to find out the solution of (1). The first approximate solution (approximation) 1 y of y is given by () 0 10 0 , x x yy fxydx =+ ∫ Similarly, the second approximation y 2 is given by y 2 = y 0 + z fxy dx x x , 1 0 bg for the nth aproximation y n is given by y n = y 0 + fxy dx n x x , –1 0 bg z (3) with () 00 yx y = . Hence, this method gives a sequence of approximation 12 , yy n y and it can be proved () ,fxy is bounded in some regions containing the point 00 (,) xy and if () ,fxy satisfies the Lipchitz condition, namely () () ,, ,fxy fxy kyy −≤− where k is a constant. Then the sequence 12 , yy converges to the sol. (2). Example 6. Use Picard’s method to obtain y for x = 0.2. Given dy xy dx =− with initial condition y = 1 when x = 0. NUMERICAL SOLUTION OF ORDINARY DIFFERENTIAL EQUATION 337 Sol. Here, () ,,fxy x y =− 0 0, x = 0 1 y = We have first approximation, () () 10 0 00 ,1 1 xx yy fxydx x dx =+ =+ − ∫∫ = 1 – x + x 2 2 Second approximation, () ( ) 20 1 1 00 ,1 xx yy fxydx xydx =+ =+ − ∫∫ 2 0 11 2 x x xx dx  =+ −+ −   ∫ =−+ − 3 2 1 6 x xx Third approximation, y 3 = y f x y dx x y dx xx 02 0 2 0 1 +=+ zz ,– bg b g = 11 6 2 3 0 +++ F H G I K J z xxx x dx x –– =1 – x + x 2 – xx 34 624 + Fourth approximation, y 4 = () ( ) 03 3 00 ,1 xx y f x y dx x y dx +=+− ∫∫ = 34 2 0 11 324 x xx xxx dx  +−+−+−   ∫ = 34 5 2 1 312120 xx x xx−+ − + − Fifth Approximation, y 5 = () ( ) 04 4 00 ,1 xx y f x y dx x y dx +=+− ∫∫ = 34 5 2 0 11 3 12 120 x xx x xxx dx  +−+−+−+   ∫ = 345 6 2 1 3 12 60 720 xxx x xx−+ − + − + When 0.2,x = we get 1 .82, y = 2 .83867, y = 3 .83740 y = 4 .83746, y = 5 .83746 y = Thus, .837y = when .2x = . Ans. 338 COMPUTER BASED NUMERICAL AND STATISTICAL TECHNIQUES Example 7. Find the solution of dy =1+ xy, y(0) = 1 dx which passess through (0, 1) in the interval (0, 0.5) such that the value of y is correct to three decimal places (use the whole interval as one interval only) Take h = 0.1. Sol. The given initial value problem is () () ,1;01 dy fxy xy y dx ==+ = i.e., 0 1 yy== at x = x 0 = 0 Here, 2 1 1 2 x yx=++ =++ + + 234 2 1 238 xxx yx 25634 3 1 23 8 1548 xxxxx yx=+ + + + + + 78 43 105 384 xx yy=+ + When 0, 1.000xy== 12 0.1, 1.105, 1.1053 xy y== = ∴ 1.105y= 12 3 0.2, 1.220, 1.223 xy y y=+ == (correct up to 3 decimals) ∴ 1.223y= 0.3, 1.355xy== as 23 1.355 yy== (correct up to 3 decimals) 0.4, 1.505xy== 0.5, 1.677xy== as 43 1.677 yy== Thus, x 0 0.1 0.2 0.3 0.4 0.5 y 1.000 1.105 1.223 1.355 1.505 1.677 We have numerically solved the given differential equation for 0.1, 0.2, 0.3, 0.4x = and 0.5. Example 8. Using Picard’s method of successive approximation to with y(0) = 0, obtain y(.25), y(.3) and y(1) correct to 3 decimal places. Sol. Here, () = + 2 2 ,, 1 x fxy y 0 0 x = and 0 0 y = . The first approximation 1 y of y is given by 23 1 0 0 01 3 x xx ydx =+ = + ∫ NUMERICAL SOLUTION OF ORDINARY DIFFERENTIAL EQUATION 339 Similarly, the second approximation 2 y of y is given by () 2 2 2 30 0 1/3 x x ydx x =+ + ∫ 3 1 tan 3 x − = 3 33 1 333 xx  =− +   3 . 3 x ≈ We see that 1 y and 2 y agree to first term, namely 3 3 x . Neglecting 9 81 x , we obtain the range in which the result is correct to 3 decimal places, i.e., we put 9 1 .0005 81 x ≤ which yield x ≤ .7. Hence, we obtain () () 3 1 .25 .25 .005 3 y == () () 3 1 .5 .5 .042 3 y == () () 3 3 111 1 1 .321 333 y  =− =   . Ans. Example 9. Use Picard’s method to obtain y for x = 0.1. Given that 2 dy =3x+y ;y=1 dx at x = 0. Sol. Here () =+ = = 2 00 ,3 ; 0, 1 fxy x y x y First approximation, () 10 0 0 , x yy fxydx =+ ∫ () 0 131 x xdx =+ + ∫ = 1 + x + 3 2 2 x Second approximation, 234 5 2 543 9 1 23420 y xxxx x=+++++ Third approximation, 23 4 5 6 7 3 5 2325681157 12 2 12 12 45 1260 yxxxxxx x=+++++++ 8 9 10 11 17 47 27 81 32 240 400 4400 xxx x++ + + When, 0.1,x = we have 1 1.115, y = 2 1.1264, y = 3 1.12721 y = Thus, 1.127y= when 0.1x= . Ans. 340 COMPUTER BASED NUMERICAL AND STATISTICAL TECHNIQUES Example 10. Obtain y when x = 0.1, x = 0.2 Given that ; dy xy dx =+ y(0) = 1, Check the result with exact value. Sol. We have, () 0 ,;0 dy fxy x yx dx ==+= and 0 1 y = Now First approximation, () 2 1 0 11 1 2 x x yxdxx =+ + =+ + ∫ Second approximation, 23 2 2 0 11 1 26 x xx yxxdxxx  =+ +++ =++ +   ∫ Third approximation, 34 2 3 1 324 xx yxx=++ + + When .1,x = 1 1.105 y = 2 1.11016 y = 3 1.11033 y = (closer appr.) When .2x = 3 1.2427 y = We can continue further to get the better approximations. Now we shall obtain exact value. dy yx dx −= is the given differential equation. General sol. is () 1 xx ye e x c −− =− + + () x IF e − = Putting 1, 0yx== we obtain, 2.c= ∴ 12 x yx e =− − + When 0.1, 1.11034xy== and 0.2, 1.24281xy== These results reveal that the approximations obtained for 0.1x= is correct to four decimal places while that for 0.2x= is correct to 3 decimal places. Example 11. If dy y x dx y x − = + . Find the value of y at x = 0.1 using Picard’s method. Given that y(0) = 1. Sol. First approximation, 0 10 00 0 1 1 1 xx yx x y y dx dx yx x  −− =+ =+  ++  ∫∫ 0 2 11 1 x dx x  =+ −  +  ∫ () 12log1xx =−+ + NUMERICAL SOLUTION OF ORDINARY DIFFERENTIAL EQUATION 341 Second approximation, () 2 0 12 12log1 x xdx yx x =+− =+ ∫ which is difficult to integrate. Thus, when, () 1 0.1, 1 0.1 2log 1.1 0.9828 xy ==−+ = . Ans. Here in this example, only I approximation can be obtained and so it gives that approximate value of y for 0.1x= Example 12. Find the series expansion that gives y as a function of x in the neighbourhood of x = 0, when 22 , dy xy dx =+ with y(0) = 0. Sol. Here, () 22 0 ,,0 fxy x y x =+ = and 0 0. y = The nth approximation n y of y is given by () 0 01 , x nn x yy fxy dx − =+ ∫ As an initial approximation, it is given that 0 0. y = Then, the first approximation 1 y is given by () 3 2 1 0 00 3 x x yxdx =+ + = ⋅ ∫ Similarly, the second approximation 2 y is given by 2 337 2 2 0 0 3363 x xxx yxdx    =+ + = + ⋅     ∫ Likewise, the higher order approximations are given as 2 3 7 3 7 11 15 2 3 0 2 0 3 63 3 63 2079 59535 x xx xx x x yx dx    =+ + + = + + + +     ∫ yx xx x x dx x 4 2 3 7 11 15 2 0 0 363 2 2079 59535 =+ + + + + F H G I K J F H G G I K J J z =+ + + + 1 3 1 63 2 2079 13 218295 3 7 11 15 xx x x If the series is truncated after the third term and used to approximate y to 4 decimal places, then using the first neglected term, namely 13 218295 15 x as an approximation of the error, we have. 13 218295 15 x ≤ .00005. Taking logarithm, we obtain 15 log x ≤ log .00005 218295 13 afa f or x ≤ .988. 342 COMPUTER BASED NUMERICAL AND STATISTICAL TECHNIQUES Thus, xx x 37 11 363 2 2079 ++ represents y correct to 4 decimal places. In the range |x| ≤ .988. i.e. –0.988 ≤ x ≤ 0.988. Example 13. Integrate the differential equation dy dx = x sin πy with y = 1 2 at x = 0, by Picard’s method of successive approximations. y=y 0 + fxydx x x , bg 0 z . (1) Sol. The first approximation y 1 of y is obtained by substituting y = 1 2 In the right hand member of (1) i.e., we have y 1 = 1 2 1 2 0 + F H G I K J z xdx x sin .π = 1 22 2 + x . Similarly, the second and third approximation y 2 and y 3 are given as y 2 = 1 2 1 2 2 0 + + R S | T | U V | W | z x x dx x sin .π ej = 1 22 0 2 + z x x dx x cos π = 1 2 1 8 24 0 ++ F H G I K J z x x dx x – π = 1 22 48 226 ++ xx – π and y 3 = 1 2 1 22 48 1 228 226 226 00 ++++ F H G I K J R S | T | U V | W | zz x xx x xx dx xx sin – cos –π π π π = 1 2 1 1 22 48 226 2 0 + F H G I K J + R S | T | U V | W | z x xx dx x – – ππ = 1 22 48 226 ++ xx – π We observe that y 2 agree with y 3 upto and including term in x 6 . We can use the relation y = 1 22 2 + x with the knowledge that the error is approximately –x 6 5 . Thus, we can find y 1 and y 2 correct to 4 decimal places with h = 0.1. 7.4 EULER’S METHOD The oldest and simplest method was derived by Euler. In this method, we determine the change ∆y is y corresponding to small increment in the argument x . Consider the differential equation. () , dy fxy dx = (1) with the initial condition () 00 . yx y = NUMERICAL SOLUTION OF ORDINARY DIFFERENTIAL EQUATION 343 Integrating (1) w.r.t. x between 0 x and 1 x , we get () 11 00 , yx yx dy f x y dx = ∫∫ () 1 0 10 , x x yy fxydx =+ ∫ (2) Now, replacing () ,fxy by the approximation () 00 ,, fx y we get () 1 0 10 00 , x x yy fxydx =+ ∫ ()( ) 00010 , yfxyxx =+ − () 10 00 , yyhfxy =+ (3 x 1 – x 0 = ∆x = h) This is the formula for first approximation y 1 of y. Similarly, second approximation y 2 is given by () 21 11 , yyhfxy =+ In general, () 1 , nn nn yyhfxy + =+ 7.5 EULER’S MODIFIED METHOD Instead of approximating () ,fxy by () 00 , fx y in equation (2). Let the integral is approximated by Trapezoidal rule to botain. [] 00 11 10 (,) ( ) 2 h fx y fxy yy + =+ We obtain the iteration formula, () () () 1 0001 11 ,, 2 nn h yy fxyfxy +  =+ +   =0,1, 2 n where, y 1 (n) is the nth approximation to y 1 . The above iteration formula can be started by y 1 (1) from Euler’s method. y 1 (0) = y 0 + h(x 0 ,y 0 ) Example 14. Using Euler’s method, compute y(0.5) for differential equation 22 , dy yx dx =− with y = 1 when x = 0 Sol. Let 0.5 0.1 5 h == () 22 00 0, 1, , xyfxyyx == =− Using Euler’s method we have () 1 , nn nn yyhfxy + =+ 344 COMPUTER BASED NUMERICAL AND STATISTICAL TECHNIQUES But considering 0,1, 2,n= in succession, we get () 10 00 , yyhfxy =+ () 2 1 0.1 1 0 1.10000 =+ − = () 21 11 , yyhfxy =+ = ()()  +−  22 1.10000 0.1 1.10000 0.1 1.22000= () 32 22 , yyhfxy =+ ()() 22 1.22000 0.1 1.22 0.2  =+ −  1.36484= () 43 33 , yyhfxy =+ () 2 2 1.36484 0.1[(1.36484) _ 0.3 ] =+ 1.54212= () 54 44 , yyhfxy =+ ()()  =+ −  22 1.54212 0.1 1.54212 0.4 1.76393= Hence, the value of y at 0.5x= is 1.76393. Ans. Example 15. Using Euler’s method, compute y(0.04) for the differential equation. y 1 = –y with y(0) = 1 (Take h = 0.01) Sol. Using Euler’s method () 1 , nn nn yyhfxy + =+ By considering 0,1,2, n= in succession, we obtain () 10 00 , yyhfxy =+ () 1 0.01 1 0.99 =+ − = () 21 11 , yyhfxy =+ () 0.99 0.01 0.99 0.9801 =+ − = () 3 0.9801 0.01 0.9801 0.970299 y =+− = () 4 0.970299 0.01 0970299 0960596 y =+−= Hence, the value of () 0.04y is 0.960596. Ans. Example 16. Find the solution of differential equation dy xy dx = with y(1) = 5 in the interval 1,1.5] using h = 0.1. Sol. As per given we have 1 1, x = 0 5, y = () fxy xy = Using Euler’s method () 1 , nn nn yyhfxy + =+ NUMERICAL SOLUTION OF ORDINARY DIFFERENTIAL EQUATION 345 Now, by considering 0,1, 2 n= in succession, we get For 0n= () 10 00 0.1 , yy fxy =+ () 50.115 5.5 =+ × = For 1n= () 21 11 0.1 , yy fxy =+ () 5.5 0.1 1.1 5.5 6.105 =+ × = For 2n= () 32 22 0.1 , yy fxy =+ () 6.105 0.1 1.2 6.105 6.838 =+ × = For 3n= () 43 33 0.1 , yy fxy =+ () 6.838 0.1 1.3 6.838 7.727 =+ × = For 4n= y 5 = y 4 + 0.1 f(x 4 , y 4 ) () 7.727 0.1 1.4 7.727 8.809 =+ × = Hence, the value of () 1.5y is 8.809. Ans. Example 17. Given yx y yx − ′ = + with y 0 = 1 find y for x = 0.1 in four steps by Euler’s method. Sol. Let 0.1 0.025 4 h== , given 0 1 y = , where 0x = We know that () 1 , nn nn yyhfxy + =+ By putting 0,1,2, 3,n= we obtain () 10 00 , yyhfxy =+ () () 10 10.025 10 − =+ + 1.025= ⇒ 1 1.025 y = Again, () 21 11 , yyhfxy =+ () () 1.025 0.025 1.025 0.025 1.025 0.025 − =+ + (where =+=+ ⇒= 10 1 0 0.025 0.025 xxh x ) = 1.0488 ⇒ y 2 = 1.0488 Now again y 3 = y 2 + hf(x 2 , y 2 ) (where x 2 = x 0 + 2h = 0 + 2 × 0.025 = 0.05) =1.0488 + 0.025 1 0488 0 05 1 0488 0 05 .–. bg bg + = 1.07152 ⇒ 3 1.07152 y = () 43 33 , yyhfxy =+ (where =+=+× = 30 3 0 3 0.025 0.075 xx h ) . = . Ans. Here in this example, only I approximation can be obtained and so it gives that approximate value of y for 0.1x= Example 12. Find the series expansion that gives y as a function of. when 0.1x= . Ans. 340 COMPUTER BASED NUMERICAL AND STATISTICAL TECHNIQUES Example 10. Obtain y when x = 0.1, x = 0.2 Given that ; dy xy dx =+ y(0) = 1, Check the result with exact value. Sol. We have, () 0 ,;0 dy fxy. = . Ans. 338 COMPUTER BASED NUMERICAL AND STATISTICAL TECHNIQUES Example 7. Find the solution of dy =1+ xy, y(0) = 1 dx which passess through (0, 1) in the interval (0, 0.5) such that the value

Ngày đăng: 04/07/2014, 15:20

Tài liệu cùng người dùng

Tài liệu liên quan