Faculty Name Prof. A. A. Saati. 2 Part 3 - Approximate Solutions of Differential Equations 3...

69
Engineering Analysis – 804 441 Computational Fluid Dynamics – 804 416 Faculty Name Prof. A. A. Saati

Transcript of Faculty Name Prof. A. A. Saati. 2 Part 3 - Approximate Solutions of Differential Equations 3...

  • Slide 1

Faculty Name Prof. A. A. Saati Slide 2 2 Slide 3 Part 3 - Approximate Solutions of Differential Equations 3 1.Introductory Remarks 2.Taylor Series Expansion 3.Solutions of Differential Equations Slide 4 1.Introductory Remarks The ODE & PDE must be expressed as approximate expressions, so that a digital computer can be employed to obtain a solution There are two methods for approximating the differentials of the function f First method of approximation often used is the Taylor series Second method is the use of a polynomial of degree n. 4 Slide 5 2.Taylor Series Expansion: Given a function f(x), which is analytical, can be expanded in a Taylor series about x as 5 Slide 6 Forward Difference Formulations Solving for one obtains The truncation error of order 6 Slide 7 Finite Difference Formulations If the subscript index i is used to represent the discrete point in the x-direction The truncation error of order This equation is known as forward difference of order 7 Slide 8 Backward Difference Formulations Now consider the Taylor series expansion of about x. Solving for one obtains This is known as backward difference of order 8 Slide 9 Central Difference Formulations Now consider the Taylor series expansion of and about x. Subtracting the above equations, one obtains: Solving for 9 Slide 10 Forward & Backward Difference Formulations Again consider the Taylor series expansion of and about x. Multiply the first equation by 2 and subtract it from the second equation: Solving for 10 Slide 11 Forward Difference Formulations Solving for 11 Slide 12 Backward Difference Formulations A similar approximation for B.D. using the Taylor series expansions of and about x. The result is 12 Slide 13 Center Difference Formulations Approximation expression for higher order derivatives Now consider the Taylor series expansion of and about x. Add the above equations, one obtains the center difference: 13 Slide 14 Forward Difference Formulations Now by considering additional terms in the Taylor series expansion, a more accurate approximation of the derivatives is produced. Consider the Taylor series expansion, Solving for 14 Slide 15 Substitute a forward difference expression for And 0ne obtains a second-order for 15 Slide 16 Forward & Backward Difference Formulations The finite difference approximation to the time derivative is expressed for a forward and backward difference as 16 Slide 17 1 FD 2 BD 3 CD 4 FD 5 - BD 17 Finite Difference Formulations Slide 18 6 - FD 7 BD 8 CD 9 FD 10 - BD 18 Finite Difference Formulations Slide 19 19 Read Example: 2.1, 2.2, 2.3, & 2.4 2.6, 2.7, & 2.8 Slide 20 3.Solutions of Differential Equations Example: Given the function compute the first derivative of f at x = 2 using forward and back ward difference of order Compare the results with a central differencing of order and the exact analytical value. Use a step size of Solution: Form Eq.1 With 20 Slide 21 Example (cont.) The back ward of order 21 Slide 22 Example (cont.) The central differencing of order The exact value is 22 Slide 23 23 Example (cont.) Read Example: 2.6, 2.7, & 2.8 Slide 24 24 Home work Solve problems: 2.7 2.12 Slide 25 25 Finite Difference Equations ( FDE ) Slide 26 Finite Difference Equations The finite difference approximations are replace the derivatives that appear in the PDEs. Consider the following example, where f is f = f(t,x,y). Assume is constant. Let represent Assume are constant step. Now use forward difference in time And use center difference in space. 26 Slide 27 Finite Difference Equations Now use forward difference in time And use center difference in space. 27 Slide 28 Finite Difference Equations The finite difference formulation of PDE is: Note that in this formulation, the spatial approximations are applied at time level n This lead to one unknown This equation is classified as explicit formulation 28 Slide 29 Finite Difference Equations The second case evaluated the spatial approximations at n+1 time level. Therefore, the first-order backward difference approximation in time is employed The finite difference formulation for PDE takes the form: This lead to 5 unknown This equation is classified as implicit formulation 29 Slide 30 30 Applications Slide 31 Example 2.2 31 Slide 32 32 Slide 33 33 Slide 34 34 Slide 35 35 Slide 36 36 Slide 37 37 Slide 38 38 Slide 39 39 Slide 40 40 Slide 41 41 Slide 42 42 Slide 43 43 Slide 44 44 Slide 45 45 Slide 46 46 Slide 47 47 Finite Difference Approximation of Mixed Partial Derivatives Slide 48 Approximating mixed partial derivatives can be performed by using Taylor series expansion for two variables Consider The Taylor series expansion for two variables x and y, become as 48 Slide 49 Taylor Series Expansion Using indices to represent a grid point at x, y. Similarly, the expansion 49 Slide 50 Taylor Series Expansion And the expansion 50 Slide 51 Taylor Series Expansion From the above four equations Finite difference approximation of higher order derivatives may be obtained by following the same procedure 51 Slide 52 The use of Partial Derivatives with Respect to one Independent Variable The approximate expansion for partial derivatives have already been developed. These expressions can now be used to compute mixed partial derivatives. Consider Using central differencing of for 52 Slide 53 The use of Partial Derivatives with Respect to one Independent Variable Therefor, Now apply central differencing of for or 53 Slide 54 The use of Partial Derivatives with Respect to one Independent Variable A second example, consider which is of order In this example, use forward differencing for all derivatives 54 Slide 55 The use of Partial Derivatives with Respect to one Independent Variable Similar approximations can be obtain by using Backward differencing for the derivatives, or Using FD for x derivatives and BD for y, or vice versa The finite difference approximations in this chapter will be used in the following chapters to formulate various FDEs of model PDEs. 55 Slide 56 56 Slide 57 57 Problems Slide 58 2.1 Derive a central difference approximation for which is of order 2.2 Determine an approximate backward difference representation for which is of order, given evenly spaced grid points by mean of: 1)Taylor series expansions. 2)A backward difference recurrence formula. 2.3 Find a forward difference approximation of the order for 58 Slide 59 2.8 Problems 2.5 Derive a first- order backward finite difference approximation for the mixed partial derivative 2.6 Derive a third-order accurate, forward difference approximation for 2.7 Given the function using forward and backward difference representations of order. Use step sizes of 0.01, 0.1 and 0.25. Compare and discuss your findings. 2.8 Solve problem 2.7 using a second-order accurate central difference approximation. 59 Slide 60 2.8 Problems 2.9 Compute the first derivative of the function. at x=1.5, using first-order forward and backward approximation. Use step sizes of 0.01, 0.1, 0.5, and 0.8. discuss the results. 2.10 Use the second-order accurate central difference approximation and the first-order forward difference approximation to evaluate at x=1. A step size of is to be employed. Recall that e=2.71828. 60 Slide 61 2.8 Problems 61 Slide 62 62 Slide 63 63 Slide 64 64 Slide 65 65 Slide 66 66 Slide 67 67 Slide 68 68 Slide 69 END OF Ch. 2 69