{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

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

Info iconThis preview shows pages 1–4. 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 u2032 u003d ue0a2 y u2212 x ue0a3 2 , y ue0a2 0 ue0a3 u003d 0. Hence you have y u2032 u003d f ue0a2 x , y ue0a3 u003d ue0a2 y u2212 x ue0a3 2 . (A) The required step size is h u003d 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 u002b 1 u003d y n u002b 0.1 ue0a2 y n u2212 x n ue0a3 2 . (B) Because of the initial condition y ue0a2 0 ue0a3 u003d 0 our starting values are x u003d x 0 u003d 0 and y u003d y 0 u003d 0. To get a feel for the accuracy achieved, obtain the exact solution by setting y u2212 x u003d u and separating variables. By differentiation you have y u2032 u2212 1 u003d u u2032 , so that from the ODE and by separation and integration u u2032 u002b 1 u003d u 2 , u u2032 u003d u 2 u2212 1, du u 2 u2212 1 u003d dx , u2212 arctanh u u003d x u002b c . From the last formula you obtain u u003d u2212 tanh ue0a2 x u002b c ue0a3 u003d y u2212 x , y u003d u2212 tanh ue0a2 x u002b c ue0a3 u002b x . From the initial condition you obtain c u003d 0. Hence the solution of the initial value problem is y u003d x u2212 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 Document Right Arrow Icon
196 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 u2032 u2212 xy 2 u003d 0, y ue0a2 0 ue0a3 u003d 1 and h u003d 0.1 is given. The exact solution of the problem is obtained by separating variables, y u2032 u003d xy 2 , dy y 2 u003d dx , u2212 1 y u003d 1 2 x 2 u002b c u0303 , y u003d 1 c u2212 1 2 x 2 . From this and the initial condition you have 1 u003d 1/ c , hence c u003d 1. The solution of the problem is y u003d 1 1 u2212 1 2 x 2 . In the Runge-Kutta table (Table 21.4) you have f ue0a2 x n , y n ue0a3 u003d x n y n 2 and need k 1 u003d 0.1 x n y n 2 k 2 u003d 0.1 ue0a2 x n u002b 0.05 ue0a3ue0a2 y n u002b 1 2 k 1 ue0a3 2 k 3 u003d 0.1 ue0a2 x n u002b 0.05 ue0a3ue0a2 y n u002b 1 2 k 2 ue0a3 2 k 4 u003d 0.1 ue0a2 x n u002b 0.1 ue0a3ue0a2 y n u002b k 3 ue0a3 2 and y n u002b 1 u003d y n u002b 1 6 ue0a2 k 1 u002b 2 k 2 u002b 2 k 3 u002b k 4 ue0a3 . The computations are shown in the table.
Background image of page 2
Chap. 21 Numerics for ODEs and PDEs 197 n x n y
Background image of page 3

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

View Full Document Right Arrow Icon
Image of page 4
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}