Presentation is loading. Please wait.

Presentation is loading. Please wait.

Computational Method in Chemical Engineering (TKK-2109)

Similar presentations


Presentation on theme: "Computational Method in Chemical Engineering (TKK-2109)"— Presentation transcript:

1 Computational Method in Chemical Engineering (TKK-2109)
14/15 Semester 5 Computational Method in Chemical Engineering (TKK-2109) Instructor: Rama Oktavian Office Hr.: M.13-15, T , W , F

2 Ordinary Differential Equation
An equation relating a dependent variable to one or more independent variables by means of its differential coefficients with respect to the independent variables is called a “differential equation”. Ordinary differential equation only one independent variable involved: x Partial differential equation more than one independent variable involved: x, y, z, 

3 Ordinary Differential Equation
Ordinary differential equations are classified in terms of order and degree Order of an ordinary differential equation is the same as the highest order derivative The degree of a differential equation is the highest power of the highest order differential coefficient that the equation contains after it has been rationalized.

4 Ordinary Differential Equation
Ordinary differential equations are classified in terms of order and degree 3rd order O.D.E. 1st degree O.D.E. 1st order O.D.E. 2nd degree O.D.E.

5 Ordinary Differential Equation
Linear or non-linear Differential equations are said to be non-linear if any products exist between the dependent variable and its derivatives, or between the derivatives themselves. Product between two derivatives ---- non-linear Product between the dependent variable themselves ---- non-linear

6 Ordinary Differential Equation
Swinging pendulum A second-order nonlinear ODE. Falling parachutist problem

7 Ordinary Differential Equation
Ordinary differential equations are classified in terms of order and degree 3rd order O.D.E. 1st degree O.D.E. 1st order O.D.E. 2nd degree O.D.E.

8 Ordinary Differential Equation
ODE in chemical engineering Illustrative Example: A Blending Process An unsteady-state mass balance for the blending system:

9 Ordinary Differential Equation
ODE in chemical engineering or where w1, w2, and w are mass flow rates. The unsteady-state component balance is: For constant , Eqs. 2-2 and 2-3 become:

10 Ordinary Differential Equation
ODE in chemical engineering Equation 2-13 can be simplified by expanding the accumulation term using the “chain rule” for differentiation of a product: Substitution of (2-14) into (2-13) gives: Substitution of the mass balance in (2-12) for in (2-15) gives:

11 Ordinary Differential Equation
ODE in chemical engineering After canceling common terms and rearranging (2-12) and (2-16), a more convenient model form is obtained:

12 Ordinary Differential Equation
ODE in chemical engineering

13 Ordinary Differential Equation
Numerical method for solving ODE Euler’s method Φ Step size, h x y x0,y0 True value y1, Predicted value Slope Figure 1 Graphical interpretation of the first step of Euler’s method

14 Ordinary Differential Equation
Numerical method for solving ODE Euler’s method Φ Step size h True Value yi+1, Predicted value yi x y xi xi+1 Figure 2. General graphical interpretation of Euler’s method

15 Ordinary Differential Equation
Numerical method for solving ODE Euler’s method How does one write a first order differential equation in the form of Example is rewritten as In this case

16 Ordinary Differential Equation
Example Numerical method for solving ODE Euler’s method 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.

17 Ordinary Differential Equation
Example Numerical method for solving ODE Euler’s method Step 1: is the approximate concentration of salt at

18 Ordinary Differential Equation
Example Numerical method for solving ODE Euler’s method Step 2: is the approximate concentration of salt at

19 Ordinary Differential Equation
Numerical method for solving ODE The exact solution of the ordinary differential equation is given by The solution to this nonlinear equation at t=3 minutes is

20 Ordinary Differential Equation
Numerical method for solving ODE Figure 3. Comparing exact and Euler’s method

21 Ordinary Differential Equation
Numerical method for solving ODE Table 1. Concentration of salt at 3 minutes as a function of step size, h 3 1.5 0.75 0.375 0.1875 −362.50 720.31 284.65 10.718 10.714 373.22 −709.60 −273.93 3483.0 6622.2 2556.5 Step

22 Ordinary Differential Equation
Numerical method for solving ODE Figure 4. Comparison of Euler’s method with exact solution for different step sizes

23 Ordinary Differential Equation
Numerical method for solving ODE Runge Kutta 2nd order method Taylor’s expansion

24 Ordinary Differential Equation
Numerical method for solving ODE Runge Kutta 2nd order method Taylor’s expansion

25 Ordinary Differential Equation
Numerical method for solving ODE Runge Kutta 2nd order method However, it is relatively difficult to find second derivative of ODE For Runge Kutta 2nd order method is given by where

26 Ordinary Differential Equation
Numerical method for solving ODE Heun’s method x y xi xi+1 yi+1, predicted yi Here a2=1/2 is chosen resulting in where Figure 1 Runge-Kutta 2nd order method (Heun’s method)

27 Ordinary Differential Equation
Midpoint Method Numerical method for solving ODE Here is chosen, giving resulting in where

28 Ordinary Differential Equation
Ralston’s Method Numerical method for solving ODE Here is chosen, giving resulting in where

29 Ordinary Differential Equation
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.

30 Solution Step 1: x1 is the approximate concentration of salt at

31 Solution Step 2: x1 is the approximate concentration of salt at

32 Solution Table 1. Effect of step size for Heun’s method 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 16727 33306 4025.4 3.0079 (exact)

33 Ordinary Differential Equation
Numerical method for solving ODE Runge Kutta 4th order method Taylor’s expansion

34 Ordinary Differential Equation
Numerical method for solving ODE Runge Kutta 4th order method However, it is relatively difficult to find second and third derivative of ODE For Runge Kutta 4th order method is given by

35 Ordinary Differential Equation
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.

36 Solution Step 1:

37 Solution is the approximate concentration of salt at

38 Solution Step 2:

39 Solution is the approximate concentration of salt at

40 Solution Table 1 Value of concentration of salt at 3 minutes for different step sizes Step size, 3 1.5 0.75 0.375 0.1875 14120 11455 25.559 10.717 10.715 −14109 −11444 −14.843 131680 106800 138.53 (exact)

41 Thank You !


Download ppt "Computational Method in Chemical Engineering (TKK-2109)"

Similar presentations


Ads by Google