Engineering Analysis – 804 441 Computational Fluid Dynamics – 804 416 Faculty Name Prof. A. A. Saati
Part 3 - Approximate Solutions of Differential Equations Introductory Remarks Taylor Series Expansion Solutions of Differential Equations
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.
Taylor Series Expansion: Given a function f(x), which is analytical, can be expanded in a Taylor series about x as
Forward Difference Formulations Solving for one obtains The truncation error of order
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
Backward Difference Formulations Now consider the Taylor series expansion of about x. Solving for one obtains This is known as backward difference of order
Central Difference Formulations Now consider the Taylor series expansion of and about x. Subtracting the above equations, one obtains: Solving for
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
Forward Difference Formulations Solving for
Backward Difference Formulations A similar approximation for B.D. using the Taylor series expansions of and about x. The result is
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:
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
Substitute a forward difference expression for And 0ne obtains a second-order for
Forward & Backward Difference Formulations The finite difference approximation to the time derivative is expressed for a forward and backward difference as
Finite Difference Formulations 1 –FD 2 – BD 3 – CD 4 – FD 5 - BD
Finite Difference Formulations 6 - FD 7 – BD 8 – CD 9 – FD 10 - BD
Read Example: 2.1 , 2.2, 2.3, & 2.4 2.6, 2.7, & 2.8
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
Example (cont.) The back ward of order
Example (cont.) The central differencing of order The exact value is
Example (cont.) Read Example: 2.6, 2.7, & 2.8
Home work Solve problems: 2.7 2.12
Finite Difference Equations ( FDE )
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.
Finite Difference Equations Now use forward difference in time And use center difference in space.
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
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
Applications
Applications Example 2.2
Finite Difference Approximation of Mixed Partial Derivatives
Finite Difference Approximation of Mixed Partial Derivatives 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
Taylor Series Expansion Using indices to represent a grid point at x, y. Similarly, the expansion
Taylor Series Expansion And the expansion
Taylor Series Expansion From the above four equations Finite difference approximation of higher order derivatives may be obtained by following the same procedure
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
The use of Partial Derivatives with Respect to one Independent Variable Therefor, Now apply central differencing of for or
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
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.
Problems
Problems 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: Taylor series expansions. A backward difference recurrence formula. 2.3 Find a forward difference approximation of the order for
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.
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.
2.8 Problems
END OF Ch. 2