MECN 3500 Inter - Bayamon Lecture 9 Numerical Methods for Engineering MECN 3500 Professor: Dr. Omar E. Meza Castillo Department of Mechanical Engineering Inter American University of Puerto Rico Bayamon Campus
Lecture 9 MECN 3500 Inter - Bayamon Tentative Lectures Schedule TopicLecture Mathematical Modeling and Engineering Problem Solving 1 Introduction to Matlab 2 Numerical Error 3 Root Finding System of Linear Equations 7-8 Finite Difference 9 Least Square Curve Fitting Polynomial Interpolation Numerical Integration Ordinary Differential Equations
Lecture 9 MECN 3500 Inter - Bayamon Best known numerical method of approximation Finite Difference
Lecture 9 MECN 3500 Inter - Bayamon To understand the theory of finite differences. To apply FD to the solution of specific problems as a function of accuracy, condition matrix, and performance of iterative methods. Course Objectives
Lecture 9 MECN 3500 Inter - Bayamon FINITE DIFFERENCE FORMULATION OF DIFFERENTIAL EQUATIONS finite difference form of the first derivative Taylor series expansion of the function f about the point x, The smaller the x, the smaller the error, and thus the more accurate the approximation.
Lecture 9 MECN 3500 Inter - Bayamon The forward Taylor series expansion for f ( x i +2 ) in terms of f ( x i ) is The forward Taylor series expansion for f ( x i +2 ) in terms of f ( x i ) is Combine equations: Combine equations: FINITE DIFFERENCE APPROXIMATION OF HIGHER DERIVATIVE
Lecture 9 MECN 3500 Inter - Bayamon Solve for f ''( x i ): Solve for f ''( x i ): This formula is called the second forward finite divided difference and the error of order O ( h ). This formula is called the second forward finite divided difference and the error of order O ( h ). The second backward finite divided difference which has an error of order O ( h ) is The second backward finite divided difference which has an error of order O ( h ) is
Lecture 9 MECN 3500 Inter - Bayamon The second centered finite divided difference which has an error of order O ( h 2 ) is The second centered finite divided difference which has an error of order O ( h 2 ) is
Lecture 9 MECN 3500 Inter - Bayamon High accurate estimates can be obtained by retaining more terms of the Taylor series. High accurate estimates can be obtained by retaining more terms of the Taylor series. The forward Taylor series expansion is: The forward Taylor series expansion is: From this, we can write From this, we can write High-Accuracy Differentiation Formulas
Lecture 9 MECN 3500 Inter - Bayamon Substitute the second derivative approximation into the formula to yield: Substitute the second derivative approximation into the formula to yield: By collecting terms: By collecting terms: Inclusion of the 2 nd derivative term has improved the accuracy to O ( h 2 ). Inclusion of the 2 nd derivative term has improved the accuracy to O ( h 2 ). This is the forward divided difference formula for the first derivative. This is the forward divided difference formula for the first derivative.
Lecture 9 MECN 3500 Inter - Bayamon Forward Formulas
Lecture 9 MECN 3500 Inter - Bayamon Backward Formulas
Lecture 9 MECN 3500 Inter - Bayamon Centered Formulas
Lecture 9 MECN 3500 Inter - Bayamon Example Estimate f '(1) for f ( x ) = e x + x using the centered formula of O ( h 4 ) with h = Solution From Tables From Tables
Lecture 9 MECN 3500 Inter - Bayamon In substituting the values: In substituting the values:
Lecture 9 MECN 3500 Inter - Bayamon Error Truncation Error: introduced in the solution by the approximation of the derivative Local Error: from each term of the equation Local Error: from each term of the equation Global Error: from the accumulation of local error Global Error: from the accumulation of local error Roundoff Error: introduced in the computation by the finite number of digits used by the computer
Lecture 9 MECN 3500 Inter - Bayamon Numerical solutions can give answers at only discrete points in the domain, called grid points. If the PDEs are totally replaced by a system of algebraic equations which can be solved for the values of the flow-field variables at the discrete points only, in this sense, the original PDEs have been discretized. Moreover, this method of discretization is called the method of finite differences. Introduction to Finite Difference (i,j)
Lecture 9 MECN 3500 Inter - Bayamon x n Discretization: PDE FDE n Explicit Methods u Simple u No stable n Implicit Methods u More complex u Stables ∆x∆x x m-1 x mm+1 y n+1 y n y n-1 ∆y∆y m,n u
Lecture 9 MECN 3500 Inter - Bayamon
Lecture 9 MECN 3500 Inter - Bayamon
Lecture 9 MECN 3500 Inter - Bayamon
Lecture 9 MECN 3500 Inter - Bayamon Summary of nodal finite-difference relations for various configurations: Case 1: Interior Node
Lecture 9 MECN 3500 Inter - Bayamon Case 2: Node at an Internal Corner with Convection
Lecture 9 MECN 3500 Inter - Bayamon Case 3: Node at Plane Surface with Convection
Lecture 9 MECN 3500 Inter - Bayamon Case 4: Node at an External Corner with Convection
Lecture 9 MECN 3500 Inter - Bayamon Case 5: Node at Plane Surface with Uniform Heat Flux
Lecture 9 MECN 3500 Inter - Bayamon Solving Finite Difference Equations Heat Transfer Solved Problem
Lecture 9 MECN 3500 Inter - Bayamon The Matrix Inversion Method
Lecture 9 MECN 3500 Inter - Bayamon
Lecture 9 MECN 3500 Inter - Bayamon
Lecture 9 MECN 3500 Inter - Bayamon Jacobi Iteration Method
Lecture 9 MECN 3500 Inter - Bayamon
Lecture 9 MECN 3500 Inter - Bayamon
Lecture 9 MECN 3500 Inter - Bayamon
Lecture 9 MECN 3500 Inter - Bayamon
Lecture 9 MECN 3500 Inter - Bayamon
Lecture 9 MECN 3500 Inter - Bayamon Gauss-Seidel Iteration
Lecture 9 MECN 3500 Inter - Bayamon
Lecture 9 MECN 3500 Inter - Bayamon
Lecture 9 MECN 3500 Inter - Bayamon Error Definitions Use absolute value. Use absolute value. Computations are repeated until stopping criterion is satisfied. Computations are repeated until stopping criterion is satisfied. If the following Scarborough criterion is met If the following Scarborough criterion is met Pre-specified % tolerance based on the knowledge of your solution
Lecture 9 MECN 3500 Inter - Bayamon Using Excel =MINVERSE(A2:C4) =MMULT(A7:C9,E2:E4) Matrix Inversion Method
Lecture 9 MECN 3500 Inter - Bayamon Jacobi Iteration Method using Excel
Lecture 9 MECN 3500 Inter - Bayamon 43 Gauss-Seidel Iteration Method using Excel
Lecture 9 MECN 3500 Inter - Bayamon A large industrial furnace is supported on a long column of fireclay brick, which is 1 m by 1 m on a side. During steady-state operation is such that three surfaces of the column are maintained at 500 K while the remaining surface is exposed to 300 K. Using a grid of ∆x=∆y=0.25 m, determine the two- dimensional temperature distribution in the column. T s =300 K (1,1) (2,1)(3,1) (1,2) (2,2)(3,2) (1,3) (2,3)(3,3)
Lecture 9 MECN 3500 Inter - Bayamon T 11 T 12 T 13 T 21 T 22 T 23 T 31 T 32 T T T T T T 22 = T T T T System of Linear Equations
Lecture 9 MECN 3500 Inter - Bayamon Matrix Inversion Method
Lecture 9 MECN 3500 Inter - Bayamon Iteration Method using Excel
Lecture 9 MECN 3500 Inter - Bayamon 48 Jacobi Iteration Method using Excel
Lecture 9 MECN 3500 Inter - Bayamon 49 Error Iteration Method using Excel
Lecture 9 MECN 3500 Inter - Bayamon 50 Gauss-Seidel Iteration Method using Excel
Lecture 9 MECN 3500 Inter - Bayamon 51 Error Iteration Method using Excel
Lecture 9 MECN 3500 Inter - Bayamon
Lecture 9 MECN 3500 Inter - Bayamon
Lecture 9 MECN 3500 Inter - Bayamon
Lecture 9 MECN 3500 Inter - Bayamon 55 Iteration Method using Excel
Lecture 9 MECN 3500 Inter - Bayamon
Lecture 9 MECN 3500 Inter - Bayamon
Lecture 9 MECN 3500 Inter - Bayamon 58
Lecture 9 MECN 3500 Inter - Bayamon Example Fit the data with multiple linear regression x1x1 x2x2 y
Lecture 9 MECN 3500 Inter - Bayamon Regression in Matlab and Excel 60 Use the polyfit function Regression in Excel Use Add Trendline Regression in Matlab
Lecture 9 MECN 3500 Inter - Bayamon Homework7 Omar E. Meza Castillo Ph.D. 61