Presentation is loading. Please wait.

Presentation is loading. Please wait.

MECN 3500 Inter - Bayamon Lecture 9 Numerical Methods for Engineering MECN 3500 Professor: Dr. Omar E. Meza Castillo

Similar presentations


Presentation on theme: "MECN 3500 Inter - Bayamon Lecture 9 Numerical Methods for Engineering MECN 3500 Professor: Dr. Omar E. Meza Castillo"— Presentation transcript:

1 MECN 3500 Inter - Bayamon Lecture 9 Numerical Methods for Engineering MECN 3500 Professor: Dr. Omar E. Meza Castillo omeza@bayamon.inter.edu http://www.bc.inter.edu/facultad/omeza Department of Mechanical Engineering Inter American University of Puerto Rico Bayamon Campus

2 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 4-5-6 System of Linear Equations 7-8 Finite Difference 9 Least Square Curve Fitting Polynomial Interpolation Numerical Integration Ordinary Differential Equations

3 Lecture 9 MECN 3500 Inter - Bayamon Best known numerical method of approximation Finite Difference

4 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

5 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.

6 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

7 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

8 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

9 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

10 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.

11 Lecture 9 MECN 3500 Inter - Bayamon Forward Formulas

12 Lecture 9 MECN 3500 Inter - Bayamon Backward Formulas

13 Lecture 9 MECN 3500 Inter - Bayamon Centered Formulas

14 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 = 0.25. Solution From Tables From Tables

15 Lecture 9 MECN 3500 Inter - Bayamon In substituting the values: In substituting the values:

16 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

17 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)

18 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

19 Lecture 9 MECN 3500 Inter - Bayamon

20 Lecture 9 MECN 3500 Inter - Bayamon

21 Lecture 9 MECN 3500 Inter - Bayamon

22 Lecture 9 MECN 3500 Inter - Bayamon Summary of nodal finite-difference relations for various configurations: Case 1: Interior Node

23 Lecture 9 MECN 3500 Inter - Bayamon Case 2: Node at an Internal Corner with Convection

24 Lecture 9 MECN 3500 Inter - Bayamon Case 3: Node at Plane Surface with Convection

25 Lecture 9 MECN 3500 Inter - Bayamon Case 4: Node at an External Corner with Convection

26 Lecture 9 MECN 3500 Inter - Bayamon Case 5: Node at Plane Surface with Uniform Heat Flux

27 Lecture 9 MECN 3500 Inter - Bayamon Solving Finite Difference Equations Heat Transfer Solved Problem

28 Lecture 9 MECN 3500 Inter - Bayamon The Matrix Inversion Method

29 Lecture 9 MECN 3500 Inter - Bayamon

30 Lecture 9 MECN 3500 Inter - Bayamon

31 Lecture 9 MECN 3500 Inter - Bayamon Jacobi Iteration Method

32 Lecture 9 MECN 3500 Inter - Bayamon

33 Lecture 9 MECN 3500 Inter - Bayamon

34 Lecture 9 MECN 3500 Inter - Bayamon

35 Lecture 9 MECN 3500 Inter - Bayamon

36 Lecture 9 MECN 3500 Inter - Bayamon

37 Lecture 9 MECN 3500 Inter - Bayamon Gauss-Seidel Iteration

38 Lecture 9 MECN 3500 Inter - Bayamon

39 Lecture 9 MECN 3500 Inter - Bayamon

40 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

41 Lecture 9 MECN 3500 Inter - Bayamon Using Excel =MINVERSE(A2:C4) =MMULT(A7:C9,E2:E4) Matrix Inversion Method

42 Lecture 9 MECN 3500 Inter - Bayamon Jacobi Iteration Method using Excel

43 Lecture 9 MECN 3500 Inter - Bayamon 43 Gauss-Seidel Iteration Method using Excel

44 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)

45 Lecture 9 MECN 3500 Inter - Bayamon T 11 T 12 T 13 T 21 T 22 T 23 T 31 T 32 T 33 -410100000T 11 -800 1-41010000T 12 -500 01-4001000T 13 -1000 100-410100T 21 -300 0101-41010T 22 = 0 00101-4001T 23 -500 000100-410T 31 -800 0000101-41T 32 -500 00000101-4T 33 -1000 System of Linear Equations

46 Lecture 9 MECN 3500 Inter - Bayamon Matrix Inversion Method

47 Lecture 9 MECN 3500 Inter - Bayamon Iteration Method using Excel

48 Lecture 9 MECN 3500 Inter - Bayamon 48 Jacobi Iteration Method using Excel

49 Lecture 9 MECN 3500 Inter - Bayamon 49 Error Iteration Method using Excel

50 Lecture 9 MECN 3500 Inter - Bayamon 50 Gauss-Seidel Iteration Method using Excel

51 Lecture 9 MECN 3500 Inter - Bayamon 51 Error Iteration Method using Excel

52 Lecture 9 MECN 3500 Inter - Bayamon

53 Lecture 9 MECN 3500 Inter - Bayamon

54 Lecture 9 MECN 3500 Inter - Bayamon

55 Lecture 9 MECN 3500 Inter - Bayamon 55 Iteration Method using Excel

56 Lecture 9 MECN 3500 Inter - Bayamon

57 Lecture 9 MECN 3500 Inter - Bayamon

58 Lecture 9 MECN 3500 Inter - Bayamon 58

59 Lecture 9 MECN 3500 Inter - Bayamon Example 17.5 59 Fit the data with multiple linear regression x1x1 x2x2 y 005 2110 2.529 730 463 5227

60 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

61 Lecture 9 MECN 3500 Inter - Bayamon Homework7  www.bc.inter.edu/facultad/omeza www.bc.inter.edu/facultad/omeza Omar E. Meza Castillo Ph.D. 61


Download ppt "MECN 3500 Inter - Bayamon Lecture 9 Numerical Methods for Engineering MECN 3500 Professor: Dr. Omar E. Meza Castillo"

Similar presentations


Ads by Google