11. First_Order_IVP

# 11. First_Order_IVP - 3.1.1 Explicit Euler Method Example...

This preview shows pages 1–3. Sign up to view the full content.

1/4 3.1.1 Explicit Euler Method Example given O.D.E. () y x F dx dy , = with y x y x F 1 , 3 + = I.C. 2 0 = y Find x y for 10 0 x . AB C D E 1 x i y i F i y exact error = y i - y exact 20 . 0 0 2 0 . 5 2 0 3 0.50 2.2500 0.5000 2.2430 0.0070 4 1.00 2.5000 0.8000 2.5495 -0.0495 5 1.50 2.9000 1.5086 3.0873 -0.1873 6 2.00 3.6543 2.4628 4.0000 -0.3457 7 2.50 4.8857 3.4028 5.3415 -0.4557 8 3.00 6.5871 4.2507 7.1063 -0.5192 9 3.50 8.7125 5.0359 9.2753 -0.5628 10 4.00 11.2304 5.7879 11.8322 -0.6017 11 4.50 14.1243 6.5224 14.7659 -0.6415 12 5.00 17.3856 7.2474 18.0693 -0.6838 13 5.50 21.0093 7.9667 21.7378 -0.7285 14 6.00 24.9926 8.6826 25.7682 -0.7756 15 6.50 29.3339 9.3961 30.1584 -0.8245 16 7.00 34.0320 10.1081 34.9070 -0.8751 17 7.50 39.0860 10.8191 40.0129 -0.9269 18 8.00 44.4956 11.5292 45.4753 -0.9797 19 8.50 50.2602 12.2388 51.2936 -1.0334 20 9.00 56.3796 12.9479 57.4674 -1.0878 21 9.50 62.8536 13.6567 63.9963 -1.1428 22 10.00 69.6819 14.3653 70.8802 -1.1982 Choose say 5 . 0 = Δ x — gives 21 i x points in 10 0 x . There will be 20 unknown i y values Column A: set up the x grid cell A2: enter 0 ( 0 x value) cell A3: =A2+0.5 copy down formula cell B2: enter 2 ( 0 y value) cell C2: =(A2^3+1)/B2 (RHS of the ODE) cell B3: =B2+0.5*C2 (Euler formula; 5 . 0 = Δ x ) copy down formulas Here, we have the exact solution to compare. Usually, this is not the case; i.e. we are using the computer because calculus methods fail, and exact y cannot be found. ( ) 4 2 2 / 4 + + = x x sqrt y exact cell D2: = sqrt ( 0.5 * B2 ^ 4 + 2 * B2 + 4 ) cell E2: = B2 - D2 copy down formulas Note that the error increases with x because an approximate i y value is used to compute the slope i F The next y value contains both the i y error and the i F error. For some ODEs and some x Δ , this accumulation of errors can make Euler's method unstable as x increases – i.e. i y values can start to oscillate and/or blow up. Euler solution example 0 10 20 30 40 50 60 70 02468 1 0 x y Euler exact

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
2/4 3.1.1 Euler example (cont'd) Halving Δ x to find a grid-independent solution -same Excel formulas as on previous page; just change x Δ value Δ x = 0.5 x i y i F i 0.00 2 0.5 0.50 2.2500 0.5000 1.00 2.5000 0.8000 1.50 2.9000 1.5086 2.00 3.6543 2.4628 2.50 4.8857 3.4028 3.00 6.5871 4.2507 3.50 8.7125 5.0359 4.00 11.2304 5.7879 4.50 14.1243 6.5224 5.00 17.3856 7.2474 5.50 21.0093 7.9667 6.00 24.9926
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### Page1 / 4

11. First_Order_IVP - 3.1.1 Explicit Euler Method Example...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online