SSM-Ch21 - Chap. 21 Sec. 21.1 Numerics for ODEs and PDEs...

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

View Full Document Right Arrow Icon
Chap . 21 Numerics for ODEs and PDEs Sec . 21 . 1 Methods for First - Order ODEs Most important in this section is the classical Runge-Kutta method. The two simpler methods (Euler and Improved Euler) are included for providing a better understanding of the idea of these step-by-step methods. Problem Set 21 . 1 . Page 897 3 . Euler method . This method is hardly used in practice because it is not accurate enough for most purposes, and there are other methods (Runge-Kutta methods, in particular) that give much more accurate values without too much more work. However, the Euler method explains the principle underlying this class of methods in the simplest possible form, and this is the purpose of the present problem. The latter has the advantage that it concerns a differential equation that can easily be solved exactly, so that you can observe the behavior of the error as the computation is progressing from step to step. The given inital value problem is y u U u y u x U 2 , y u 0 U U 0. Hence you have y u U f u x , y U U u y u x U 2 . (A) The required step size is h U 0.1, so that 10 steps will give approximate solution values from 0 to 1. Because of (A) the formula (3) for the Euler method takes the form y n ± 1 U y n ± 0.1 u y n u x n U 2 . (B) Because of the initial condition y u 0 U U 0 our starting values are x U x 0 U 0 and y U y 0 U 0. To get a feel for the accuracy achieved, obtain the exact solution by setting y u x U u and separating variables. By differentiation you have y u u 1 U u u , so that from the ODE and by separation and integration u u ± 1 U u 2 , u u U u 2 u 1, du u 2 u 1 U dx , u arctanh u U x ± c . From the last formula you obtain u U u tanh u x ± c U U y u x , y U u tanh u x ± c U ± x . From the initial condition you obtain c U 0. Hence the solution of the initial value problem is y U x u tanh x . 0 0.05 0.1 0.15 0.2 y 0.2 0.4 0.6 0.8 1 x Sec . 21 . 1 . Prob . 3 . Solution curve and approximation by Euler’s method
Background image of page 1

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

View Full DocumentRight Arrow Icon
Numeric Analysis Part E Table for Prob . 3 . Computation with Euler’s Method n x n y n Error 0 0 0 0 1 0.1 0 0.0003320 2 0.2 0.0010000 0.0016247 3 0.3 0.0049601 0.0037273 4 0.4 0.0136650 0.0063860 5 0.5 0.0285904 0.0092924 6 0.6 0.0508131 0.0121373 7 0.7 0.0809738 0.0146584 8 0.8 0.1192931 0.0166701 9 0.9 0.1656293 0.0180728 10 1.0 0.2195593 0.0188465 11 . Classical Runge - Kutta method . The given intial value problem is y u u xy 2 U 0, y u 0 U U 1 and h U 0.1 is given. The exact solution of the problem is obtained by separating variables, y u U xy 2 , dy y 2 U dx , u 1 y U 1 2 x 2 ± c ² , y U 1 c u 1 2 x 2 . From this and the initial condition you have 1 U 1/ c , hence c U 1. The solution of the problem is y U 1 1 u 1 2 x 2 . In the Runge-Kutta table (Table 21.4) you have f u x n , y n U U x n y n 2 and need k 1 U 0.1 x n y n 2 k 2 U 0.1 u x n ± 0.05 Uu y n ± 1 2 k 1 U 2 k 3 U 0.1 u x n ± 0.05 Uu y n ± 1 2 k 2 U 2 k 4 U 0.1 u x n ± 0.1 Uu y n ± k 3 U 2 and y n ± 1 U y n ± 1 6 u k 1 ± 2 k 2 ± 2 k 3 ± k 4 U . The computations are shown in the table.
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 04/08/2012 for the course MT 423 taught by Professor M.lee during the Spring '12 term at National Taiwan University.

Page1 / 18

SSM-Ch21 - Chap. 21 Sec. 21.1 Numerics for ODEs and PDEs...

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

View Full Document Right Arrow Icon
Ask a homework question - tutors are online