Introduction to the Finite Element Method 09.06.2009
Outline Motivation Partial Differential Equations (PDEs) Finite Difference Method (FDM) Finite Element Method (FEM) References
Motivation Figure: cross section of the room (cf. A. Jüngel, Das kleine Finite-Elemente-Skript) Situation: R 2 - room D 1 - window D 2 - heating N 1 - isolated walls, ceiling N 2 - totally isolated floor θ - temperature
Motivation Conservation of energy: T 0 θ T ρ 0 c e dx dt = κ θ T t 0 ν dσ x dt + f dx dt 0 Heat equation: Assumptions: θ ρ 0 c e div(κ θ) = f in for t > 0 t no time rate of change of the temperature, i.e. θ t = 0 no interior heat source/sink, i.e. f = 0 κ = 1
Motivation Model: θ = 0 in θ = θ W on D 1 θ = θ H on D 2 θ ν = 0 on N 2 θ ν + α(θ θ W ) = 0 on N 1 Example: θ W = 10 C θ H = 70 C α = 0.05 Figure: temperature distribution in the heated room (cf. A. Jüngel, Das kleine Finite-Elemente-Skript)
Partial Differential Equations (PDEs) Second-order PDEs Elliptic PDE (stationary) e.g. Poisson Equation (scalar) u = f in or stationary elasticity (vector-valued) div(σ) = f in Parabolic PDE e.g. heat equation θ div(κ θ) = f in (0, T ) Hyperbolic PDE e.g. instationary elasticity u div(σ) = f in (0, T )
Classification of PDEs Linear PDE θ θ = f in (0, T ) Semilinear PDE θ θ = f (θ) in (0, T ) Quasilinear PDE θ div(α( θ)) = f in (0, T ) Fully nonlinear PDE θ g( θ) = f in (0, T )
Boundary Conditions (BCs) Dirichlet BC (first kind, essential BC) u = g on Neumann BC (second kind, natural BC) u ν = u ν Robin BC (Cauchy BC, third kind) = g on u + σu = g on ν
Methods for solving PDEs Analytical Methods for PDEs / Existence and Uniqueness Method of Separation of Variables Method of Eigenfunction Expansion Method of Diagonalisation (Fourier Transformation) Method of Laplace Transformation Method of Green s Functions Method of Characteristics Method of Semigroups Variational Methods (e.g. Galerkin Approximation)
Methods for solving PDEs Numerical Methods for PDEs Finite Difference Method (FDM) pointwise approximation of the differential equation geometry is divided into an orthogonal grid Finite Element Method (FEM) powerful computational technique for the solution of differential and integral equations that arise in various fields of engineering and applied sciences differential equations will be solved with an equivalent variation problem geometry must be divided into small elements problem is solved by choosing basis functions which are supposed to approximate the problem
FDM Consider u = f in, u = 0 on Idea: approximate differential quotients by difference quotients reduce differential equation to algebraic system Assumptions: = (0, 1) 2 equidistant nodes (x i, y j ) (i, j = 0,..., N) with h = x i+1 x i = y i+1 y i Taylor Expansion u(x i+1, y j ) = u(x i, y j ) + u x (x i, y j )h + 1 2 u 2 x 2 (x i, y j )h 2 + O(h 3 ) u(x i 1, y j ) = u(x i, y j ) u x (x i, y j )h + 1 2 u 2 x 2 (x i, y j )h 2 + O(h 3 )
FDM Second-order centered difference 2 u x 2 = 1 h 2 ( u(xi+1, y j ) 2u(x i, y j ) + u(x i 1, y j ) ) + O(h) 2 u y 2 = 1 h 2 ( u(xi, y j+1 ) 2u(x i, y j ) + u(x i, y j 1 ) ) + O(h) Approximation of u u(x i, y j ) 1 h 2 ( ui+1,j + u i 1,j + u i,j+1 + u i,j 1 4u ij ) Find u ij = u(x i, y j ) s.t. u i+1,j u i 1,j u i,j+1 u i,j 1 + 4u ij = h 2 f ij, (x i, y j ) u ij = 0, (x i, y j ) whereas f ij = f (x i, y j )
FDM Linear system of equations: U k := u ij, F k := f ij with k = in + j leads to AU = F A = 1 h 2 A 0 I 0 I A 0 I......... I A 0 I 0 I A 0, A 0 = 1 h 2 4 1 0 1 4 1......... 1 4 1 0 1 4 Disadvantages of FDM complex (or changing) geometries and BCs existence of third derivatives f not continuous
FEM Consider u = f in, u = 0 on Trick: transform PDE into equivalent variational form Multiplication with arbitrary v X and integration over fv dx = div( u)v dx = v u ν dx + u v dx } {{ } =0 Find u X : v X u v dx = fv dx
FEM Approximation: Find solution of a finite dimensional problem Let (X h ) h 0 a sequence of finite dimensional spaces with X h X (h 0) and elements of X h vanish on Find u h X h s.t. v X h u h v dx = fv dx Let {ϕ i } i=1,...,n a basis of X h. The ansatz u h (x) = N i=1 y iϕ i (x) and the choice v = ϕ j lead to N y i i=1 ϕ i ϕ j dx = } {{ } =:A ij f ϕ j dx, j = 1,..., N } {{ } =:F j
FEM Linear system of equations: Notation: N A ij y i = F j, j = 1,..., N i=1 A - stiffness matrix F - force vector y i = u h (x i ) - solution vector Questions: What about X, X h, {ϕ i } i=1,...,n? Hint: choose basis s.t. as much as possible A ij = 0! (A less costly to form, Ay = F can be solved more efficiently)
FEM Idea: discretise the domain into finite elements and define basis functions which vansih on most of these elements 1D: interval 2D: triangular/quadrilateral shape 3D: tetrahedral, hexahedral forms Ansatz functions: support of basis functions as small as possible and number of basis functions whose supports intersect as small as possible use of piecewise (images of) polynomials
FEM Example: R 2 bounded Lipschitz domain, f L 2 () X = H0 1() Triangulation of by subdividing into a set T h = {K 1,..., K n } of non-overlapping triangles K i s.t. no vertex of a triangle lies on the edge of another triangle = K Th K Mesh parameter h = max K Th diam(k) X h := {u h C(, R): u h piecewise linear, u h = 0 on } Linear elements in 1D: ϕ i (x) = x x i 1 x i x i 1, x i 1 x x i x i+1 x x i+1 x i, x i 1 x x i 0, otherwise, i = 1,..., N 1
FEM Figure: basis of 1D linear finite elements (cf. T. M. Wagner, A very short introduction to the FEM) Figure: linear finite elements in 1D (cf. T. M. Wagner, A very short introduction to the FEM)
FEM Figure: basis function of 2D linear finite elements (cf. T. M. Wagner, A very short introduction to the FEM) Linear or high-order elements? Advantages: small error, better approximation, fast error convergence, less computing time for same error Disadvantages: larger matrix for same grid, no conservation of algebraic sign
FEM Matrix A is large, but sparse: only a few matrix elements are not equal to zero (intersection of the support of basis function is mostly empty) A symmetric, positive definit unique solution Linear system of equations: many methods in numerical linear algebra exist to solve linear systems of equations direct solvers (Gaussian elemination, LU decomposition, Cholesky decomposition): for N N matrix N 3 operations iterative solvers (CG, GMRES,... ): N operations for each iteration Runge-Kutta methods (ODEs for unsteady problems)
FEM Standard Error Estimation (P k -elements, u sufficiently smooth): ( ( u u h 2 dx u u h 2 dx ) 1 2 c h k+1 ( ) 1 2 c h k ( ) 1 D k+1 u 2 2 dx D k+1 u 2 dx ) 1 2 Consistency: exact solution solves approximate problem but for error that vanishes as h 0 Stability: errors remain bounded as h 0 Convergence: approximate solution must converge to a solution of the original problem for h 0 suitable for adaptive method
Model Algorithm of the FEM 1 Transformation of the given PDE via the variational principle 2 Selection of a finite element type 3 Discretization of the domain of interest into elements 4 Derivation of the basis from the discretisation and the chosen ansatz function 5 Calculation of the stiffness matrix and the right-hand side 6 Solution of the linear system of equations 7 Obtainment (and visualisation) of the approximation Software: ALBERTA, COMSOL, MATLAB, SYSWELD
References K. Atkinson, W. Han; Theoretical Numerical Analysis. D. Braess; Finite Elements. R. Dautray, J.-L. Lions; Mathematical Analysis and Numerical Methods for Science and Technology, Vol. 6: Evolution Problems II. C. Grossmann, H.-G. Roos; Numerical Treatment of PDEs. K. Knothe, H. Wessels; Finite elements. G. R. Liu, S. S. Quek; The FEM. M. Renardy, R. C. Rogers; An Introduction to PDEs. E. G. Thompson; Introduction to the FEM.
Thank you for your attention.