These slides contain information about Euler method,Improved Euler and Runge-kutta's method.How these methods are helpful and applied to our questions are detailed discussed in the slides.
Size: 789.44 KB
Language: en
Added: Jun 20, 2020
Slides: 20 pages
Slide Content
Topic: Numerical method for ODEs Euler Method Improved Euler Method Runge- kuttaβs Method Prepared by: Sohaib Siddique Butt University of Gujrat NUMERICAL ANALYSIS
Ordinary Differential Equation Definition : A differential equation containing one or more functions of one independent variable and the derivatives of those functions Examples: y is dependent variable x is independent variable
Solution to Ordinary Differential Equations Analytical solutions: Eigenvalues, time constants, damping coefficients Numerical solutions: Euler Method, Runge- Kutta Method
Eulerβs Method π π₯ Consider the equation ππ¦ =f(x,y) β¦β¦.(1) Given that Y(x )=y its curve of solution through P(x ,y ) is shown dotted in figure. Now we have to find ordinate of any other point at Q on this curve. Dividing the curve into βnβ equal sub-interval each of width βhβ. So we approximate the tangent for LL 1 So Y 1 =L 1 P 1 =LP+R 1 P 1 =y +PR 1 tan π =y +hf(x ,y ) Here we goβ¦β¦β¦β¦β¦β¦β¦β¦β¦β¦β¦β¦..
Eulerβs Method . Repeating this process n times y n+1 =y n +hf(x n ,y n ) β¦β¦ β¦.(2) Where x n =x +nh Equation 2 is called as Eulerβs Method for finding an approximate solution.
EULERβS METHOD π π₯ To solve a differential equation of first order of the type ππ¦ = π π₯, π¦ , with initial 0 0 con d it i o n s π¦ π₯ = π¦ . The method is used to find the values of π¦(π₯) for different values of π₯ at equal intervals. The length of the interval is β , i.e. β = π₯ π+1 β π₯ π . In other words, π₯ 1 = π₯ + β, π₯ 2 = π₯ 1 + β , π₯ 3 = π₯ 2 + β β¦ etc. Also π¦ π is defined as π¦ π = π¦ π₯ π . Eulerβs Method: π¦ π₯ π+1 π. π. π¦ π+1 = π¦ π + βπ(π₯ π , π¦ π ) β will be provided or need to be chosen. Smaller the value of β , more accurate is the answer and less is the error committed.
Errors with Euler`s Method Local truncation error : over one step size. Global error : cumulative over the range of the solution . The error Ξ΅ using Euler`s method can be approximated using the second term of the Taylor series expansion. If the range is divided into n increments, then the error at the end of range for x would be n Ξ΅ . In addition, there are roundoff errors in this and other methods, which may affect the accuracy of the values more and more as n increases.
Comparison Actual solution of the differential equation is π₯ 2 2 π¦ = + 1 n π₯ π π¦ π (actual) π¦ π (approx) % error 1 1 1 0.1 1.005 1 0.497512 2 0.2 1.02 1.01 0.980392 3 0.3 1.045 1.03 1.435407 4 0.4 1.08 1.06 1.851852
Improved Eulerβs Method In the Eulerβs improved method , The curve of the solution in the interval LL 1 is approximates by the tangent at P such as at P 1 we have, Y 1 =y +hf(x ,y ) Than the slope of the curve of the solution through P 1 is computed at the tangent at P 1 to P 1 Q 1 is drawn meeting the ordinate through L 2 in P 2 (x +2h,y 2 )β¦β¦1 Now we find better approximation y 1 β of y(x +h) by taking the slope of the curve as the mean of the slope of the tangent at P and P 1 i.e. Y 1 β=y + β { f(x +y )+f(X +h,Y 1 )}β¦..2 2 As the slope of the tangent at P 1 is not known, We take Y 1 is found in equation (1)
improved Eulerβs Method Euler method y n+1 =y n +hf(x n ,y n ) Where x n =x +nh Eulerβs Modified Method is 2 y n+1 =y n + β {f(x n , y n )+f(x n+1 ,y n+1 )}
Euler method is a predictorβcorrector method In each step of the improved Euler method we compute two values, first the predictor which is an auxiliary value, and then the new y-value, the corrector
Example Question : Apply Eulerβs Modified Method to solve yβ=x+y .Given y(0)=1.Find y at x=0.2 using step length 0.1 . Solution : Given, yβ=x+y , y(0)=1 ,h=0.1 Than using Eulerβs Method, y n+1 =y n +hf(x n ,y n ) β¦β¦β¦β¦..(1) Putting n=0, y 1 =y +hf(x ,y ) ; y 1 =1+0.1(1)=1.1 Than using Eulerβs Modified Method, 2 y n+1 =y n + β {f(x n , y n )+f(x n+1 ,y n+1 )}β¦β¦(2)
Example β¦β¦β¦β¦β¦β¦β¦β¦β¦β¦β¦β¦.. 2 y 1 =y + β {f(x , y )+f(x 1 ,y 1 )} y 1 =1+ 0.1 (1+1.2)=1.11 2 Repeating process will give y 1 =1.1105 Than using Eulerβs Method, Putting n=1; y 2 =y 1 +hf(x 1 ,y 1 ) y 2 =1.1105+0.1(0.1+1.1105)=1.23155 Than using Eulerβs Modified Method,Putting n=1; 2 y 2 =y 1 + β {f(x 1 , y 1 )+f(x 2 ,y 2 )}
Continueβ¦β¦β¦β¦β¦β¦β¦β¦β¦β¦.. y 2 =1.1105+ 0.1 (1.2105+1.43155)=1.2426 2 Repeating process will give y 2 =1.2432 At y(0.2)=1.2432 Answer.
RUNGE-KUTTAβS METHOD Method of great practical importance Much greater accuracy than that of the improved Euler method The classical Rungeβ Kutta method of fourth order, which we call briefly the Rungeβ Kutta method.