Presentation is loading. Please wait.

Presentation is loading. Please wait.

10/20/2015 1 Runge 2 nd Order Method Chemical Engineering Majors Authors: Autar Kaw, Charlie Barker

Similar presentations


Presentation on theme: "10/20/2015 1 Runge 2 nd Order Method Chemical Engineering Majors Authors: Autar Kaw, Charlie Barker"— Presentation transcript:

1 10/20/2015 http://numericalmethods.eng.usf.edu 1 Runge 2 nd Order Method Chemical Engineering Majors Authors: Autar Kaw, Charlie Barker http://numericalmethods.eng.usf.edu Transforming Numerical Methods Education for STEM Undergraduates

2 Runge-Kutta 2 nd Order Method http://numericalmethods.eng.usf.edu http://numericalmethods.eng.usf.edu

3 3 Runge-Kutta 2 nd Order Method Runge Kutta 2nd order method is given by where For

4 http://numericalmethods.eng.usf.edu4 Heun’s Method x y xixi x i+1 y i+1, predicted y i Figure 1 Runge-Kutta 2nd order method (Heun’s method) Heun’s method resulting in where Here a 2 =1/2 is chosen

5 http://numericalmethods.eng.usf.edu5 Midpoint Method Here is chosen, giving resulting in where

6 http://numericalmethods.eng.usf.edu6 Ralston’s Method Hereis chosen, giving resulting in where

7 http://numericalmethods.eng.usf.edu7 How to write Ordinary Differential Equation Example is rewritten as In this case How does one write a first order differential equation in the form of

8 http://numericalmethods.eng.usf.edu8 Example The concentration of salt, in a home made soap maker is given as a function of time by At the initial time, t = 0, the salt concentration in the tank is 50g/L. Using Euler’s method and a step size of h=1.5 min, what is the salt concentration after 3 minutes.

9 http://numericalmethods.eng.usf.edu9 Solution Step 1: x 1 is the approximate concentration of salt at

10 http://numericalmethods.eng.usf.edu10 Solution Cont Step 2: x 1 is the approximate concentration of salt at

11 http://numericalmethods.eng.usf.edu11 Solution Cont The exact solution of the ordinary differential equation is given by The solution to this nonlinear equation at t=3 minutes is

12 http://numericalmethods.eng.usf.edu12 Comparison with exact results Figure 2. Heun’s method results for different step sizes

13 Step size, 3 1.5 0.75 0.375 0.1875 1803.1 3579.6 442.05 11.038 10.718 −1792.4 −3568.9 −431.34 −0.32231 −0.0024979 16727 33306 4025.4 3.0079 0.023311 http://numericalmethods.eng.usf.edu13 Effect of step size (exact) Table 1. Effect of step size for Heun’s method

14 http://numericalmethods.eng.usf.edu14 Effects of step size on Heun’s Method Figure 3. Effect of step size in Heun’s method

15 Step size, h EulerHeunMidpointRalston 3 1.5 0.75 0.375 0.1875 −362.50 720.31 284.65 10.718 10.714 1803.1 3579.6 442.05 11.038 10.718 1803.1 3579.6 442.05 11.038 10.718 1803.1 3579.6 442.05 11.038 10.718 http://numericalmethods.eng.usf.edu15 Comparison of Euler and Runge- Kutta 2 nd Order Methods Table 2. Comparison of Euler and the Runge-Kutta methods (exact)

16 http://numericalmethods.eng.usf.edu16 Comparison of Euler and Runge- Kutta 2 nd Order Methods Table 2. Comparison of Euler and the Runge-Kutta methods (exact) Step size, h EulerHeunMidpointRalston 3 1.5 0.75 0.375 0.1875 3483.0 6622.2 2556.5 0.023249 0.010082 16727 33306 4025.4 3.0079 0.023311 16727 33306 4025.4 3.0079 0.023311 16727 33306 4025.4 3.0079 0.023311

17 http://numericalmethods.eng.usf.edu17 Comparison of Euler and Runge- Kutta 2 nd Order Methods Figure 4. Comparison of Euler and Runge Kutta 2 nd order methods with exact results.

18 Additional Resources For all resources on this topic such as digital audiovisual lectures, primers, textbook chapters, multiple-choice tests, worksheets in MATLAB, MATHEMATICA, MathCad and MAPLE, blogs, related physical problems, please visit http://numericalmethods.eng.usf.edu/topics/runge_kutt a_2nd_method.html

19 THE END http://numericalmethods.eng.usf.edu


Download ppt "10/20/2015 1 Runge 2 nd Order Method Chemical Engineering Majors Authors: Autar Kaw, Charlie Barker"

Similar presentations


Ads by Google