Presentation is loading. Please wait.

Presentation is loading. Please wait.

Solving Ordinary Differential Equations

Similar presentations


Presentation on theme: "Solving Ordinary Differential Equations"— Presentation transcript:

1 Solving Ordinary Differential Equations
Application of Unsteady Flow form an Orifice

2 Ordinary Differential Equations
General Form: for sake of simplicity only consider linear case:

3 Finite Difference Methods
Basic Concepts First - Discretize Time Second - Represent x(t) using values at ti Approx. sol’n Exact Third - Approximate using the discrete

4 Finite Difference Methods Forward Euler Approximation (Explicit method)

5 Finite Difference Methods Forward Euler Algorithm

6 Example: FDM Forward Euler
Phenomenon: Flow through Orifice at Variable Head 1 2 3 γH2O Z = 0 A2 h

7 Math. Model: 1. Conservation of Mass

8 Math. Model: 2. Energy Equation

9 Mathematical Model

10 Numerical Model (FDM Forward Euler)

11 Choice of Time Step The choice of time step is based on the idea that the values do not change too much during the time step. Change of 5% in the initial value of the head h during the first time step is acceptable from engineering point of view. This is your judgment as a modeller.

12 Numerical Example Initial head h(t=0)= 5 m, cd=0.95, do=0.1 m, D=5 m.
Calculate the falling of the water level in time until the tank is empty. Draw h(t) over t. Check your results with analytical solution.

13 Estimation of time step
5% of h(0)= 0.05*5=0.25 m H(n+1)=5-0.25=4.75 m

14 Table of Computation T (sec) H(n) 5 4.77 60 4.54 120 4.32 180 ---

15 Check by Analytical solution

16 Comparison

17 Modified Euler (Predictor-Corrector) Method
Also “explicit” next h is an explicit function of previous But evaluate h at a some times to get a better estimate of next h E.g. midpoint method:

18 Finite Difference Methods Backward Euler Approximation (Implicit method)

19 Finite Difference Methods Backward Euler Algorithm
Solve with Gaussian Elimination

20 Example (Tank Problem) Backward Difference

21 Example (Tank Problem) Backward Difference cont.

22 Finite Difference Methods Trapezoidal Rule Approximation

23 Finite Difference Methods Trapezoidal Rule Algorithm
Solve with Gaussian Elimination

24 Example (Tank Problem) Trapezoidal Rule

25 Example (Tank Problem) Trapezoidal Rule

26 Finite Difference Methods Numerical Integration View
Trap BE FE

27 Finite Difference Methods Summary of Basic Concepts
Trap Rule, Forward-Euler, Backward-Euler Are all one-step methods Forward-Euler is simplest No equation solution explicit method. Boxcar approximation to integral Backward-Euler is more expensive Equation solution each step implicit method Trapezoidal Rule might be more accurate Trapezoidal approximation to integral


Download ppt "Solving Ordinary Differential Equations"

Similar presentations


Ads by Google