Implicit Scheme for the Heat Equation

Similar documents
Tutorial 2. Introduction to numerical schemes

Introduction to numerical schemes

Linear Algebra Section 2.6 : LU Decomposition Section 2.7 : Permutations and transposes Wednesday, February 13th Math 301 Week #4

Numerical Analysis of Differential Equations Numerical Solution of Elliptic Boundary Value

30.3. LU Decomposition. Introduction. Prerequisites. Learning Outcomes

Numerical Solutions to Partial Differential Equations

Numerical Solutions to Partial Differential Equations

Finite difference method for elliptic problems: I

Finite Difference Methods for Boundary Value Problems

Applied Mathematics 205. Unit III: Numerical Calculus. Lecturer: Dr. David Knezevic

Introduction - Motivation. Many phenomena (physical, chemical, biological, etc.) are model by differential equations. f f(x + h) f(x) (x) = lim

Finite difference method for heat equation

Simple Examples on Rectangular Domains

Linear Algebra and Matrix Inversion

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

An Efficient Algorithm Based on Quadratic Spline Collocation and Finite Difference Methods for Parabolic Partial Differential Equations.

Numerical Linear Algebra

Numerical Solutions to Partial Differential Equations

Numerical Analysis of Differential Equations Numerical Solution of Parabolic Equations

Pivoting. Reading: GV96 Section 3.4, Stew98 Chapter 3: 1.3

[2] (a) Develop and describe the piecewise linear Galerkin finite element approximation of,

Numerical Solutions to Partial Differential Equations

UNIVERSITY OF MANITOBA

Numerical Linear Algebra

AMS526: Numerical Analysis I (Numerical Linear Algebra)

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

Chapter Two: Numerical Methods for Elliptic PDEs. 1 Finite Difference Methods for Elliptic PDEs

2.1 Gaussian Elimination

Introduction to PDEs and Numerical Methods Tutorial 5. Finite difference methods equilibrium equation and iterative solvers

1 Matrices and vector spaces

Time-dependent variational forms

Numerical Linear Algebra

Lecture 1 INF-MAT3350/ : Some Tridiagonal Matrix Problems

Introduction to PDEs and Numerical Methods Lecture 7. Solving linear systems

Chapter 7. Tridiagonal linear systems. Solving tridiagonal systems of equations. and subdiagonal. E.g. a 21 a 22 a A =

Math 344 Lecture # Linear Systems

Introduction to Determinants

MATH 31 - ADDITIONAL PRACTICE PROBLEMS FOR FINAL

Finite Difference Method

CSL361 Problem set 4: Basic linear algebra

Midterm for Introduction to Numerical Analysis I, AMSC/CMSC 466, on 10/29/2015

Chapter 5. Numerical Methods: Finite Differences

Scientific Computing: An Introductory Survey

AM205: Assignment 2. i=1

1 GSW Sets of Systems

The method of lines (MOL) for the diffusion equation

Linear Algebra Exercises

Math 5630: Iterative Methods for Systems of Equations Hung Phan, UMass Lowell March 22, 2018

CS 246 Review of Linear Algebra 01/17/19

AMS 147 Computational Methods and Applications Lecture 17 Copyright by Hongyun Wang, UCSC

Solving linear equations with Gaussian Elimination (I)

Chapter 6: Orthogonality

Question 9: PDEs Given the function f(x, y), consider the problem: = f(x, y) 2 y2 for 0 < x < 1 and 0 < x < 1. x 2 u. u(x, 0) = u(x, 1) = 0 for 0 x 1

Appendix C: Recapitulation of Numerical schemes

FDM for parabolic equations

Elementary matrices, continued. To summarize, we have identified 3 types of row operations and their corresponding

The Solution of Linear Systems AX = B

5. Orthogonal matrices

MTH 464: Computational Linear Algebra

G1110 & 852G1 Numerical Linear Algebra

Gaussian Elimination and Back Substitution

INTRODUCTION TO PDEs

(f(x) P 3 (x)) dx. (a) The Lagrange formula for the error is given by

Extra Problems for Math 2050 Linear Algebra I

MATH 22A: LINEAR ALGEBRA Chapter 4

Numerical Solutions to Partial Differential Equations

1 Determinants. 1.1 Determinant

. =. a i1 x 1 + a i2 x 2 + a in x n = b i. a 11 a 12 a 1n a 21 a 22 a 1n. i1 a i2 a in

MATH 3511 Lecture 1. Solving Linear Systems 1

MATH 167: APPLIED LINEAR ALGEBRA Least-Squares

CS412: Lecture #17. Mridul Aanjaneya. March 19, 2015

STAT 309: MATHEMATICAL COMPUTATIONS I FALL 2018 LECTURE 9

The Orchestra of Partial Differential Equations. Adam Larios

Block-tridiagonal matrices

TMA4212 Numerical solution of partial differential equations with finite difference methods

We could express the left side as a sum of vectors and obtain the Vector Form of a Linear System: a 12 a x n. a m2

Background. Background. C. T. Kelley NC State University tim C. T. Kelley Background NCSU, Spring / 58

Matrix decompositions

Linear Algebraic Equations

Matrix Algebra for Engineers Jeffrey R. Chasnov

A Hybrid Method for the Wave Equation. beilina

MAT 343 Laboratory 3 The LU factorization

HW2 Solutions

Scientific Computing: An Introductory Survey

Partial Differential Equations

Properties of Linear Transformations from R n to R m

7.3. Determinants. Introduction. Prerequisites. Learning Outcomes

Chapters 5 & 6: Theory Review: Solutions Math 308 F Spring 2015

STABILITY FOR PARABOLIC SOLVERS

Strauss PDEs 2e: Section Exercise 4 Page 1 of 5

MIDTERM. b) [2 points] Compute the LU Decomposition A = LU or explain why one does not exist.

9. Iterative Methods for Large Linear Systems

LINEAR SYSTEMS (11) Intensive Computation

5.1 Banded Storage. u = temperature. The five-point difference operator. uh (x, y + h) 2u h (x, y)+u h (x, y h) uh (x + h, y) 2u h (x, y)+u h (x h, y)

Matrix Factorization Reading: Lay 2.5

Linear Algebra Review

NATIONAL BOARD FOR HIGHER MATHEMATICS. Research Scholarships Screening Test. Saturday, January 20, Time Allowed: 150 Minutes Maximum Marks: 40

u n 2 4 u n 36 u n 1, n 1.

Physics 202 Laboratory 5. Linear Algebra 1. Laboratory 5. Physics 202 Laboratory

LECTURE NOTES ELEMENTARY NUMERICAL METHODS. Eusebius Doedel

Transcription:

Implicit Scheme for the Heat Equation Implicit scheme for the one-dimensional heat equation Once again we consider the one-dimensional heat equation where we seek a u(x, t) satisfying u t = νu xx + f(x, t) (x, t) (0, 1) (0, T ] u(x, 0) = u 0 (x) x [0, 1] u(0, t) = 0 t [0, T ] u(1, t) = 0 t [0, T ] (1) When we derived the explicit scheme we used a forward difference approximation for the time derivative u t Let s see what happens if we use a backward difference approximation We write the scheme at the point (x i, t n ) so that the difference equation now becomes 1 U n i U n 1 i t = ν U n i+1 2U n i + U n i 1 ( x) 2 + f(x i, t n ) for i = 1,, M 1 Now when we simplify this expression, we see that only U n 1 i is known and we move it to the right hand side The equation then becomes λui+1 n + (1 + 2λ)U i n λui 1 n = U n 1 i + tf(x i, t n ) where once again λ = ν t/( x) 2 We write our scheme as Let U 0 i = u 0 (x i ) i = 0, 1,, M For n = 0, 1, 2, λui+1 n + (1 + 2λ)U i n λui 1 n = U n 1 i + tf(x i, t n ) for i = 1,, M 1 U0 n+1 = 0 U n+1 M = 0 (2)

We can no longer solve for U1 n and then U 2 n, etc All of the values U 1 n, U 2 n U M 1 n are coupled We must solve for all of them at once This requires us to solve a linear system at each timestep and so we call the method implicit Writing the difference equation as a linear system we arrive at the following tridiagonal system 1 + 2λ λ U n 1 tf(x 1, t n ) + U n 1 λ 1 + 2λ λ U n 1 2 tf(x λ 1 + 2λ λ UM 2 n = 2, t n ) + U2 n 1 tf(x M 2, t n ) + U n 1 λ 1 + 2λ UM 1 n M 2 tf(x M 1, t n ) + U n 1 M 1 (3) Remark: Note that if we had inhomogeneous Dirichlet boundary conditions then we would have to include additional terms in the right hand side 2 Exercise scheme Write down the right hand side for the difference equations when we solve the following IBVP using this implicit u t = νu xx + f(x, t) (x, t) (0, 1) (0, T ] u(x, 0) = u 0 (x) x [0, 1] u(0, t) = 2 t [0, T ] u(1, t) = 1 t [0, T ] What are the properties of this matrix? Clearly the matrix is tridiagonal and symmetric Exercise Show that the matrix is invertible How do we efficiently solve this system of equations? First note that the coefficient matrix remains the same for all timesteps if we keep the timestep fixed Consequently all we have to do is factor the matrix once and at each timestep perform a backsolve and a forward solve In particular if we write the system as Ax = f then A can be factored as A = LL T

and thus we can solve the system as Ly = f L T x = y The second advantage is that the matrix is tridiagonal and so the system is cheap to solve To factor a general symmetric n n tridiagonal matrix A we write A = LL T where L is a lower triangular (actually bidiagonal) matrix and L T is its transpose Specifically we have a 1 b 1 b 1 a 2 b 2 b n 2 a n 1 b n 1 b n 1 a n α 1 β = 1 α 2 β n 2 α n 1 β n 1 α n α 1 β 1 α 2 β 2 α n 1 β n 1 α n (4) 3 where the α i, β i can be found from the formulas and for i = 2,, n α 1 = a 1 β i 1 = b i 1 α i 1 α i = a i β 2 i 1 The solution of the forward solve Ly = f is given by the equations and the backward solve L T x = y is given by y 1 = f 1 α 1, for i = 2,, n y i = f i β i 1 y i 1 α i x n = y n α n for i = n 1,, 1 x i = y i β i x i+1 α i Remark: For clarity we have used separate notation for the a i and α i, etc but when the algorithm is implemented we simply overwrite each a i with the α i and similarly for the b i, x i Consequently our total storage is four vectors

Analysis of the scheme We expect this implicit scheme to be order (2, 1) accurate, ie, O( x 2 + t) Substitution of the exact solution into the differential equation will demonstrate the consistency of the scheme for the inhomogeneous heat equation and give the accuracy We perform this computation here is to illustrate two differences from the consistency analysis of our explicit scheme The first is to demonstrate consistency in the norm Pointwise consistency is demonstrated identically to the case of the explicit scheme The second is to illustrate how one handles the forcing function f(x, t) in the analysis 4 remainder = λu(x i+1, t n ) + (1 + 2λ)u(x i, t n ) λu(x i 1, t n ) u(x i, t n 1 ) tf(x i, t n ) = λ [ u(x i, t n ) + x u x (x i, t n ) + ( x)2 +(1 + 2λ)u(x i, t n ) λ [ u(x i, t n ) x u x (x i, t n ) + ( x)2 u xx (x i, t n ) + ( x)3 3! u xx (x i, t n ) ( x)3 3! [ u(x i, t n ) tu t (x i, t n ) + ( t)2 u tt (x i, τ n ) ] tf(x i, t n ) = λ( x) 2 u xx (x i, t n ) + tu t (x i, t n ) λ ( x)4 Now u(x, t) satisfies the inhomogeneous DE u t = νu xx + f so that u xxxx (Θ 1, t n ) λ ( x)4 remainder = ν t ( x) 2 ( x)2 u xx (x i, t n ) + t(νu xx (x i, t n ) + f(x i, t n )) = ν t( x)2 ν t ( x) 4 ( x) 2 u xxx (x i, t n ) + ( x)4 u xxxx (Θ 1, t n ) ] u xxx (x i, t n ) + ( x)4 u xxxx (Θ 2, t n ) ] u xxxx (Θ 2 t n ) ( t)2 u tt (x i, τ n ) tf(x i, t n ) [ uxxxx (Θ 1, t n ) + u xxxx (Θ 2 t n ) ] ( t)2 u tt (x i, τ n ) tf(x i, t n ) [ uxxxx (Θ 1, t n ) + u xxxx (Θ 2 t n ) ] ( t)2 u tt (x i, τ n ) So and we have pointwise consistency remainder = to ( ( x) 2 + t )

In order to show consistency in the norm we need to go a step further Our definition states that a 2-level scheme which we write as U n+1 = Q U n + t F n (5) is consistent provided u satisfies where τ n 0 as x, t 0 u n+1 = Q u n + t F n + t τ n Our first goal is to write our difference scheme in the general form (5) We have that A U n+1 = I U n + t F n where I is the identity matrix and A is the tridiagonal matrix we derived for the scheme Now to put this equation into the form of (5) we need to write U n+1 = A 1 U n + ta 1 F n 5 Comparing this to (5) we see that Q = A 1 which is well defined since we know that A is invertible From our previous calculations for pointwise consistency we then know that u n+1 = A 1 u n + ta 1 F n + A 1 t r n where r n is the residual vector where we know each entry is to(( x) 2 + t) Consequently, τ n = A 1 r n and so we must simply show that A 1 is bounded to get the desired result since τ n = A 1 r n A 1 r n Now if we choose then we know that r n is bounded (provided of course that the derivatives u tt and u xxxx are bounded) and 1 + 3λle A 1 + 4λ since the infinity norm can be computed by taking the maximum row sum of a matrix Since A is bounded below we know that A 1 is bounded and our result follows

What is different in the implicit scheme from the explicit scheme we investigated is the stability Our implicit scheme is UNCONDITIONALLY STABLE Remark: This means that we no longer have a restriction on our choice of t Remark: The stability of this scheme is not easy to demonstrate using the technique we employed with the explicit scheme Consequently, we will delay the stability analysis until we learn Fourier stability analysis Remark: Since this is a 2-level scheme in time we can use the Lax Theorem to guarantee convergence (once we show the scheme is stable) How would our scheme change if we were solving the 2-D heat equation? Consider finding u(x, y, t) satisfying 6 u t = ν(u xx + u yy ) + f(x, y, t) (x, t) (0, 1) (0, 1) (0, T ] u(x, y, 0) = u 0 (x, y) u(0, y, t) = 0 u(1, y, t) = 0 u(x, 0, t) = 0 u(x, 1, t) = 0 Let U n ij u(x i, y j, t n ) Our difference equation then becomes (6) U n ij U n 1 ij t for i = 1,, M 1 and j = 1,, M 1 ( U n i+1,j 2Uij n = ν + U i 1,j n ( x) 2 + U i,j+1 n 2U ij n + U i,j 1 n ) + f(x ( y) 2 i, y j, t n ) For simplicity of exposition, let s assume that x = y Then simplifying the expression we arrive at λu n i+1,j + (1 + 4λ)U n ij λu n i 1,j λu n i,j+1 λu n i,j 1 = U n 1 ij + tf(x i, t n ) If we number the unknowns as U11 n, U 12 n,, U 1,M 1 n, U 2,1 n, etc then the linear system we must solve is a block tridiagonal

7 matrix of the form A λi λi A λi λi A Each block is (M 1) (M 1); here I represents the identity matrix and A is given by 1 + 4λ λ λ 1 + 4λ λ λ 1 + 4λ We have written the vector of unknowns and right hand side as U n 11 U11 n 1 + tf(x 1, y 1, t n ) U1,M 1 n U n 1 1,M 1 + tf(x 1, y M 1, t n ) U21 n U21 n 1 + tf(x 2, y 1, t n ) U2,M 1 n and U n 1 2,M 1 + tf(x 2, y M 1, t n ) UM 1,1 n U n 1 M 1,1 + tf(x M 1, 1, t n ) UM 1,M 1 n U n 1 M 1,M 1 + tf(x m 1, y M 1, t n ) Remark: Of course if our problem had inhomogeneous Dirichlet boundary data then we would have had some additional terms added onto the boundary Exercise Write out the right hand side for the implicit difference scheme approximating the IBVP

u t = ν(u xx + u yy ) (x, t) (0, 1) (0, 1) (0, T ] u(x, y, 0) = u 0 (x) x [0, 1] u(0, y, t) = 0 t [0, T ] u(1, y, t) = 0 u(x, 0, t = 4 u(x, 1, t) = 5 Once again our coefficient matrix is symmetric and positive definite so we can perform an LL T before decomposition and solve as A general n n symmetric block tridiagonal matrix can be efficiently factored as A 1 B 1 C 1 C1 T D T 1 B 1 A 2 B 2 = D 1 C 2 C 2 T D2 T 8 B n 1 A n D n 1 C n C T n where A 1 = C 1 C T 1 C 1 D T 1 = B 1, etc In our case A 1, etc, are tridiagonal matrices so we simply perform an LL T the D i we simply solve a lower triangular systems decomposition to determine C 1 For determining