Numerical Methods Process Systems Engineering ITERATIVE METHODS. Numerical methods in chemical engineering Edwin Zondervan

Similar documents
PARTIAL DIFFERENTIAL EQUATIONS (PDE S) I

JACOBI S ITERATION METHOD

Lecture 18 Classical Iterative Methods

Scientific Computing WS 2018/2019. Lecture 9. Jürgen Fuhrmann Lecture 9 Slide 1

Iterative Methods. Splitting Methods

Numerical Solution Techniques in Mechanical and Aerospace Engineering

Scientific Computing with Case Studies SIAM Press, Lecture Notes for Unit VII Sparse Matrix

AMS526: Numerical Analysis I (Numerical Linear Algebra for Computational and Data Sciences)

MA3232 Numerical Analysis Week 9. James Cooley (1926-)

Introduction to Scientific Computing

Department of Mathematics California State University, Los Angeles Master s Degree Comprehensive Examination in. NUMERICAL ANALYSIS Spring 2015

Chapter 12: Iterative Methods

9.1 Preconditioned Krylov Subspace Methods

Chapter 7 Iterative Techniques in Matrix Algebra

Contents. Preface... xi. Introduction...

The amount of work to construct each new guess from the previous one should be a small multiple of the number of nonzeros in A.

6. Iterative Methods for Linear Systems. The stepwise approach to the solution...

Motivation: Sparse matrices and numerical PDE's

Numerical Analysis: Solutions of System of. Linear Equation. Natasha S. Sharma, PhD

Up to this point, our main theoretical tools for finding eigenvalues without using det{a λi} = 0 have been the trace and determinant formulas

The Conjugate Gradient Method

9. Iterative Methods for Large Linear Systems

= V I = Bus Admittance Matrix. Chapter 6: Power Flow. Constructing Ybus. Example. Network Solution. Triangular factorization. Let

AMS526: Numerical Analysis I (Numerical Linear Algebra)

Solving Linear Systems

Preface to the Second Edition. Preface to the First Edition

1 Number Systems and Errors 1

Introduction to Applied Linear Algebra with MATLAB

Iterative methods for Linear System of Equations. Joint Advanced Student School (JASS-2009)

Cache Oblivious Stencil Computations

NUMERICAL COMPUTATION IN SCIENCE AND ENGINEERING

Numerical Programming I (for CSE)

Kasetsart University Workshop. Multigrid methods: An introduction

ITERATIVE METHODS FOR SPARSE LINEAR SYSTEMS

OUTLINE ffl CFD: elliptic pde's! Ax = b ffl Basic iterative methods ffl Krylov subspace methods ffl Preconditioning techniques: Iterative methods ILU

CME342 Parallel Methods in Numerical Analysis. Matrix Computation: Iterative Methods II. Sparse Matrix-vector Multiplication.

Bindel, Fall 2016 Matrix Computations (CS 6210) Notes for

Iterative Methods for Solving A x = b

Lab 1: Iterative Methods for Solving Linear Systems

Iterative Methods and Multigrid

Iterative Methods for Linear Systems

Poisson Equation in 2D

ME Computational Fluid Mechanics Lecture 5

CS 323: Numerical Analysis and Computing

Chapter 9 Implicit integration, incompressible flows

Chapter 6. Nonlinear Equations. 6.1 The Problem of Nonlinear Root-finding. 6.2 Rate of Convergence

Algebra C Numerical Linear Algebra Sample Exam Problems

Review of matrices. Let m, n IN. A rectangle of numbers written like A =

Statistical Geometry Processing Winter Semester 2011/2012

Jordan Journal of Mathematics and Statistics (JJMS) 5(3), 2012, pp A NEW ITERATIVE METHOD FOR SOLVING LINEAR SYSTEMS OF EQUATIONS

Lecture 11: CMSC 878R/AMSC698R. Iterative Methods An introduction. Outline. Inverse, LU decomposition, Cholesky, SVD, etc.

Numerical Methods - Numerical Linear Algebra

Chapter 5. Methods for Solving Elliptic Equations

Algebraic Multigrid as Solvers and as Preconditioner

Lecture 9 Approximations of Laplace s Equation, Finite Element Method. Mathématiques appliquées (MATH0504-1) B. Dewals, C.

Preliminary/Qualifying Exam in Numerical Analysis (Math 502a) Spring 2012

Linear Algebraic Equations

Theory of Iterative Methods

Solving Linear Systems of Equations

Finite Difference Methods (FDMs) 1

DEN: Linear algebra numerical view (GEM: Gauss elimination method for reducing a full rank matrix to upper-triangular

A Comparison of Solving the Poisson Equation Using Several Numerical Methods in Matlab and Octave on the Cluster maya

The Solution of Linear Systems AX = B

Next topics: Solving systems of linear equations

Solving Sparse Linear Systems: Iterative methods

Solving Sparse Linear Systems: Iterative methods

Sparse Matrices and Iterative Methods

CLASSICAL ITERATIVE METHODS

Scientific Computing: An Introductory Survey

Geometric Modeling Summer Semester 2010 Mathematical Tools (1)

Introduction to Compact Dynamical Modeling. II.1 Steady State Simulation. Luca Daniel Massachusetts Institute of Technology. dx dt.

Solving Linear Systems

Lecture Note 7: Iterative methods for solving linear systems. Xiaoqun Zhang Shanghai Jiao Tong University

Today s class. Linear Algebraic Equations LU Decomposition. Numerical Methods, Fall 2011 Lecture 8. Prof. Jinbo Bi CSE, UConn

DonnishJournals

SOLVING SPARSE LINEAR SYSTEMS OF EQUATIONS. Chao Yang Computational Research Division Lawrence Berkeley National Laboratory Berkeley, CA, USA

Summary of Iterative Methods for Non-symmetric Linear Equations That Are Related to the Conjugate Gradient (CG) Method

Boundary Value Problems and Iterative Methods for Linear Systems

Comparison of Fixed Point Methods and Krylov Subspace Methods Solving Convection-Diffusion Equations

Math 471 (Numerical methods) Chapter 3 (second half). System of equations

Notes for CS542G (Iterative Solvers for Linear Systems)

Sparsity. The implication is that we would like to find ways to increase efficiency of LU decomposition.

Numerical Methods I Non-Square and Sparse Linear Systems

Lecture 11. Fast Linear Solvers: Iterative Methods. J. Chaudhry. Department of Mathematics and Statistics University of New Mexico

Iterative Solvers. Lab 6. Iterative Methods

Iterative Methods for Sparse Linear Systems

APPLIED NUMERICAL LINEAR ALGEBRA

Parallel Numerics, WT 2016/ Iterative Methods for Sparse Linear Systems of Equations. page 1 of 1

Stabilization and Acceleration of Algebraic Multigrid Method

6.4 Krylov Subspaces and Conjugate Gradients

Solving PDEs with CUDA Jonathan Cohen

Iterative methods for Linear System

AIMS Exercise Set # 1

Computational Economics and Finance

Classical iterative methods for linear systems

Homework 6 MA/CS 375, Fall 2005 Due December 15

Multigrid Methods for Discretized PDE Problems

1 Kernel methods & optimization

COURSE Iterative methods for solving linear systems

Generalized AOR Method for Solving System of Linear Equations. Davod Khojasteh Salkuyeh. Department of Mathematics, University of Mohaghegh Ardabili,

Transcription:

IERAIVE MEHODS Numerical methods in chemical engineering Edwin Zondervan 1

OVERVIEW Iterative methods for large systems of equations We will solve Laplace s equation for steady state heat conduction

LAPLACE S EQUAIONS t (4-1) hermal diffusivity he steady state problem: 0 (4-) y = b y 0 (4-3) = b3 = b4 = b1 3

RACK EMPERAURE ON A j =Ny (Ny-1)N+1 GRID Inde of a node is given by: K = i + N(j-1) j =3 So that: j = N+1 N+ N+3 N i,j = =i+n(j-1) j =1 1 3 N i =1 i = i =3 i =N 4

ESIMAES OF HE SECOND DIFFERENIALS FOR Assume a piece-wise linear profile in the temperature, e.g.: i+1 i 1/ i 1/ (4-4) i-1 i i i 1, j 1, j i, j i, j i i, j 1, j i 1, j (4-5) 5

INCLUDE HE ESIMAES OF HE SECOND DIFFERENIALS FOR y i 1, j i, j i 1, j i 1, j i, j y i 1, j 0 (4-6) 1 1 N y N 0 (4-7) Equal spaced grid = y =1 N 4 1 1 N 0 (4-8) 6

BOUNDARY CONDIIONS For the nodes on the boundary, we have a simple equations:,boundary some fied temperature he equation on the previous slide and the boundaries can be written as a matri equation: A b (4-10) (4-9) 7

LE S WRIE HIS SUFF AS MARIX EQUAIONS N=5; %number of points along direction Ny=5; %number of points in the y direction d = 1/N; %the grid spacing Alpha = 1; %thermal diffusivity e = ones(nny,1); A = spdiags([e,e,-4e,e,e],[-n,-1,0,1,n],nny,nny); A = Aalpha/d^; 8

MARIX SPARSIY Spy(A) N=Ny = 5 A sparse matri structure, 0 5 10 which is not tridiagonal: there are offset bands. Offset bands can cause your trouble!! 15 0 5 0 5 10 15 0 5 nz = 113 9

SOLUION O HE LAPLACE EQUAION You can solve the system with \, for N=Ny=5 and b1 = 10 b = b3 = b4 = 0 0.9 0.8 0.7 0.6 0.5 0.4 t= 3 tau 10 9 8 7 6 5 4 0.3 3 0. 0.1 1 0 0 0.1 0. 0.3 0.4 0.5 0.6 0.7 0.8 0 10

LU decomposition [L,U,P] = lu(a) subplot(1,,1) spy(l) subplot(1,,) spy(u) With LU decomposition we produce matrices that are less sparse than the original matri. 0 5 0 5 10 15 0 5 0 10 0 nz = 19 10 15 0 5 0 10 0 nz = 19 11

LU DECOMPOSIION Gaussian elimination on a matri lie A requires more memory (with 3D problems, the offset in the diagonal would even be bigger!) In general etra memory allocation will not be a problem for MALAB MALAB is clever, in that sense that it attempts to reorder equations, to move elements closer to the diagonal) 1

IERAIVE MEHODS Alternatives for Gaussian elimination Use iterative methods when systems are large and sparse. Often such systems are encountered when we want to solve PDE s of higher dimensions (>1D) 13

EXAMPLES Jacobi method Gauss-Seidel method Succesive over relaation bicg Bi-conjugate gradient method gmres generalized minimum residuals method bicgstab Bi-conjugate gradient method 14

HE JACOBI MEHOD In our previous eample we derived the following equation: N 1 4 1 N 0 (4-11) Rearranging: N 4 1 1 N (4-1) 15

HE JACOBI MEHOD In the Jacobi scheme the iteration proceeds as follows: Start with an initial guess for the values of at each node, we calculate an new, updated values using the equation of the previous slide and store a new vector:, new N, old 1, old 4 1, old N, old (4-13) Do this for all other nodes, and use new values as guess, Repeat! 16

DIAGRAM OF JACOBI MEHOD Move to net node Set old = new NO NO Set old = a gues Calculate the new node temperature from the guessed values Have all nodes been updated? YES Is ma( new - old ) < tolerance? YES Report the answer as new Only two vectors need to be stored: the old emp. And the new emp. 17

18 Numerical Methods NOW WIH MARICES A A Consider a matri A: Split it into a diagonal matri D and another matri S:

SOLVE A-b Now we can solve A=b by: (D+S). = b D. = b S. D. new = b S. old new = D -1 (b-s. old ) 19

CONVERGENCE OF HE MEHOD Now we define an error at the -th iteration: error = - he error at the net iteration is: +1 = D -1 (b-s. ) Error +1 + = D -1 (b-s.error -S.) D.error +1 =-S.error Error +1 = -D -1 S.error Eigenvalues of D -1 S must always have modulus < 1, to ensure that error +1 < error 0

CONVERGENGE OF HE MEHOD We can epress the vector of error in terms of eigenvectors of D -1 S: So: error= a 1 u 1 + a u + a 3 u 3 + a 4 u 4 + error +1 = -D -1 S(a 1 u 1 + a u + a 3 u 3 + a 4 u 4 + ) = -a 1 D -1 Su 1 -a D -1 Su -a 3 D -1 Su 3 -a 4 D - 1 Su 4 + = -a 1 u 1 -a u -a 3 u 3 -a 4 u 4 + he magnitude of the error will grow each iteration, if s have a comple module >1, So: Find the largest magnitude of eigenvalues for the matri D -1 S (4-14) (4-15) 1

GERSHGORIN S HEOREM For a square matri and row, an eigenvalue is located on the comple plane within a radius equal or less to the sum of the moduli of the off-diagonal elements of that row. m m,1 m,... m, N m, N 1 m,, N (4-16) Im( ) Radius = sum of moduli of off-diagonal elements he eigenvalue must be in this circle. m, Re( )

APPLICAION OF GERSHGORIN S HEOREM Appying Gershgorin s theorem to our Jacobi iteration, the off-diagonal elements of row of D - 1 S are 1/a. times the off-diagonal elements of our original matri A, while the diagonal element is zero: For <1: j a, j, a (4-17) Stability: size of diagonal element must be larger that the sum of moduli of the other elements, such matri is called diagonally dominant. 3

SUMMARY Partial differential equations can be written as sparse systems of linear equations Sparse systems can be handled with a direct method lie Gaussian elimination If you have systems of more than 1 dimension, a direct method still can be used, if there are no memory issues, otherwise an iterative method may be attractive. he Jacobi method was introduced. Many other methods are based on the Jacobi method (SOR method, for eample) 4