16.920J/SMA 5212 Numerical Methods for Partial Differential Equations Lecture 5 Finite Differences: Parabolic Problems B. C. Khoo Thanks to Franklin Tan 19 February 2003 16.920J/SMA 5212 Numerical Methods for PDEs OUTLINE • • • • • • Governing Equation Stability Analysis 3 Examples Relationship between σ and λh Implicit Time-Marching Scheme Summary Slide 2 GOVERNING EQUATION Consider the Parabolic PDE in 1-D ∂u ∂ 2u =υ 2 ∂t ∂x x ∈ [ 0, π ] subject to u = u0 at x = 0, u = uπ at x = π uπ u0 u ( x, t ) = ? x =π x=0 If υ ≡ viscosity → Diffusion Equation If υ ≡ thermal conductivity → Heat Conduction Equation Slide 3 STABILITY ANALYSIS Discretization Keeping time continuous, we carry out a spatial discretization of the RHS of ∂u ∂ 2u =υ 2 ∂t ∂x x =π x=0 x0 x1 xN −1 xN x2 2 16.920J/SMA 5212 Numerical Methods for PDEs There is a total of N + 1 grid points such that x j = j ∆x, j = 0,1, 2,...., N Slide 4 STABILITY ANALYSIS Discretization ∂ 2u ∂x 2 Use the Central Difference Scheme for ∂ 2u ∂x 2 = j u j +1 − 2u j + u j −1 ∆x 2 + O ( ∆x 2 ) which is second-order accurate. • Schemes of other orders of accuracy may be constructed. Slide 5 Construction of Spatial Difference Scheme of Any Order p The idea of constructing a spatial difference operator is to represent the spatial differential operator at a location by the neighboring nodal points, each with its own weightage. The order of accuracy, p of a spatial difference scheme is represented as O ( ∆x p ) . Generally, to represent the spatial operator to a higher order of accuracy, more nodal points must be used. j−2 • j−1 • du dx j • j j+1 • j+2 • du Consider the following procedure of determining the spatial operator dx order of accuracy O ( ∆x 2 ) : 3 up to the j 16.920J/SMA 5212 Numerical Methods for PDEs 1. du Let dx be represented by u at the nodes j−1, j, and j+1 with α −1 , α 0 and j α1 being the coefficients to be determined, i.e. 2. du dx + α −1u j −1 + α 0 u j + α1u j +1 = O ( ∆x p ) (1) j Seek Taylor Expansions for u j −1 , u j and u j +1 about u j and present them in a table as shown below. (Note that p is not known a priori but is determined at the end of the analysis when the α’s are made known.) This column consists of all the terms on the LHS of (1). uj uj′ u j′ ′ uj′ ′′ u j′ 0 1 0 0 α −1u j −1 α −1 −∆x ⋅α −1 1 2 ∆ x ⋅ α −1 2 1 − ∆ x 3 ⋅ α −1 6 α 0u j α0 0 0 0 α1u j +1 α1 ∆x ⋅α1 1 2 ∆x ⋅ α 1 2 1 3 ∆x ⋅ α 1 6 S1 S2 S3 S4 u j′ + k =1 k =−1 αk u j+k Each cell in this row comprises the sum of its corresponding column. 4 16.920J/SMA 5212 Numerical Methods for PDEs where S1 = (α −1 + α 0 + α1 ) u j S2 = (1 − ∆x ⋅α −1 + ∆x ⋅ α1 ) u j′ 1 1 S3 = ∆x ⋅ α −1 + ∆x 2 ⋅α1 u j′′ 2 2 2 1 1 S4 = − ∆x3 ⋅α −1 + ∆x3 ⋅ α1 u j′′′ 6 6 k =1 ∴ u j′ + 3. k =−1 α k u j + k = S1 + S 2 + S3 + S 4 + .... Make as many Si ’s as possible vanish by choosing appropriate α k ’s. In this instance, since we have three unknowns α −1 , α 0 and α1 , we can therefore set: S1 = 0 S2 = 0 S3 = 0 (Note that in the Taylor Series expansion, one starts off with the lower-order terms and progressively obtain the higher-order terms. We have deliberately set the Si pertaining to the lower-order terms to zero, thereafter followed by increasingly higher-order terms.) Hence, 0 1 1 α −1 1 −1 0 1 α 0 = − ∆x 1 0 1 α1 1 0 Solving the system of equations, we obtain 1 2 ∆x α0 = 0 α −1 = α1 = − 1 2 ∆x 5 16.920J/SMA 5212 Numerical Methods for PDEs 4. Substituting the α k ’s into u j′ + u j′ − k =1 k =−1 α k u j + k = S1 + S 2 + S3 + S 4 + .... yields 1 1 u j +1 − u j −1 ) = ∆x 2 ⋅ u j′′′ + higher-order terms ( 2 ∆x 6 In other words, du u j′ = dx = u j +1 − u j −1 + O ( ∆x 2 ) + .... 2 ∆x j O ( ∆x p ) , p = 2 i.e. the above representation is accurate up to O ( ∆x 2 ) . Some useful points to note: 1. These 4 steps are the general procedure used to obtain the representation of the spatial operator up to the order of accuracy O ( ∆x p ) . 2. d 2u For other spatial operators, say dx 2 du , we simply replace dx j in (1) with j the said spatial operator. 3. For one-sided representations, one can choose nodal points u j + k , k ≥ 0 . This may be important especially for representations on a boundary. For example du dx + α 0u j + α1u j +1 + α 2u j + 2 + .... = O ( ∆x p ) j One possibility is du dx + j 3u j − 4u j +1 + u j + 2 2 ∆x = O ( ∆x 2 ) which is also second-order accurate. (We can also use a similar procedure to construct the finite difference scheme of Hermitian type for a spatial operator. This is not covered here). 6 16.920J/SMA 5212 Numerical Methods for PDEs STABILITY ANALYSIS Discretization du1 υ = 2 (uo − 2u1 + u2 ) dt ∆x du2 υ x2 : = 2 (u1 − 2u2 + u3 ) dt ∆x We obtain at x1 : xj : du j dt xN −1 : = υ ∆x 2 (u j −1 − 2u j + u j +1 ) du N −1 υ = 2 (u N − 2 − 2u N −1 + u N ) ∆x dt Note that we need not evaluate u at x = x0 and x = xN since u0 and uN are given as boundary conditions. Slide 6 STABILITY ANALYSIS Matrix Formulation Assembling the system of equations, we obtain du1 −2 dt du2 dt 1 = du j υ ∆x 2 0 1 1 −2 dt 1 du N −1 0 −2 1 1 u1 u2 uj 1 υ uo 2 ∆x 0 0 + 0 υu N −2 u N −1 2 ∆x dt A Slide 7 7 16.920J/SMA 5212 Numerical Methods for PDEs STABILITY ANALYSIS PDE to Coupled ODEs Or in compact form du = Au + b dt where u = [ u1 b= u N −1 ] T u2 υ uo ∆x 2 0 0 0 υu N ∆x 2 T We have reduced the 1-D PDE to a set of Coupled ODEs! Slide 8 STABILITY ANALYSIS Eigenvalue and Eigenvector of Matrix A If A is a nonsingular matrix, as in this case, it is then possible to find a set of eigenvalues λ = {λ1 , λ2 ,...., λ j ,...., λN −1} from det ( A − λ I ) = 0. For each eigenvalue λ j , we can evaluate the eigenvector V j consisting of a set of mesh point values vi j , i.e. T V j = v1j v2j vNj −1 Slide 9 STABILITY ANALYSIS Eigenvalue and Eigenvector of Matrix A The ( N − 1) × ( N − 1) matrix E formed by the ( N − 1) columns V j diagonalizes the matrix A by E −1 AE = Λ 8 16.920J/SMA 5212 Numerical Methods for PDEs λ1 0 λ2 where Λ = 0 λN −1 Slide 10 STABILITY ANALYSIS Coupled ODEs to Uncoupled ODEs du Starting from = Au + b dt Premultiplication by E −1 yields E −1 du = E −1 Au + E −1 b dt du E = E −1 A ( EE −1 ) u + E −1 b dt −1 I du E −1 = ( E −1 AE ) E −1 u + E −1 b dt Λ Slide 11 STABILITY ANALYSIS Coupled ODEs to Uncoupled ODEs Continuing from E −1 du = ΛE −1 u + E −1 b dt Let U = E −1u and F = E −1b , we have 9 16.920J/SMA 5212 Numerical Methods for PDEs d U = ΛU + F dt which is a set of Uncoupled ODEs! Slide 12 STABILITY ANALYSIS Coupled ODEs to Uncoupled ODEs Expanding yields dU1 = λ1U1 + F1 dt dU 2 = λ2U 2 + F2 dt dU j dt = λ jU j + Fj dU N −1 = λ N −1U N −1 + FN −1 dt Since the equations are independent of one another, they can be solved separately. The idea then is to solve for U and determine u = EU Slide 13 STABILITY ANALYSIS Coupled ODEs to Uncoupled ODEs Considering the case of b independent of time, for the general j th equation, U j = c j eλ jt − 1 λj Fj is the solution for j = 1,2,….,N−1. 10 16.920J/SMA 5212 Numerical Methods for PDEs ( ) Evaluating, u = EU = E ceλt − EΛ −1E −1 b Complementary Particular (steady-state) solution (transient) solution ( ) where ceλt = c1eλ1t c2eλ2t cje T λ jt cN −1eλN −1t The stability analysis of the space discretization, keeping time continuous, is based on the eigenvalue structure of A. The exact solution of the system of equations is determined by the eigenvalues and eigenvectors of A. Slide 14 STABILITY ANALYSIS Coupled ODEs to Uncoupled ODEs We can think of the solution to the semi-discretized problem ( ) u = E ceλt − E Λ −1E −1 b as a superposition of eigenmodes of the matrix operator A. Each mode j contributes a (transient) time behaviour of the form λt e j to the time-dependent part of the solution. Since the transient solution must decay with time, Real ( λ j ) ≤ 0 for all j This is the criterion for stability of the space discretization (of a parabolic PDE) keeping time continuous. Slide 15 11 16.920J/SMA 5212 Numerical Methods for PDEs STABILITY ANALYSIS Use of Modal (Scalar) Equation It may be noted that since the solution u is expressed as a contribution from all the modes of the initial solution, which have propagated or (and) diffused with the eigenvalue λ j , and a contribution from the source term b j , all the properties of the time integration (and their stability properties) can be analysed separately for each mode with the scalar equation dU = λU + F dt j Slide 16 STABILITY ANALYSIS Use of Modal (Scalar) Equation The spatial operator A is replaced by an eigenvalue λ, and the above modal equation will serve as the basic equation for analysis of the stability of a time-integration scheme (yet to be introduced) as a function of the eigenvalues λ of the space-discretization operators. This analysis provides a general technique for the determination of time integration methods which lead to stable algorithms for a given space discretization. Slide 17 EXAMPLE 1 Continuous Time Operator Consider a set of coupled ODEs (2 equations only): du1 = a11u1 + a12u2 dt du2 = a21u1 + a22u2 dt Let u = u1 u2 , A= a11 a12 a21 a22 du = Au dt Slide 18 12 16.920J/SMA 5212 Numerical Methods for PDEs EXAMPLE 1 Continuous Time Operator Proceeding as before, or otherwise (solving the ODEs directly), we can obtain the solution u1 = c1ξ11eλ1t + c2ξ12 eλ2t u2 = c1ξ 21eλ1t + c2ξ 22 eλ2t ξ11 ξ and 21 are ξ 21 ξ 22 where λ1 and λ2 are eigenvalues of A and eigenvectors pertaining to λ1 and λ2 respectively. As the transient solution must decay with time, it is imperative that Real ( λ j ) ≤ 0 for j = 1, 2. Slide 19 EXAMPLE 1 Discrete Time Operator Suppose we have somehow discretized the time operator on the LHS to obtain u1 = a11u1 n n −1 + a12 u2 n −1 + a22 u2 u2 = a21u1 n n −1 n −1 where the subscript n stands for the nth time level, then n u = Au n −1 n where u = u1 Since A is independent of time, n u = Au n −1 = AAu n−2 n u2 n T and A = = .... = An u a11 a12 a21 a22 0 In later examples, we shall apply specific time discretization schemes such as the “leapfrog” and Euler-forward time discretization schemes. Slide 20 13 16.920J/SMA 5212 Numerical Methods for PDEs EXAMPLE 1 Discrete Time Operator As A = E ΛE −1 , n u( = E ΛE −1 ⋅ E ΛE −1 ⋅ .... ⋅ E ΛE −1 ⋅ u&'& ( 0 A n A −1 u = EΛ E u n A where Λ = 0 n u1 = λ1 ξ11c1 + λ2 ξ12c2 n n ' n ' 21 1 n 0 0 λ2n ' u2 = λ1 ξ c + λ2 ξ 22c2 n λ1n where ' n c1 ' = E −1 u 0 are constants. c2 ' Slide 21 Alternative View Alternatively, one can view the solution as: U1n U n 2 = λ1n n λ2 U10 U 0 2 where U = E −1u U n = Λ nU 0 EXAMPLE 1 Comparison Comparing the solution of the semi-discretized problem where time is kept continuous u1 ξ11 ξ12 e λ1t = [ c1 c2 ] u2 ξ 21 ξ 22 eλ2t to the solution where time is discretized ! ! ! u1 ξ11 ξ12 λ1 # $ % # = [ c1 ' c2 '] $" % #" " u2 ξ 21 ξ 22 $" λ2 n % # n n 14 16.920J/SMA 5212 Numerical Methods for PDEs The difference equation where time is continuous has exponential solution eλt . The difference equation where time is discretized has power solution λ n . Slide 22 EXAMPLE 1 Comparison In equivalence, the transient solution of the difference equation must decay with time, i.e. λn < 1 for this particular form of time discretization. Slide 23 EXAMPLE 2 Leapfrog Time Discretization Consider a typical modal equation of the form du = λu + aeµt dt j where λ j is the eigenvalue of the associated matrix A. (For simplicity, we shall henceforth drop the subscript j). We shall apply the “leapfrog” time discretization scheme given as du u n +1 − u n −1 = dt 2h where h = ∆t Substituting into the modal equation yields u n +1 − u n−1 = ( λu + ae µt ) t = nh 2h n µ hn = λ u + ae Slide 24 15 16.920J/SMA 5212 Numerical Methods for PDEs Reminder Recall that we are considering a typical modal equation which had been obtained from the original equation du = Au + b dt EXAMPLE 2 Leapfrog Time Discretization: Time Shift Operator u n +1 − u n−1 = λu n + ae µ hn 2h u n+1 − 2hλu n − u n−1 = 2ha ( e µ hn ) Solution of u consists of the complementary solution c n , and the particular solution p n , i.e. un = cn + pn There are several ways of solving for the complementary and particular solutions. One way is through use of the shift operator S and characteristic polynomial. The time shift operator S operates on c n such that Sc n = c n +1 S 2 c n = S ( Sc n ) = Sc n +1 = c n + 2 Slide 25 EXAMPLE 2 Leapfrog Time Discretization: Time Shift Operator The complementary solution c n satisfies the homogenous equation c n +1 − 2hλ c n − c n −1 = 0 Sc n − 2 hλ c n − cn =0 S 16 16.920J/SMA 5212 Numerical Methods for PDEs ( S 2 c n − 2hλ Sc n − c n ) ( S 2 − 2hλ S − 1) 1 =0 S cn =0 S characteristic polynomial p ( S ) = (S 2 − 2hλ S − 1) = 0 Slide 26 EXAMPLE 2 Leapfrog Time Discretization: Time Shift Operator The solution to the characteristic polynomial is σ1 and σ2 are the two roots σ (λ h) = S = λ h ± 1 + λ 2 h2 The complementary solution to the modal equation would then be c n = β1σ 1 + β 2σ 2 n n The particular solution to the modal equation is p n = 2aheµ hn e µh . e2 µ h − 2hλ e µh − 1 Combining the two components of the solution together, u n = ( cn ) + ( pn ) ( = β1 λ h + 1 + h 2 λ 2 ) + β (λh − n 2 1 + h 2λ 2 ) n 2ahe µ hn eµ h + 2µh e − 2hλ eµ h − 1 Slide 27 EXAMPLE 2 Leapfrog Time Discretization: Stability Criterion For the solution to be stable, the transient (complementary) solution must not be allowed to grow indefinitely with time, thus implying that ( = (λh − ) 1+ h λ ) < 1 σ 1 = λ h + 1 + h2 λ 2 < 1 σ2 2 2 17 16.920J/SMA 5212 Numerical Methods for PDEs is the stability criterion for the leapfrog time discretization scheme used above. Slide 28 EXAMPLE 2 Leapfrog Time Discretization: Stability Diagram The stability diagram for the leapfrog (or any general) time discretization scheme in the σ-plane is Im(σ ) Region of Stability Re(σ ) 1 -1 Slide 29 Stability Diagram in the λh-plane Alternatively, we can express the stability criterion for the leapfrog time discretization scheme as 1 1 λh = σ − 2 σ s.t. σ < 1 Since σ < 1 and σ = exp(iθ ) , Im(λh) λ h = i sin θ for stability. The stability diagram for the leapfrog time discretization scheme in the λh-plane would therefore be as shown: 1 Re(λh) -1 18 Region of Stability 16.920J/SMA 5212 Numerical Methods for PDEs EXAMPLE 2 Leapfrog Time Discretization In particular, by applying to the 1-D Parabolic PDE ∂u ∂ 2u =υ 2 ∂t ∂x the central difference scheme for spatial discretization, we obtain −2 1 1 −2 A= υ ∆x 0 1 2 0 1 1 −2 which is the tridiagonal matrix Slide 30 EXAMPLE 2 Leapfrog Time Discretization According to analysis of a general triadiagonal matrix B(a,b,c), the eigenvalues of B are jπ λ j = b + 2 ac cos , N jπ λ j = −2 + 2 cos N j = 1,..., N − 1 υ ∆x 2 The most “dangerous” mode is that associated with the eigenvalue of largest magnitude λmax = − i.e. 4υ ∆x 2 σ 1 ( λmax h ) = λmax h + λ 2 max h 2 + 1 σ 2 ( λmax h ) = λmax h − λ 2 max h 2 + 1 which can be plotted in the absolute stability diagram. 19 16.920J/SMA 5212 Numerical Methods for PDEs One may note that λ j is always real and negative, thereby satisfying the criterion for stability of the space discretization of a parabolic PDE, keeping time continuous. Slide 31 EXAMPLE 2 Leapfrog Time Discretization: Absolute Stability Diagram for σ As applied to the 1-D Parabolic PDE, the absolute stability diagram for σ is Im(σ ) Region of Instability Unit circle σ2 with h σ1 with h increasing increasing σ1 at h = ∆t = 0 Re(σ ) σ2 at h = ∆t = 0 Region of Stability In this case, σ 1 and σ 2 start out being on the unit circle (h = ∆t = 0). However, the spurious root (refer to following slide) leaves the unit circle as h starts increasing. Therefore, the spurious root causes the leapfrog time discretization scheme to be unstable, irrespective of how small h = ∆t is, although it does not affect the accuracy. The leapfrog time discretization for the 1-D Diffusion Equation is unstable. Slide 32 20 16.920J/SMA 5212 Numerical Methods for PDEs STABILITY ANALYSIS Some Important Characteristics Deduced A few features worth considering: 1. Stability analysis of time discretization scheme can be carried out for all the different modes λ j . 2. If the stability criterion for the time discretization scheme is valid for all modes, then the overall solution is stable (since it is a linear combination of all the modes). 3. When there is more than one root σ , then one of them is the principal root which represents an approximation to the physical behaviour. The principal root is recognized by the fact that it tends towards one as λ h → 0, i.e. lim σ ( λ h ) = 1. (The other roots are spurious, which λ h→0 affect the stability but not the accuracy of the scheme.) Slide 33 STABILITY ANALYSIS Some Important Characteristics Deduced 4. By comparing the power series solution of the principal root to eλ h , one can determine the order of accuracy of the time discretization scheme. In this example of leapfrog time discretization, σ 1 = λ h + (1 + h 2 λ σ 1 = 1 + hλ + 1 2 2 ) 1 1 .− 1 2 2 = λ h + 1 + ( h λ ) + 2 2 .h 4 λ 4 2 2! h2λ 2 + ... 2 and compared to eλ h = 1 + hλ + h 2λ 2 + ... 2! is identical up to the second order of hλ . Hence, the above scheme is said to be second-order accurate. Slide 34 21 16.920J/SMA 5212 Numerical Methods for PDEs EXAMPLE 3 Euler-Forward Time Discretization: Stability Analysis Analyze the stability of the explicit Euler-forward time discretization du u n+1 − u n = dt ∆t as applied to the modal equation du = λu dt du where h = ∆t dt into the modal equation, we obtain u n +1 − (1 + λ h)u n = 0 Substituting u n +1 = u n + h Slide 35 EXAMPLE 3 Euler-Forward Time Discretization: Stability Analysis Making use of the shift operator S c n+1 − (1 + λ h)c n = Sc n − (1 + λ h)c n = [ S − (1 + λ h)]c n = 0 characteristic polynomial Therefore σ (λ h ) = 1 + λ h and c n = βσ n The Euler-forward time discretization scheme is stable if σ ≡ 1+ λh < 1 or bounded by λ h = σ − 1 s.t. σ < 1 in the λ h-plane. Slide 36 22 16.920J/SMA 5212 Numerical Methods for PDEs EXAMPLE 3 Euler-Forward Time Discretization: Stability Diagram The stability diagram for the Euler-forward time discretization in the λh-plane is Im(λh) Unit Circle Region of Stability -2 Re(λh) 0 -1 Slide 37 EXAMPLE 3 Euler-Forward Time Discretization: Absolute Stability Diagram As applied to the 1-D Parabolic PDE, λ = λmax = −4υ ∆x 2 Im(σ ) σ leaves the unit circle at λh = −2 σ at h = ∆t = 0 -1 σ with h increasing 1 The stability limit for largest h ≡ ∆t = Re(σ ) −2 λmax σ leaves the unit circle at σ = −1, i.e. σ = 1+ λh = −1 λ h = −2 h= −2 since it is the extreme. λmax Slide 38 23 16.920J/SMA 5212 Numerical Methods for PDEs Predictor-Corrector Time Discretization Consider the numerical stability of the following predictor-corrector time discretization scheme uˆ n +1 = u n + h u n +1 du n dt n duˆ n +1 1 = u n + uˆ n +1 + h n +1 dt 2 as applied to the typical modal equation du = λu + ae µt dt of the parabolic PDE. Substituting du duˆ and into the predictor-corrector scheme dt dt yields uˆ n +1 = u n + h ( λ u n + ae µ hn ) u n +1 = where t = n∆t = nh 1 n u + uˆ n +1 + h ( λuˆ n+1 + ae µ h( n+1) ) 2 Utilizing the shift operator Su n = u n+1 Suˆ n = uˆ n+1 and rearranging the equations into matrix form, we obtain S − (1 + λ h ) 1 − (1 + λ h ) S 2 1 S− 2 uˆ n u n h = 1 ae µ hn hS 2 To determine the characteristic polynomial, set Ρ (σ ) = Ρ ( S ) = S − 1 (1 + λ h ) S 2 − (1 + λ h ) 1 =0 S− 2 24 16.920J/SMA 5212 Numerical Methods for PDEs 1 Ρ (σ ) = Ρ ( S ) = S S − 1 − λ h − λ 2 h 2 = 0 2 σ = 0 (trivial root) 1 2 σ = 1 + λ h + λ 2 h2 i.e. the scheme is a one-root method. Compared to 1 eλ h = 1 + λ h + λ 2 h 2 + .... 2 the scheme is second-order accurate. To obtain the particular solution, one can perform a matrix inversion and obtain 1 aheµhn (e µh + 1 + λh ) n 2 p = 1 e µh − 1 − λh − λ2 h 2 2 with the complementary solution being n 1 c = βσ = β 1 + λh + λ2 h 2 2 n n The absolute stability diagram (showing λ = − 4υ ) for the 1-D Parabolic PDE is ∆x 2 Im(σ ) Region of Instability h increasing further -1 1 0.5 h increasing from 0 Region of Stability 25 Re(σ ) 16.920J/SMA 5212 Numerical Methods for PDEs When h increases from zero, σ decreases from 1.0. As h continues to increase, σ reaches a minimum of 0.5 with λh = −1 and then increases. As h increases further, σ returns to 1.0 with λh = −2. Prior to this point, the scheme is stable. Increasing h and thus σ beyond this point renders the scheme unstable. Hence, this predictor-corrector scheme is stable for small h’s and unstable for large h’s; the limit for stability is λh = −2 (from above). In general, we can analyze the absolute stability diagram for the predictor-corrector time discretization method in terms of (λ h ) 2 2 σ: σ (λ h ) = 1 + λ h + λh : λ h = −1 ± 2σ − 1 or λ, the eigenvalue(s) of the A matrix can take on complex forms depending on the governing equation (as opposed to negative real values for the 1-D parabolic PDE with central differencing for the spatial derivative). RELATIONSHIP BETWEEN σ AND λ h σ = σ(λ λh) Thus far, we have obtained the stability criterion of the time discretization scheme using a typical modal equation. We can generalize the relationship between σ and λh as follows: • Starting from the set of coupled ODEs du = Au + b dt • Apply a specific time discretization scheme like the leapfrog time discretization as in Example 2 du u n +1 − u n−1 = dt 2h Slide 39 26 16.920J/SMA 5212 Numerical Methods for PDEs RELATIONSHIP BETWEEN σ AND λ h σ = σ(λh) • The above set of ODEs becomes n u n +1 − u n −1 = Au n + b 2h • Introducing the time shift operator S n un Su = + 2hAu n + 2hb S n S − S −1 A− I u n = −b 2h n • Premultiplying E −1 on the LHS and RHS and introducing I = EE −1 operating on u n S − S −1 E AE − E E E −1u = − E −1b n 2h −1 −1 Λ Slide 40 RELATIONSHIP BETWEEN σ AND λ h σ = σ(λ λh) • Putting U n = E −1u n , F n = E −1 b n S − S −1 we obtain Λ − E E U n = −F n 2h −1 S − S −1 2h S − S −1 i.e. Λ − U n = −F n 2h which is a set of uncoupled equations. 27 16.920J/SMA 5212 Numerical Methods for PDEs Hence for each j, j = 1,2,….,N−1, S − S −1 λj − U j = − Fj 2h Slide 41 RELATIONSHIP BETWEEN σ AND λ h σ = σ(λh) Note that the analysis performed above is identical to the analysis carried out using the modal equation dU = λU + F dt j All the analysis carried out earlier for a single modal equation is applicable to the matrix after the appropriate manipulation to obtain an uncoupled set of ODEs. Each j th equation can be solved independently for U nj and the U nj 's can then be coupled through u n = EU n . Slide 42 RELATIONSHIP BETWEEN σ AND λ h σ = σ(λ λh) Hence, applying any “consistent” numerical technique to each equation in the set of coupled linear ODEs is mathematically equivalent to 1. Uncoupling the set, 2. Integrating each equation in the uncoupled set, 3. Re-coupling the results to form the final solution. These 3 steps are commonly referred to as the ISOLATION THEOREM Slide 43 28 16.920J/SMA 5212 Numerical Methods for PDEs IMPLICIT TIME-MARCHING SCHEME Thus far, we have presented examples of explicit time-marching methods and these may be used to integrate weakly stiff equations. Implicit methods are usually employed to integrate very stiff ODEs efficiently. However, use of implicit schemes requires solution of a set of simultaneous algebraic equations at each time-step (i.e. matrix inversion), whilst updating the variables at the same time. Implicit schemes applied to ODEs that are inherently stable will be unconditionally stable or A-stable. Slide 44 IMPLICIT TIME-MARCHING SCHEME Euler-Backward Consider the Euler-backward scheme for time discretization n +1 du dt = u n +1 − u n h Applying the above to the modal equation for parabolic PDE du = λ u + ae µt dt yields u n +1 − u n µ n +1 h = λu n+1 + ae ( ) h (1 − hλ ) u n+1 − u n = aheµ ( n +1)h Slide 45 IMPLICIT TIME-MARCHING SCHEME Euler-Backward Applying the S operator, (1 − hλ ) S − 1 u n = ahe µ ( n +1) h 29 16.920J/SMA 5212 Numerical Methods for PDEs the characteristic polynomial becomes Ρ (σ ) = Ρ ( S ) = (1 − hλ ) S − 1 = 0 The principal root is therefore σ= 1 = 1 + λ h + λ 2 h 2 + .... 1 − λh 1 which, upon comparison with eλ h = 1 + λ h + λ 2 h 2 + .... , is only 2 first-order accurate. The solution is n 1 U =β 1− λh n + ahe ( ) (1 − λ h ) e µ h − 1 µ u +1 h Slide 46 IMPLICIT TIME-MARCHING SCHEME Euler-Backward For the Parabolic PDE, λ is always real and < 0. Therefore, the transient component will always tend towards zero for large n irregardless of h (≡ ∆t). The time-marching scheme is always numerically stable. In this way, the implicit Euler/Euler-backward time discretization scheme will allow us to resolve different time-scaled events with the use of different time-step sizes. A small time-step size is used for the short timescaled events, and then a large time-step size used for the longer time-scaled events. There is no constraint on hmax. Slide 47 IMPLICIT TIME-MARCHING SCHEME Euler-Backward However, numerical solution of u requires the solution of a set of simultaneous algebraic equations or matrix inversion, which is computationally much more 30 16.920J/SMA 5212 Numerical Methods for PDEs intensive/expensive compared to the multiplication/ addition operations of explicit schemes. Slide 48 SUMMARY • Stability Analysis of Parabolic PDE Uncoupling the set. Integrating each equation in the uncoupled set → modal equation. Re-coupling the results to form final solution. • Use of modal equation to analyze the stability |σ(λh)| < 1. • Explicit time discretization versus Implicit time discretization. Slide 49 Reference: Numerical Computation of Internal and External Flows, Vol I & II by C. Hirsch, 1992, Wiley Series. 31