Finite difference method for 2-D heat equation

Σχετικά έγγραφα
CHAPTER 25 SOLVING EQUATIONS BY ITERATIVE METHODS

Second Order Partial Differential Equations

3.4 SUM AND DIFFERENCE FORMULAS. NOTE: cos(α+β) cos α + cos β cos(α-β) cos α -cos β

Finite Field Problems: Solutions

Section 7.6 Double and Half Angle Formulas

Section 8.3 Trigonometric Equations

1 String with massive end-points

Exercises 10. Find a fundamental matrix of the given system of equations. Also find the fundamental matrix Φ(t) satisfying Φ(0) = I. 1.

derivation of the Laplacian from rectangular to spherical coordinates

D Alembert s Solution to the Wave Equation

EE512: Error Control Coding

Fourier Series. MATH 211, Calculus II. J. Robert Buchanan. Spring Department of Mathematics

HOMEWORK 4 = G. In order to plot the stress versus the stretch we define a normalized stretch:

Homework 3 Solutions

Partial Differential Equations in Biology The boundary element method. March 26, 2013

Inverse trigonometric functions & General Solution of Trigonometric Equations

Example Sheet 3 Solutions

Phys460.nb Solution for the t-dependent Schrodinger s equation How did we find the solution? (not required)

Derivation of Optical-Bloch Equations

Areas and Lengths in Polar Coordinates

b. Use the parametrization from (a) to compute the area of S a as S a ds. Be sure to substitute for ds!

2 Composition. Invertible Mappings

PARTIAL NOTES for 6.1 Trigonometric Identities

Forced Pendulum Numerical approach

Areas and Lengths in Polar Coordinates

Approximation of distance between locations on earth given by latitude and longitude

Math221: HW# 1 solutions

ΚΥΠΡΙΑΚΗ ΕΤΑΙΡΕΙΑ ΠΛΗΡΟΦΟΡΙΚΗΣ CYPRUS COMPUTER SOCIETY ΠΑΓΚΥΠΡΙΟΣ ΜΑΘΗΤΙΚΟΣ ΔΙΑΓΩΝΙΣΜΟΣ ΠΛΗΡΟΦΟΡΙΚΗΣ 19/5/2007

ECE Spring Prof. David R. Jackson ECE Dept. Notes 2

Απόκριση σε Μοναδιαία Ωστική Δύναμη (Unit Impulse) Απόκριση σε Δυνάμεις Αυθαίρετα Μεταβαλλόμενες με το Χρόνο. Απόστολος Σ.

Second Order RLC Filters

Numerical Analysis FMN011

Concrete Mathematics Exercises from 30 September 2016

CHAPTER 101 FOURIER SERIES FOR PERIODIC FUNCTIONS OF PERIOD

Durbin-Levinson recursive method

CRASH COURSE IN PRECALCULUS

Higher Derivative Gravity Theories

Srednicki Chapter 55

9.09. # 1. Area inside the oval limaçon r = cos θ. To graph, start with θ = 0 so r = 6. Compute dr

Lecture 26: Circular domains

Practice Exam 2. Conceptual Questions. 1. State a Basic identity and then verify it. (a) Identity: Solution: One identity is csc(θ) = 1

Homework 8 Model Solution Section

Matrices and Determinants

Integrals in cylindrical, spherical coordinates (Sect. 15.7)

Solutions to Exercise Sheet 5

SCHOOL OF MATHEMATICAL SCIENCES G11LMA Linear Mathematics Examination Solutions

The Simply Typed Lambda Calculus

Problem Set 3: Solutions

MATH423 String Theory Solutions 4. = 0 τ = f(s). (1) dτ ds = dxµ dτ f (s) (2) dτ 2 [f (s)] 2 + dxµ. dτ f (s) (3)

Section 9.2 Polar Equations and Graphs

Lecture 2: Dirac notation and a review of linear algebra Read Sakurai chapter 1, Baym chatper 3

CHAPTER 48 APPLICATIONS OF MATRICES AND DETERMINANTS

Uniform Convergence of Fourier Series Michael Taylor

ES440/ES911: CFD. Chapter 5. Solution of Linear Equation Systems

6.3 Forecasting ARMA processes

Econ Spring 2004 Instructor: Prof. Kiefer Solution to Problem set # 5. γ (0)

w o = R 1 p. (1) R = p =. = 1

Partial Trace and Partial Transpose

( y) Partial Differential Equations

TMA4115 Matematikk 3

DESIGN OF MACHINERY SOLUTION MANUAL h in h 4 0.

SCITECH Volume 13, Issue 2 RESEARCH ORGANISATION Published online: March 29, 2018

6.1. Dirac Equation. Hamiltonian. Dirac Eq.

Tridiagonal matrices. Gérard MEURANT. October, 2008

Pg The perimeter is P = 3x The area of a triangle is. where b is the base, h is the height. In our case b = x, then the area is

Variational Wavefunction for the Helium Atom

Chapter 6: Systems of Linear Differential. be continuous functions on the interval

Differentiation exercise show differential equation

Problem Set 9 Solutions. θ + 1. θ 2 + cotθ ( ) sinθ e iφ is an eigenfunction of the ˆ L 2 operator. / θ 2. φ 2. sin 2 θ φ 2. ( ) = e iφ. = e iφ cosθ.

Overview. Transition Semantics. Configurations and the transition relation. Executions and computation

Problem 1.1 For y = a + bx, y = 4 when x = 0, hence a = 4. When x increases by 4, y increases by 4b, hence b = 5 and y = 4 + 5x.

2. THEORY OF EQUATIONS. PREVIOUS EAMCET Bits.

Solution to Review Problems for Midterm III

Similarly, we may define hyperbolic functions cosh α and sinh α from the unit hyperbola

Appendix to On the stability of a compressible axisymmetric rotating flow in a pipe. By Z. Rusak & J. H. Lee

Jesse Maassen and Mark Lundstrom Purdue University November 25, 2013

Math 6 SL Probability Distributions Practice Test Mark Scheme

ANSWERSHEET (TOPIC = DIFFERENTIAL CALCULUS) COLLECTION #2. h 0 h h 0 h h 0 ( ) g k = g 0 + g 1 + g g 2009 =?

Review Test 3. MULTIPLE CHOICE. Choose the one alternative that best completes the statement or answers the question.

Ordinal Arithmetic: Addition, Multiplication, Exponentiation and Limit

DiracDelta. Notations. Primary definition. Specific values. General characteristics. Traditional name. Traditional notation

4.6 Autoregressive Moving Average Model ARMA(1,1)

Fractional Colorings and Zykov Products of graphs

Trigonometry 1.TRIGONOMETRIC RATIOS

is like multiplying by the conversion factor of. Dividing by 2π gives you the

C.S. 430 Assignment 6, Sample Solutions

Figure A.2: MPC and MPCP Age Profiles (estimating ρ, ρ = 2, φ = 0.03)..

University of Illinois at Urbana-Champaign ECE 310: Digital Signal Processing

Εγκατάσταση λογισμικού και αναβάθμιση συσκευής Device software installation and software upgrade

- 1+x 2 - x 3 + 7x x x x x x 2 - x 3 - -


EE101: Resonance in RLC circuits

1. (a) (5 points) Find the unit tangent and unit normal vectors T and N to the curve. r(t) = 3cost, 4t, 3sint

Section 8.2 Graphs of Polar Equations

Notes on the Open Economy

On the Galois Group of Linear Difference-Differential Equations

Mock Exam 7. 1 Hong Kong Educational Publishing Company. Section A 1. Reference: HKDSE Math M Q2 (a) (1 + kx) n 1M + 1A = (1) =

2. Μηχανικό Μαύρο Κουτί: κύλινδρος με μια μπάλα μέσα σε αυτόν.

상대론적고에너지중이온충돌에서 제트입자와관련된제동복사 박가영 인하대학교 윤진희교수님, 권민정교수님

Strain gauge and rosettes

Transcript:

Finite difference method for 2-D heat equation Praveen. C praveen@math.tifrbng.res.in Tata Institute of Fundamental Research Center for Applicable Mathematics Bangalore 560065 http://math.tifrbng.res.in/~praveen January 27, 2013 1 / 23

Heat equation Partial differential equation in Ω = (0, 1) (0, 1), µ > 0 u t = µ(u xx + u yy ), (x, y) Ω, t > 0 u(x, y, 0) = f(x, y), (x, y) Ω u(x, y, t) = g(x, y, t), (x, y) Ω, t > 0 Space mesh of (M x + 1) (M y + 1) points in Ω x = 1 M x, x j = j x, j = 0, 1,..., M x y = 1 M y, y k = k y, k = 0, 1,..., M y 2 / 23

FTCS scheme D + t u n = µ(d + x D x u n + D + y D y u n ) Define D t + u n = un+1 t un, D + x D x u n = un j 1,k 2un + un j+1,k x 2 D + y D y u n = un 1 2un + un +1 y 2 r x = µ t x 2, Define undivided finite differences r y = µ t y 2 δ 2 xu n = u n j 1,k 2u n + u n j+1,k, δ 2 yu n = u n 1 2u n + u n +1 FTCS scheme or u n+1 u n+1 = un + r x δ 2 xu n + r y δ 2 yu n = (1 + r xδ 2 x + r y δ 2 y)u n 3 / 23

FTCS scheme: maximum stability If then u n+1 = (1 2r x 2r y )u n + r x (u n j 1,k + u n j+1,k) + r y (u n 1 + u n +1) r x + r y 1 2 min(u n j±1,k, u n ±1, u n ) u n+1 max(un j±1,k, u n ±1, u n ) so that the scheme is stable in maximum norm. If x = y = h, then 2µ t h 2 1 2 = t h2 4µ This time step restriction is half the value in one dimension. 4 / 23

FTCS scheme: Fourier stability Take Fourier mode with wave-number (ξ, η) ( π, +π) ( π, +π) u n = û n e i(jξ+kη) Then where û n+1 = ρû n ρ(ξ, η) = 1 + 2r x (cos ξ 1) + 2r y (cos η 1) = 1 4r x sin 2 (ξ/2) 4r y sin 2 (η/2) For stability we need ρ(ξ, η) 1. Maximum value of ρ ρ = 1 at (ξ, η) = (0, 0) and minimum value of ρ ρ = 1 4r x 4r y at (ξ, η) = (π, π) Hence we have stability provided r x + r y 1 2 5 / 23

BTCS scheme or u n+1 = un + r x δxu 2 n+1 + r yδyu 2 n+1 (1 r x δ 2 y r y δ 2 y)u n+1 Amplification factor Amplification factor ρ = BTCS scheme is unconditionally stable. = un 1 1 + 4r x sin 2 (ξ/2) + 4r y sin 2 (η/2) 1 6 / 23

Crank-Nicholson scheme or u n+1 = u n un + r x δx 2 + un+1 + r y δy 2 2 (1 1 2 r xδ 2 x 1 2 r yδ 2 y)u n+1 u n + un+1 2 = (1 + 1 2 r xδ 2 x + 1 2 r yδ 2 y)u n Amplification factor ρ = 1 2r x sin 2 (ξ/2) 2r y sin 2 (η/2) 1 + 2r x sin 2 (ξ/2) + 2r y sin 2 (η/2) 1 Crank-Nicholson scheme is unconditionally stable. 7 / 23

Peaceman-Rachford scheme Update solution in two steps Step 1: Implicit in x t n t n + 1 2 t tn+1, u n u n+ 1 2 u n+1 or u n+ 1 2 u n 1 2 t = µ x 2 δ2 xu n+ 1 2 + µ y 2 δ2 yu n (1 1 2 r xδ 2 x)u n+ 1 2 = (1 + 1 2 r yδ 2 y)u n Step 2: Implicit in y or u n+1 1 un+ 2 1 2 t = µ x 2 δ2 xu n+ 1 2 + µ y 2 δ2 yu n+1 (1 1 2 r yδy)u 2 n+1 = (1 + 1 2 r xδx)u 2 n+ 1 2 8 / 23

Peaceman-Rachford scheme: Fourier stability Step 1: [1 + 2r x sin 2 (ξ/2)]û n+ 1 2 = [1 2ry sin 2 (η/2)]û n Step 2: [1 + 2r y sin 2 (η/2))û n+1 = [1 2r x sin 2 (ξ/2)]û n+ 1 2 Combining the two ρ = ûn+1 û n = [1 2r x sin 2 (ξ/2)][1 2r y sin 2 (η/2)] [1 + 2r x sin 2 (ξ/2)][1 + 2r y sin 2 (η/2)] 1 The scheme is unconditionally stable. 9 / 23

Peaceman-Rachford scheme: Consistency From Step 1 (1 1 2 r xδ 2 x)u n+ 1 2 = (1 + 1 2 r yδ 2 y)u n Multiply on both sides (1 + 1 2 r xδ 2 x)(1 1 2 r xδ 2 x)u n+ 1 2 = (1 + 1 2 r xδ 2 x)(1 + 1 2 r yδ 2 y)u n Operators on left commute Using Step 2 (1 1 2 r xδx) 2 (1 + 1 2 r xδx)u 2 n+ 1 2 = (1 + 1 }{{} 2 r xδx)(1 2 + 1 2 r yδy)u 2 n use Step 2 (1 1 2 r xδ 2 x)(1 1 2 r yδ 2 y)u n+1 = (1 + 1 2 r xδ 2 x)(1 + 1 2 r yδ 2 y)u n 10 / 23

Peaceman-Rachford scheme: Consistency Expand difference operators on both sides u n+1 u t = µ u n x 2 δ2 + un+1 x 2 µ2 t 4 δ 2 x x 2 + µ y 2 δ2 y δy 2 y 2 (un+1 un ) u n + un+1 2 This is Crank-Nicholson scheme with an extra term. This term is O ( t 2) since δx 2 δ 2 ( y 5 ) n x 2 y 2 (un+1 u un ) = t t 2 x 2 + O ( t x 2 + t y 2 + t 2) y Hence the Peaceman-Rachford scheme is second order accurate in space and time. 11 / 23

D Yakonov Scheme Peaceman-Rachford scheme (1 1 2 r xδx) 2 (1 1 2 r yδy)u 2 n+1 = (1 + 1 }{{} 2 r xδx)(1 2 + 1 2 r yδy)u 2 n u Step 1: Solve for u Step 2: Solve for u n+1 (1 1 2 r xδ 2 x)u = (1 + 1 2 r xδ 2 x)(1 + 1 2 r yδ 2 y)u n (1 1 2 r yδ 2 y)u n+1 = u 12 / 23

Approximate factorization Peaceman-Rachford scheme is close to Crank-Nicholson scheme (1 1 2 r xδ 2 x 1 2 r yδ 2 y)u n+1 Factorise operator on left hand side = (1 + 1 2 r xδ 2 x + 1 2 r yδ 2 y)u n (1 1 2 r xδ 2 x 1 2 r yδ 2 y) = (1 1 2 r xδ 2 x)(1 1 2 r yδ 2 y) r xr y 4 δ2 xδ 2 y We cannot neglect the last term since it is O ( t 2) and the scheme would only be first order accurate ( r x r y 4 δ2 xδyu 2 n+1 = t2 4 ) n+1 u 4 2 x 2 + higher order terms y We factorise the right hand side also (1 1 2 r xδ 2 x)(1 1 2 r yδ 2 y)u n+1 = (1+ 1 2 r xδx)(1+ 2 1 2 r yδy)u 2 n + r xr y 4 δ2 xδy(u 2 n+1 un ) }{{} O( t 3 ) 13 / 23

Peaceman-Rachford Scheme: Dirichlet BC Step 1 is (1 1 2 r xδ 2 x)u n+ 1 2 = (1 + 1 2 r yδ 2 y)u n What boundary condition to use for u n+ 1 2 at j = 0, M x? Option I: Since u n+ 1 2 u(x j, y k, t n + 1 2 t) Option II: Using Step 1 and 2 At j = 0, M x u n+ 1 2 = g(x j, y k, t n + 1 2 t), j = 0, M x u n+ 1 2 = 1 2 (1 1 2 r yδy)u 2 n+1 + 1 2 (1 + 1 2 r yδy)u 2 n u n+ 1 2 = 1 2 (1 1 2 r yδ 2 y)g(x j, y k, t n + 1 2 t) + 1 2 (1 + 1 2 r yδ 2 y)g(x j, y k, t n ) If BC do not depend on t, then u n+ 1 2 = g(x j, y k ) 14 / 23

D Yakonov Scheme: Dirichlet BC What boundary condition to use for u at j = 0, M x? Unlike u n+ 1 2, we do not know what u represents. Instead use the numerical scheme itself; from Step 2 Boundary condition for u u = (1 1 2 r yδ 2 y)u n+1 u = (1 1 2 r yδ 2 y)g(x j, y k, t n+1 ), j = 0, M x E.g., at j = 0 u 0,k = r y 2 gn+1 1 + (1 + r y)g n+1 r y 2 gn+1 +1 15 / 23

Peaceman-Rachford Scheme: Implementation Step 1: For j = 1,..., M x 1 and k = 1,..., M y 1 (1 1 2 r xδ 2 x)u n+ 1 2 = (1 + 1 2 r yδ 2 y)u n For k = 1,..., M y 1, solve tridiagonal matrix r x j 1,k + (1 + r x)u n+ 1 2 r x 1 2 un+ 2 1 2 un+ 2 Step 2: For j = 1,..., M x 1 and k = 1,..., M y 1 j+1,k = (1 + 1 2 r yδ 2 y)u n, j = 1,..., M x 1 (1 1 2 r yδy)u 2 n+1 = (1 + 1 2 r xδx)u 2 n+ 1 2 For j = 1,..., M x 1, solve tridiagonal matrix r y 2 un+1 1 + (1 + r y)u n+1 r y 2 un+1 +1 = (1 + 1 2 r xδx)u 2 n+ 1 2, k = 1,..., M y 1 Remark: Total work scales as O (M x M y ) and hence is optimal. 16 / 23

Douglas-Rachford Scheme This is an approximate factorised version of the BTCS scheme. (1 r x δy 2 r y δy)u 2 n+1 = u n Factorise LHS operator (1 r x δ 2 y r y δ 2 y) = (1 r x δ 2 x)(1 r y δ 2 y) r x r y δ 2 xδ 2 y We can throw away the last term since we will get first order time accuracy. But we can make a better approximation as follows. (1 r x δ 2 x)(1 r y δ 2 y)u n+1 = u n + r x r y δ 2 xδ 2 yu n+1 (1 r x δ 2 x)(1 r y δ 2 y)u n+1 = (1 + r x r y δ 2 xδ 2 y)u n + r x r y δ 2 xδ 2 y(u n+1 u n ) }{{} O( t 3 ) Douglas-Rachford scheme is given by (1 r x δ 2 x)(1 r y δ 2 y)u n+1 = (1 + r x r y δ 2 xδ 2 y)u n 17 / 23

Douglas-Rachford Scheme: Two step scheme Introduce an intermediate state u Two-step process (1 r x δ 2 x) (1 r y δ 2 y)u n+1 }{{} u 2 = (1 + r x r y δxδy)u 2 n (1 r x δ 2 x)u = (1 + r y δ 2 y)u n (1 r y δ 2 y)u n+1 = u r y δ 2 yu n We avoid fourth differences δ 2 xδ 2 y. The equivalence is seen as follows. (1 r x δ 2 x)(1 r y δ 2 y)u n+1 = (1 r x δ 2 x)u (1 r x δ 2 x)r y δ 2 yu n = (1 + r y δ 2 y)u n (1 r x δ 2 x)r y δ 2 yu n = (1 + r x r y δ 2 xδ 2 y)u n 18 / 23

Douglas-Rachford Scheme: Fourier stability Amplification factor ρ(ξ, η) = The scheme is unconditionally stable. 1 + 16r x r y sin 2 (ξ/2) sin 2 (η/2) [1 + 4r x sin 2 (ξ/2)][1 + 4r y sin 2 (η/2)] 1 19 / 23

Douglas-Rachford Scheme: Dirichlet BC We need BC for u at j = 0, M x. Using Step 2 of the scheme This gives the boundary conditions u = (1 r y δ 2 y)u n+1 r y δ 2 yu n u = (1 r y δ 2 y)g n+1 r yδ 2 yg n, j = 0, M x 20 / 23

Source terms Heat equation with a forcing term u t = µ(u xx + u yy ) + F (x, y, t) Crank-Nicholson scheme, second order in time and space (1 1 2 r xδ 2 x 1 2 r yδ 2 y)u n+1 = (1 + 1 2 r xδ 2 x + 1 2 r yδ 2 y)u n + t 2 (F n + F n+1 ) We can do a factorization as before (1 1 2 r xδ 2 x)(1 1 2 r yδ 2 y)u n+1 = (1 + 1 2 r xδ 2 x)(1 + 1 2 r yδ 2 y)u n + t 2 (F n + F n+1 ) r xr y 4 δ2 xδ 2 y(u n+1 u n ) }{{} O( t 3 ) Ignoring last term, the resulting scheme is second order accurate (1 1 2 r xδ 2 x)(1 1 2 r yδ 2 y)u n+1 = (1 + 1 2 r xδ 2 x)(1 + 1 2 r yδ 2 y)u n + t 2 (F n + F n+1 ) 21 / 23

Source terms: Peaceman-Rachford Scheme Use the viewpoint of two step process: t n t n + 1 2 t tn+1 (1 1 2 r xδ 2 x)u n+ 1 2 = (1 + 1 2 r yδ 2 y)u n + t 2 F n (1 1 2 r yδ 2 y)u n+1 = (1 + 1 2 r xδ 2 x)u n+ 1 2 + t 2 F n+1 To check the consistency of the scheme, eliminate u n+ 1 2 (1 1 2 r xδ 2 x)(1 1 2 r yδ 2 y)u n+1 = (1 1 2 r xδ 2 x)(1 + 1 2 r xδ 2 x)u n+ 1 2 + t 2 (1 1 2 r xδ 2 x)f n+1 = (1 + 1 2 r xδ 2 x)(1 + 1 2 r yδ 2 y)u n + t 2 (F n + F n+1 ) r x t 2 δ2 x(f n+1 F n ) }{{} O( t 3 ) Hence the two-step scheme is second order accurate in time and space. 22 / 23

Source terms: D Yakonov Scheme Start with approximately factored Crank-Nicholson scheme (1 1 2 r xδx) 2 (1 1 2 r yδy)u 2 n+1 = (1 + 1 }{{} 2 r xδx)(1 2 + 1 2 r yδy)u 2 n + t 2 (F n + F n+1 ) u Two-step D Yakonov scheme (1 1 2 r xδ 2 x)u = (1 + 1 2 r xδ 2 x)(1 + 1 2 r yδ 2 y)u n + t 2 (F n + F n+1 ) (1 1 2 r yδ 2 y)u n+1 = u Remark: We cannot spread out the source term into the two steps like this (1 1 2 r xδ 2 x)u = (1 + 1 2 r xδ 2 x)(1 + 1 2 r yδ 2 y)u n + t 2 F n (1 1 2 r yδ 2 y)u n+1 = u + t 2 F n+1 This scheme is only first order accurate in time. 23 / 23