An Introduction to Computational Fluid Mechanics By Chuen-Yen Chow.

Slides:



Advertisements
Similar presentations
SE301: Numerical Methods Topic 8 Ordinary Differential Equations (ODEs) Lecture KFUPM Read , 26-2, 27-1 CISE301_Topic8L8&9 KFUPM.
Advertisements

Dynamics of a four-bar linkage
Chapter 8 Elliptic Equation.
Algebraic, transcendental (i.e., involving trigonometric and exponential functions), ordinary differential equations, or partial differential equations...
Ch 2.1: Linear Equations; Method of Integrating Factors
Ordinary Differential Equations S.-Y. Leu Sept. 21, 2005.
Ordinary Differential Equations S.-Y. Leu Sept. 21,28, 2005.
Linear Simultaneous Equations
1 Chapter 9 Differential Equations: Classical Methods A differential equation (DE) may be defined as an equation involving one or more derivatives of an.
Differential Equations and Boundary Value Problems
Numerical Solution of Ordinary Differential Equation
3.2 Solving Systems Algebraically 2. Solving Systems by Elimination.
Solving System of Linear Equations. 1. Diagonal Form of a System of Equations 2. Elementary Row Operations 3. Elementary Row Operation 1 4. Elementary.
Unit 1.3 USE YOUR CALCULATOR!!!.
Chapter 4 – Graphing Linear Equations 4.7 – Solving Linear Equations Using Graphs.
AN INTRODUCTION TO ELEMENTARY ROW OPERATIONS Tools to Solve Matrices.
Fin500J Topic 6Fall 2010 Olin Business School 1 Fin500J: Mathematical Foundations in Finance Topic 6: Ordinary Differential Equations Philip H. Dybvig.
Inverses and Systems Section Warm – up:
Ordinary Differential Equations
13.6 MATRIX SOLUTION OF A LINEAR SYSTEM.  Examine the matrix equation below.  How would you solve for X?  In order to solve this type of equation,
Goal: Solve a system of linear equations in two variables by the linear combination method.
Scientific Computing Partial Differential Equations Implicit Solution of Heat Equation.
Solving Linear Systems of Equations - Addition Method Recall that to solve the linear system of equations in two variables... we need to find the values.
Algebra a Niagara Falls Get ready for a “Small Quiz” to be written on your grade sheet.
Engineering Analysis – Computational Fluid Dynamics –
1 ECE 1304 Introduction to Electrical and Computer Engineering Section 1.7 Linear Algebra with MATLAB.
Do Now (3x + y) – (2x + y) 4(2x + 3y) – (8x – y)
Elimination method Solving linear equations simultaneously.
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display. by Lale Yurttas, Texas A&M University Chapter 271 Boundary-Value.
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1 Chapter 27.
4.8 Using matrices to solve systems! 2 variable systems – by hand 3 or more variables – using calculator!
Math 3120 Differential Equations with Boundary Value Problems
Differential Equations Linear Equations with Variable Coefficients.
GUIDED PRACTICE for Example – – 2 12 – 4 – 6 A = Use a graphing calculator to find the inverse of the matrix A. Check the result by showing.
SOLVING SYSTEMS USING ELIMINATION 6-3. Solve the linear system using elimination. 5x – 6y = -32 3x + 6y = 48 (2, 7)
PreCalculus Section 1.6 Solve quadratic equations by: a. Factoring b. Completing the square c. Quadratic formula d. Programmed calculator Any equation.
1 ECE 102 Engineering Computation Chapter 3 Math Review 3: Cramer’s Rule Dr. Herbert G. Mayer, PSU Status 10/11/2015 For use at CCUT Fall 2015.
1 ECE 221 Electric Circuit Analysis I Chapter 6 Cramer’s Rule Herbert G. Mayer, PSU Status 11/14/2014 For use at Changchun University of Technology CCUT.
Determinants Every n  n matrix A is associated with a real number called the determinant of A, written  A . The determinant of a 2  2 matrix.
3.8B Solving Systems using Matrix Equations and Inverses.
Chapter 5: Systems of Linear Equations Section 5.1: Solving Systems of Linear Equations by Elimination.
Lecture 9 Numerical Analysis. Solution of Linear System of Equations Chapter 3.
WARM-UP. SYSTEMS OF EQUATIONS: ELIMINATION 1)Rewrite each equation in standard form, eliminating fraction coefficients. 2)If necessary, multiply one.
Numerical Analysis Lecture 28. Chapter 7 Numerical Differentiation and Integration.
College Algebra Chapter 6 Matrices and Determinants and Applications
Simultaneous Equations 1
6) x + 2y = 2 x – 4y = 14.
INTEGRATION & TECHNIQUES OF INTEGRATION
ECE 3301 General Electrical Engineering
Solving Systems of Linear Equations in 3 Variables.
Numerical Analysis Lecture12.
We will be looking for a solution to the system of linear differential equations with constant coefficients.
Chapter 8: Linear Systems of Equations
3. Further algebraic skills and techniques
Solving Linear Systems Algebraically
Simultaneous Equations
Equations Containing Decimals
Numerical Analysis Lecture13.
SIMULTANEOUS EQUATIONS 1
Unit 23 Algebraic Manipulation
Solving Systems of Linear Equations in 3 Variables.
Systems of Equations Solve by Graphing.
Section Solving Linear Systems Algebraically
Example 2B: Solving Linear Systems by Elimination
Solving Systems Algebraically
Solving a System of Linear Equations
Numerical Analysis Lecture11.
Matrices and Linear Equations
Multiply by 5/40 and sum with 2nd row
Solving Systems of Linear Equations by Elimination
Presentation transcript:

An Introduction to Computational Fluid Mechanics By Chuen-Yen Chow

Numerical Solution of Ordinary Differential Equations: Initial-Value Problems

Chapter Numerical Solution of Second-Order ODE Boundary Value Problems

* Linear second order ODE of the form * The approximation by the difference equation * Multiplying the equation by and grouping the terms

* It can be written in a more convenient form

* The preceding coefficients are known constants at any interior point in the specified range of x, applied at i=1,2,….,n * n linear algebraic equations to be solved simultaneously for n unknown  For i = 1 and n  Since and are known from the boundary conditions and constant * Therefore are moved to the right

* The coefficient matrix on the left-hand side is called a tridiagonal matrix * This matrix can be solved by using the Gaussian elimination method

* According to Gaussian elimination method, we multiply the second equation by and the first by and then take the difference of the two to eliminate * The resulting equation is * If we replace the following

* The same process is repeated for i = 3, 4, ….., n-1 * The remaining coefficients will be as following * Where i = 2,3,….,n-1 * The value of can immediately be found by solving simultaneously the last two equations

* The remaining unknowns can be calculated in a backward order the following formula j = n-1, n-2, ……., 2, 1

Constants declaration TMAX = 1.08; DT = 0.002; NM = (TMAX/DT) + 1; NU = ; DOMAINy = 40.0/1000.0; JM = 41; DY = DOMAINy/(JM-1); U0 = 40.0; D = NU * DT / (DY*DY); U(1) = U0; UO(1) = U0; for J=2:JM % Reset U and UO arrays U(J) = 0.0; UO(J) = 0.0; end

% Solution using LAASONEN Method N = JM - 2; JMM1= JM - 1; for K=1:NM for J=1:JM UO(J) = U(J); UP(J,K) = U(J); end

SPECIFY BOUNDARY CONDITIONS AND MODIFY SOME OF THE COEFFICIENTS for J=1:N C(J,1) = D; C(J,2) = -( *D); C(J,3) = D; C(J,4) = -U(J+1); end C(1,4) = C(1,4) - C(1,1)*U(1); C(1,1) = 0.0; C(N,4) = C(N,4) - C(N,3)*U(JM); C(N,3) = 0.0; % TRIDIGONAL SOLUTION for J = 2:N-1 C(J,2) = C(J,2)*C(J-1,2) - C(J,1)*C(J-1,3); C(J,3) = C(J,3)*C(J-1,2); C(J,4) = C(J,4)*C(J-1,2) - C(J,1)*C(J-1,4); end

COMPUTE PHI AND U AT INTERIOR POINT F(N) = ( C(N,4)*C(N-1,2) - C(N,1)*C(N-1,4) ) / ( C(N,2)*C(N-1,2) - C(N,1)*C(N-1,3) ); for K = 1:(N-1) J = N - K; F(J) = ( C(J,4) - C(J,3)*F(J+1) ) / C(J,2); end for J = 2:JMM1 U(J) = F(J-1); end

END