Platzalter für Bild, Bild auf Titelfolie inter das Logo einsetzen Introduction to PDEs and Numerical Metods Tutorial 11. 2D elliptic equations Dr. Noemi Friedman, 3. 1. 215.
Overview Introduction (classification of PDEs, examples of important PDEs) 1D Poisson equation u x = f(x) Analytical solution (existence, uniqueness of solution, stability) Finite difference approximation of te Poisson eqaution Eigenvalue problem, Fourier transform Elliptic equations ( aa x + b x u x + c x u x = f x ) Analytical solution: existence, and uniqueness of solution, and its bounds FD approximation Consistency, stability, convergence FD approximation of PDEs on non-equidistant grids Higer order FD scemes Wit Taylor expansion Wit Lagrange interpolation Compact scemes 3. 1. 215. Dr. Noemi Friedman PDE tutorial Seite 2
Overview Scemes for te numerical approximation of initial value problems Explicit Euler Implicit (backward) Euler Teta-metods Runge-Kutta metods Heat eqaution wit 1d spatial dimension analytical solution (seperation of ) Spatial and time discretisation, consistency and stability analysis Transport and wave equations wit 1d spatial dimension analytical solution numerical soluion Multidimensional problems 2d elliptic equation analytical analysis numerical analysis 3. 1. 215. Dr. Noemi Friedman PDE tutorial Seite 3
Seperation of Seperation of - basic steps: 1. Suppose: u x, y = f x g y (ansatz function) 2. Plug-in ansatz function to te original PDE and rearrange in a way tat one side is a function of only x and te oter side is a function of only y: φ x = ψ y Te equality only stands if bot sides is only a scalar (separation constant - σ) φ x = ψ y = σ 3. Solve te two separated ODEs: φ x = σ ψ y = σ 3. 1. 215. Dr. Noemi Friedman PDE tutorial Seite 4
Analytical solution of Laplace equation wit separation of Let s solve analyticaly te following problem Laplace equation u(x, y) y u xx + u yy = (LE) Boundary conditions (BC4) u x, = (BC1) u x, = (BC2) u, y = y(y ) (BC3) u x, y = lim x x u(x, y):? 3. 1. 215. Dr. Noemi Friedman PDE tutorial Seite 5
Analytical solution of Laplace equation wit separation of 1. Ansatz function u x, y = f x g y 2. Plug-in ansatz function to te original PDE (LE) u xx + u yy = (LE) f x g y + f x g y = (PDE1) Rearrange: f x f x = g y g y (PDE2) = σ f x σσ x = g y + σg y = (ODE1) (ODE2) φ x ψ y seeeeeeeee cccccccc 3. 1. 215. Dr. Noemi Friedman PDE tutorial Seite 6
Analytical solution of Laplace equation wit separation of 3. SOLVE (ODE1) and (ODE2) 3a) Let s assume g y + σg y = g y = g y = C 1 y + C 2 (1) (ODE2) were C 1, C 2 : constants Define C 1, C 2 from boundary conditions: u x, = f x g = (BC1) (BC1) is satisfied if f x or if g = (BC 1) would give trivial solution (rearrangement of (PDE1) to (PDE2) would not be possible if f x (BC 1) (1): g = C 1 + C 2 = C 2 = 3. 1. 215. Dr. Noemi Friedman PDE tutorial Seite 7
Analytical solution of Laplace equation wit separation of Define C 1 from boundary conditions u x, = f x g = (BC2) (BC2) is satisfied if f x would give trivial solution or if g = (BC 2) (BC 2) (1): g = C 1 = C 1 = doesn t lead to any nontrivial solution 3. 1. 215. Dr. Noemi Friedman PDE tutorial Seite 8
Analytical solution of Laplace equation wit separation of 3b) Let s assume g y + σg y = (ODE2) Assuming g y = e λy (2) plug-in (2) to (ODE2) λ 2 e λλ + σe λλ = λ 2 = σ λ = ± σ Te solution is te linear combination of te two possible solutions g y = C 3 e σ y + C 4 e σ y (3) were C 3, C 4 are arbitrary constants 3. 1. 215. Dr. Noemi Friedman PDE tutorial Seite 9
Analytical solution of Laplace equation wit separation of Let s assume Define C 3, C 4 from boundary conditions: g = (BC 1) g = (BC 2) see equations (BC 1) and (BC 2) in 3a from (3) using (BC 1) g = C 3 e σ + C 4 e σ = C 3 + C 4 = C 4 = C 3 (4) from (3) using (BC 2) g = C 3 e σ + C 4 e σ = using (4) g = C 3 e σ 1 e σ = C 3 = C 4 = eiter leads to any nontrivial solution 3. 1. 215. Dr. Noemi Friedman PDE tutorial Seite 1
Analytical solution of Laplace equation wit separation of Let s assume λ = ±i σ complex roots Te solution: g y = C 5 e i σ y + C 6 e i σ y (5) 3. 1. 215. Dr. Noemi Friedman PDE tutorial Seite 11
Analytical solution of Laplace equation wit separation of g y = C 5 e i σ y + C 6 e i σ y = C 5 cos ( σ y) + i sin ( σ y) + C 6 cos σ y i sin ( σ y) = C 5 + C 6 cos σ y + C 5 C 6 i sin( σ y) = A = B were A, B are new constants wit C 5 + C 6 = A C 5 C 6 i = B g y = Acos σ y + B sin( σ y) (6) Let s define A and B from boundary conditions: g = (BC 1) g = (BC 2) see equations (BC 1) and (BC 2) in 3a from (6) using (BC 1) g = Acos σ + B sin( σ ) = Acos σ = A = (7) 3. 1. 215. Dr. Noemi Friedman PDE tutorial Seite 12
Analytical solution of Laplace equation wit separation of from equations (6) (BC 2) and (7) g = B sin( σ ) = (8) equations (8) can be satisfied if B = would leave to trivial solution or if sin( σ ) = σ k = kπ were k = 1,2,3 (9) A sequance of solution: g k y = B k sin kπ y 3. 1. 215. Dr. Noemi Friedman PDE tutorial Seite 13
Analytical solution of Laplace equation wit separation of SOLVE (ODE1) wit f x σf x = (ODE1) Assuming f x = e κx κ 2 e κκ σe κκ = Caracteristic equation: κ 2 σ = κ = ± σ real roots Te solution: f x = C 7 e σ x + C 8 e σ x (1) were C 7, C 8 are constants 3. 1. 215. Dr. Noemi Friedman PDE tutorial Seite 14
Analytical solution of Laplace equation wit separation of Using equation (9) and (1) f k x = D k e kπ x + E k e kπ x (11) And te ansatz: u k x, y = f k x g k y = D k e kπ x + E k e kπ x B k sin kπ y (12) Let s define B k, D k and E k from boundary conditions (BC3) and (BC4). First from (BC4): lim u x, y = lim x x D ke kπ x + E k e kπ x B k sin kπ y = lim e kπ x = x lim x D k e kπ x B k sin kπ y = only if D k = 3. 1. 215. Dr. Noemi Friedman PDE tutorial Seite 15
Analytical solution of Laplace equation wit separation of u k x, y = B k E k e kπ x sin kπ y = A ke kπ x sin kπ y A k Te general solution will be te sum of te sequances: u x, y = k=1 u k x, y = A k e kπ x sin kπ k=1 y Let s define A k from boundary conditions (BC3): u, y = u (y) = (y 2 2 /4) (BC3) u, y = A k e kπ sin k=1 kπ y = A k sin kπ y = u (y) k=1 Accordingly te A k coefficients are te coefficients of te Fourier serious of te function u (y) 3. 1. 215. Dr. Noemi Friedman PDE tutorial Seite 16
Analytical solution of Laplace equation wit separation of Let s define A k from boundary conditions (BC3): u, y = u y = y(y ) (BC3) u, y = A k e kπ sin k=1 kπ y = A k sin kπ y = u (y) k=1 Accordingly te A k coefficients are te coefficients of te Fourier serious of te function u (y) A k = 2 u (y) sin kπ y dy = 2 ( y(y )) sin kπ y dy u x, y = 2 u (y) sin k=1 kπ y dy e kπ x sin kπ y Excercise: Calculate analyticaly te A k coefficients 3. 1. 215. Dr. Noemi Friedman PDE tutorial Seite 17
Analytical solution of Laplace equation wit separation of A k = 2 (y(y )) sin kπ y dy = 2 (y2 y) sin kπ y dy = 2 2 kπ (y2 y) cos kπ y + (2y ) cos kπ y dy = kπ (y2 y) cos kπ y + kπ (2y ) sin kπ y kπ 2 sin kπ y dy 2 kπ (y2 y) cos kπ y + kπ (2y ) sin kπ y + kπ 2 2 cos kπ y = = = 2 1 k 2 A k = 8 2 kπ 3 ii k ii ooo ii k ii eeee 3. 1. 215. Dr. Noemi Friedman PDE tutorial Seite 18
Analytical solution of Laplace equation wit separation of u x, y = 8 2 2n 1 3 π 3 e n=1 2n 1 π x sin 2n 1 π y 1.8.6.4 2.2 1.5.5 1 1.5 2 2.5 3.5 1 3. 1. 215. Dr. Noemi Friedman PDE tutorial Seite 19
2D Laplace equation - finite difference metod Let s consider te Laplace equation in 2 dimensions: If dx=dy: 29. 11. 213. Dr. Noemi Friedman PDE tutorial Seite 2
n = 2D Laplace equation - finite difference metod u n 1,1 u n 2,1 u n 3,1 u n M 1,1 u n 1,2 u n 2,2 u n M 1,2 u n 1,N 1 u n M 1,N 1 u n = u 1,1 u 2,1 u 3,1 u 4,1 u 1,2 u 2,2 u 3,2 u 4,2 u 1,3 u 2,3 u 3,3 u 4,3 l = 1.. N y = lδy (, N) (,1) (1,1) (2,1) (3,1) (M, 1) (,) (1,) (2,) (3,) x = jδx (2,3) (1,2) (2,2) (3,2) j = 1.. M (M, N) (M, 1) wit omogenous Diriclet BC. r 4u j,l + u j 1,l + u j+1,l + u j,l 1 + u j,l+1 = f j,l 3. 1. 215. Dr. Noemi Friedman PDE tutorial Seite 21
2D Laplace equation - finite difference metod r 4u j,l + u j 1,l + u j+1,l + u j,l 1 + u j,l+1 = f j,l wit omogenous Diriclet BC. 4 1 1 1 4 1 1 1 4 1 1 1 4 1 1 4 1 1 +r 1 1 4 1 1 1 1 4 1 1 1 1 4 1 1 4 1 1 1 4 1 1 1 4 1 1 1 4 u 1,1 u 2,1 u 3,1 u 4,1 u 1,2 u 2,2 u 3,2 u 4,2 u 1,3 u 2,3 u 3,3 u 4,3 Sparse matrix wit bandwidt: 2M-1 (ere 9) BUT te band itself is sparse, only five diagonals are nonzero 3. 1. 215. Dr. Noemi Friedman PDE tutorial Seite 22
2D Laplace equation - finite difference metod r 4u j,l + u j 1,l + u j+1,l + u j,l 1 + u j,l+1 = f j,l B 1 u = f were B 1 = B C C B C C B B = 1 + 4r r r 1 + 4r r r 1 + 4r C = r r r 3. 1. 215. Dr. Noemi Friedman PDE tutorial Seite 23