Introduction to Finite Element Method

Similar documents
Lecture 4: Piecewise Cubic Interpolation

1 2-D Second Order Equations: Separation of Variables

Review of Calculus, cont d

Lecture 14: Quadrature

Generalizations of the Basic Functional

New Expansion and Infinite Series

Calculus of Variations: The Direct Approach

NUMERICAL INTEGRATION. The inverse process to differentiation in calculus is integration. Mathematically, integration is represented by.

CMDA 4604: Intermediate Topics in Mathematical Modeling Lecture 19: Interpolation and Quadrature

Numerical Integration

1.9 C 2 inner variations

1.3 The Lemma of DuBois-Reymond

ODE: Existence and Uniqueness of a Solution

1.2. Linear Variable Coefficient Equations. y + b "! = a y + b " Remark: The case b = 0 and a non-constant can be solved with the same idea as above.

Discrete Least-squares Approximations

Math 1B, lecture 4: Error bounds for numerical methods

Heat flux and total heat

Numerical Methods I Orthogonal Polynomials

63. Representation of functions as power series Consider a power series. ( 1) n x 2n for all 1 < x < 1

MATH34032: Green s Functions, Integral Equations and the Calculus of Variations 1

Orthogonal Polynomials and Least-Squares Approximations to Functions

Construction of Gauss Quadrature Rules

Consequently, the temperature must be the same at each point in the cross section at x. Let:

Matrices, Moments and Quadrature, cont d

Lecture 19: Continuous Least Squares Approximation

Best Approximation in the 2-norm

Conservation Law. Chapter Goal. 5.2 Theory

1.1. Linear Constant Coefficient Equations. Remark: A differential equation is an equation

Advanced Computational Fluid Dynamics AA215A Lecture 3 Polynomial Interpolation: Numerical Differentiation and Integration.

The Wave Equation I. MA 436 Kurt Bryan

Best Approximation. Chapter The General Case

Introduction to the Calculus of Variations

MAC-solutions of the nonexistent solutions of mathematical physics

4. Calculus of Variations

Chapter 4. Additional Variational Concepts

Plates on elastic foundation

Sturm-Liouville Eigenvalue problem: Let p(x) > 0, q(x) 0, r(x) 0 in I = (a, b). Here we assume b > a. Let X C 2 1

Lecture 6: Singular Integrals, Open Quadrature rules, and Gauss Quadrature

A - INTRODUCTION AND OVERVIEW

A REVIEW OF CALCULUS CONCEPTS FOR JDEP 384H. Thomas Shores Department of Mathematics University of Nebraska Spring 2007

State space systems analysis (continued) Stability. A. Definitions A system is said to be Asymptotically Stable (AS) when it satisfies

Solving the Poisson Partial Differential Equation using Spectral Polynomial Methods

The Regulated and Riemann Integrals

Math 270A: Numerical Linear Algebra

Abstract inner product spaces

First variation. (one-variable problem) January 14, 2013

Integrals along Curves.

Calculus of Variations

University of Houston, Department of Mathematics Numerical Analysis II

STURM-LIOUVILLE BOUNDARY VALUE PROBLEMS

Quantum Physics II (8.05) Fall 2013 Assignment 2

Quadratic Forms. Quadratic Forms

Partial Derivatives. Limits. For a single variable function f (x), the limit lim

Numerical quadrature based on interpolating functions: A MATLAB implementation

1 1D heat and wave equations on a finite interval

The Basic Functional 2 1

Review of Gaussian Quadrature method

Physics 116C Solution of inhomogeneous ordinary differential equations using Green s functions

Numerical Integration. Newton Cotes Formulas. Quadrature. Newton Cotes Formulas. To approximate the integral b

Variational Techniques for Sturm-Liouville Eigenvalue Problems

COSC 3361 Numerical Analysis I Numerical Integration and Differentiation (III) - Gauss Quadrature and Adaptive Quadrature

Exam 2, Mathematics 4701, Section ETY6 6:05 pm 7:40 pm, March 31, 2016, IH-1105 Instructor: Attila Máté 1

Chapter One: Calculus Revisited

Section 6.1 INTRO to LAPLACE TRANSFORMS

THE EXISTENCE-UNIQUENESS THEOREM FOR FIRST-ORDER DIFFERENTIAL EQUATIONS.

Theoretical foundations of Gaussian quadrature

Numerical Analysis: Trapezoidal and Simpson s Rule

Lecture Notes: Orthogonal Polynomials, Gaussian Quadrature, and Integral Equations

Math 115 ( ) Yum-Tong Siu 1. Lagrange Multipliers and Variational Problems with Constraints. F (x,y,y )dx

Problem set 1: Solutions Math 207B, Winter 2016

Partial Differential Equations

LECTURE. INTEGRATION AND ANTIDERIVATIVE.

MA Handout 2: Notation and Background Concepts from Analysis

u t = k 2 u x 2 (1) a n sin nπx sin 2 L e k(nπ/l) t f(x) = sin nπx f(x) sin nπx dx (6) 2 L f(x 0 ) sin nπx 0 2 L sin nπx 0 nπx

Week 10: Line Integrals

Math Fall 2006 Sample problems for the final exam: Solutions

Math 100 Review Sheet

S. S. Dragomir. 2, we have the inequality. b a

The Riemann Integral

MA 124 January 18, Derivatives are. Integrals are.

Chapter 6 Electrostatic Boundary Value Problems. Dr. Talal Skaik

CBE 291b - Computation And Optimization For Engineers

Green s functions. f(t) =

1 Bending of a beam with a rectangular section

Section 4.8. D v(t j 1 ) t. (4.8.1) j=1

Review on Integration (Secs ) Review: Sec Origins of Calculus. Riemann Sums. New functions from old ones.

NUMERICAL INTEGRATION

g i fφdx dx = x i i=1 is a Hilbert space. We shall, henceforth, abuse notation and write g i f(x) = f

Definite integral. Mathematics FRDIS MENDELU

3.4 Numerical integration

Chapter 8: Methods of Integration

Math Advanced Calculus II

Continuous Random Variables

Definite integral. Mathematics FRDIS MENDELU. Simona Fišnarová (Mendel University) Definite integral MENDELU 1 / 30

x = b a n x 2 e x dx. cdx = c(b a), where c is any constant. a b

HW3, Math 307. CSUF. Spring 2007.

Properties of Integrals, Indefinite Integrals. Goals: Definition of the Definite Integral Integral Calculations using Antiderivatives

Thin-Plate Splines. Contents

The Algebra (al-jabr) of Matrices

Summary of equations chapters 7. To make current flow you have to push on the charges. For most materials:

Transcription:

Introduction to Finite Element Method Introductory Course on Multiphysics Modelling TOMASZ G. ZIELIŃSKI bluebox.ippt.pn.pl/ tzielins/ Tble of Contents 1 Introduction 1 1.1 Motivtion nd generl concepts............. 1 1.2 Mjor steps of finite element nlysis........... 3 2 Strong nd wek forms 3 2.1 Model problem....................... 3 2.2 Boundry-vlue problem nd the strong form...... 4 2.3 The wek form....................... 5 2.4 Associted vritionl problem.............. 7 3 Glerkin method 9 3.1 Discrete (pproximted) problem............. 9 3.2 System of lgebric equtions.............. 9 4 Finite element model 10 4.1 Discretiztion nd (liner) shpe functions........ 10 4.2 Lgrnge interpoltion functions............. 11 4.3 Finite element system of lgebric equtions...... 11 4.3.1 Mtrix of the system................ 11 4.3.2 Right-hnd-side vector............... 14 4.4 Imposition of the essentil boundry conditions..... 15 4.5 Results: nlyticl nd FE solutions........... 16 1 Introduction 1.1 Motivtion nd generl concepts The Finite Element Method (FEM) is generlly speking: powerful computtionl technique for the solution of differentil nd integrl equtions tht rise in vrious fields of engineering nd pplied sciences;

2 Introduction to Finite Element Method ICMM lecture mthemticlly: generliztion of the clssicl vritionl (Ritz) nd weightedresidul (Glerkin, lest-squres, etc.) methods. Motivtion Most of the rel problems: re defined on domins tht re geometriclly complex, my hve different boundry conditions on different portions of the boundry. Therefore, it is usully impossible (or difficult): 1. to find solution nlyticlly (so one must resort to pproximte methods), 2. to generte pproximtion functions required in the trditionl vritionl methods. An nswer to these problems is finite-element pproch which consists in representing domins with irregulr shpes by collection of finite elements. Min concept of FEM A problem domin cn be viewed s n ssemblge of simple geometric shpes, clled finite elements, for which it is possible to systemticlly generte the pproximtion functions needed in the solution of differentil equtions by ny of the vritionl nd weighted-residul methods. Remrks: The pproximtion functions re lso clled shpe functions or interpoltion functions since they re often constructed using ides from interpoltion theory. The finite element method is piecewise (or element-wise) ppliction of the vritionl nd weighted-residul methods. For given BVP, it is possible to develop different finite element pproximtions (or finite element models), depending on the choice of prticulr vritionl nd weighted-residul formultion.

ICMM lecture Introduction to Finite Element Method 3 1.2 Mjor steps of finite element nlysis The mjor steps in the finite element nlysis of typicl problem re presented below. 1. Discretiztion of the domin into set of finite elements (mesh genertion). 2. Weighted-integrl or wek formultion of the differentil eqution over typicl finite element (subdomin). 3. Development of the finite element model of the problem using its weightedintegrl or wek form. The finite element model consists of set of lgebric equtions mong the unknown prmeters (degrees of freedom) of the element. 4. Assembly of finite elements to obtin the globl system (i.e., for the totl problem) of lgebric equtions for the unknown globl degrees of freedom. 5. Imposition of essentil boundry conditions. 6. Solution of the system of lgebric equtions to find (pproximte) vlues in the globl degrees of freedom. 7. Post-computtion of solution nd quntities of interest. 2 Strong nd wek forms 2.1 Model problem Consider the following (ordinry) differentil eqution (O)DE: d ( α(x) du(x) ) + γ(x) u(x) = f(x) for x (, b) (1) dx dx where α(x), γ(x), f(x) re the known dt of the problem: the first two quntities result from the mteril properties nd geometry of the problem wheres the third one depends on source or lods, u(x) is the solution to be determined; it is lso clled dependent vrible of the problem (with x being the independent vrible). The domin of this 1D problem is n intervl (, b); the points x = nd x = b re the boundry points where boundry conditions re imposed, for exmples, s follows ( ) q() n x () = α() du () = ˆq, (Neumnn b.c.) BCs: dx (2) u(b) = û. (Dirichlet b.c.)

4 Introduction to Finite Element Method ICMM lecture Here: ˆq nd û re the given boundry vlues, n x is the component of the outwrd unit vector norml to the boundry. In the 1D cse there is only one component nd: n x () = 1, n x (b) = +1. Moreover: q(x) α(x) du(x) is the so-clled secondry vrible specified on the boundry by the Neumnn boundry condition (2) 1 lso known s the second kind dx or nturl boundry condition, u(x) is the primry vrible specified on the boundry by the Dirichlet boundry condition (2) 2 lso known s the first kind or essentil boundry condition. Exmples of different physics problems The model problem cn describe different physicl problems (formulted s 1-dimensionl). The tble below contins list of fields of study in which the model eqution rises, with mening of vrious prmeters nd vribles. u (primry vr.) α (mteril dt) f (source, lod) q (secondry vr.) Het trnsfer temperture therml conductnce het genertion het Flow through porous medium fluid-hed permebility infiltrtion source Flow through pipes pressure pipe resistnce 0 source Flow of viscous fluids velocity viscosity pressure grdient sher stress Elstic cbles displcement tension trnsversl force point force Elstic brs displcement xil stiffness xil force point force Torsion of brs ngle of twist sher stiffness 0 torque Electrosttics electric potentil dielectric constnt chrge density electric flux 2.2 Boundry-vlue problem nd the strong form Let: Ω = (, b) be n open set (n open intervl in cse of 1D problems); Γ be the boundry of Ω, tht is, Γ = {, b};

ICMM lecture Introduction to Finite Element Method 5 Γ = Γ q Γ u where, e.g., Γ q = {} nd Γ u = {b} re disjoint prts of the boundry (i.e., Γ q Γ u = ) relting to the Neumnn nd Dirichlet boundry conditions, respectively; (the dt of the problem): f : Ω R, α : Ω R, γ : Ω R; (the vlues prescribed on the boundry): ˆq : Γ q R, û : Γ u R. Boundry Vlue Problem (BVP) Find u =? stisfying differentil eq.: ( α u ) + γ u = f in Ω = (, b), (3) Neumnn b.c.: α u n x = ˆq on Γ q = {}, (4) Dirichlet b.c.: u = û on Γ u = {b}. (5) Definition 1 (Strong form). The clssicl strong form of boundry-vlue problem described by second-order (prtil) differentil eqution with boundry conditions consists of: the differentil eqution of the problem, the Neumnn boundry conditions, i.e., the nturl conditions imposed on the secondry dependent vrible (which involves the first derivtive of the dependent vrible). The Dirichlet (essentil) boundry conditions must be stisfied priori, tht is, the solution is to be found in the spce of ll twice-differentible functions stisfying the Dirichlet conditions. 2.3 The wek form Derivtion of the equivlent wek form consists of the three steps presented below. 1. Write the weighted-residul sttement for the eqution Here: b ( α u ) + γ u f δu dx = 0. (6) δu (the weighting function) belongs to the spce of test functions, u (the solution) belongs to the spce of tril functions.

6 Introduction to Finite Element Method ICMM lecture 2. Trde differentition from u to δu using integrtion by prts b b α u δu + α u δu + γ u δu f δu dx = 0. (7) Here, the boundry term my be written s b α u δu = = α u δu + x=b α u n x δu x=b α u δu x= α u n x δu x= = α u n x δu. x={,b} (8) The integrtion by prts wekens the differentibility requirement for the tril functions u (i.e., for the solution). 3. Use the Neumnn boundry condition (α u n x = ˆq on Γ q ) nd the property of test function (δu = 0 on Γ u ) for the boundry term α u n x δu = α u n x δu + α u x={,b} }{{} n x δu x= }{{} = ˆq δu. (9) x=b x= ˆq 0 In this wy, the wek (vritionl) form is obtined. Wek form b ˆq δu + α u δu + γ u δu f δu dx = 0. (10) x= The wek form is mthemticlly equivlent to the strong one: if u is solution to the strong (locl, differentil) formultion of BVP, it lso stisfies the corresponding wek (globl, integrl) formultion for ny δu (dmissible, i.e., sufficiently smooth nd δu = 0 on Γ u ). The wek integrl form requires tht: The essentil boundry conditions must be explicitly stisfied by the tril functions: u = û on Γ u. (In cse of displcement formultions of mny mechnicl nd structurl engineering problems this is clled kinemtic dmissibility requirement.) Consequently, the test functions must stisfy the dequte homogeneous essentil boundry conditions: δu = 0 on Γ u. The tril functions u (nd test functions, δu) need only to be continuous. (Remember tht in the cse of strong form the continuity of the first derivtive of solution u ws required.)

ICMM lecture Introduction to Finite Element Method 7 u(x), δu(x) solution nd tril functions, u u 1 u 2 û Γ u Dirichlet b.c. u = û, δu = 0 u 1, u 2 rbitrry tril functions δu = u 1 u 2 nd test functions, δu u 1 = û u 2 = û on Γ u on Γ u } Γ q Neumnn b.c. δu = 0 on Γ u x FIGURE 1: Test nd tril functions. Remrks: The strong form cn be derived from the corresponding wek formultion if more demnding ssumptions re tken for the smoothness of tril functions (i.e., oneorder higher differentibility). In vritionl methods, ny test function is vrition defined s the difference between ny two tril functions. Since ny tril function stisfy the essentil boundry conditions, the requirement tht δu = 0 on Γ u follows immeditely (see Figure 1). 2.4 Associted vritionl problem Here: U, W re functionl spces. The first one is clled the spce of solution (or tril functions), the other one is the spce of test functions (or weighting functions), A is biliner form defined on U W, F is liner form defined on W, P is certin functionl defined on U. The wek form is equivlent to vritionl problem!

8 Introduction to Finite Element Method ICMM lecture Wek form vs. vritionl problem Wek formultion: Find u U so tht A(u, δu) = F(δu) δu W. (11) Vritionl problem: Find u U which minimizes P(u). (12) Exmple 1 (for the model problem). In cse of the model problem: A(u, δu) = b b α u δu + γ u δu dx, F(δu) = f δu dx + ˆq δu. (13) x= The wek form (or the vritionl problem) is the sttement of the principle of the minimum totl potentil energy: Here: δ is now the vritionl symbol, δp(u) = 0, δp(u) = A(u, δu) F(δu) (14) P(u) is the potentil energy defined by the following qudrtic functionl P(u) = 1 A(u, u) F(u). (15) 2 This definition holds only when the biliner form is symmetric in u nd δu since: 1 2 δa(u, u) = 1 ( 2 A(δu, u) }{{} A(u,δu) ) +A(u, δu) = A(u, δu), δf(u) = F(δu). (16) Exmple 2 (for the model problem). In cse of the model problem: P(u) = 1 b A(u, u) F(u) = 2 δp(u) = A(u, δu) F(δu) = b α ( ) u 2 γ + 2 2 u2 f u dx ˆq u, (17) x= α u δu + γ u δu f δu dx ˆq δu. (18) x=

ICMM lecture Introduction to Finite Element Method 9 3 Glerkin method 3.1 Discrete (pproximted) problem If the problem is well-posed one cn try to find n pproximted solution u h by solving the so-clled discrete problem which is n pproximtion of the corresponding vritionl problem. Discrete (pproximted) problem Find u h U h so tht A h (u h, δu h ) = F h (δu h ) δu h W h. (19) Here: U h is finite-dimension spce of functions clled pproximtion spce wheres u h is the pproximte solution (i.e., pproximte to the originl problem). δu h re discrete test functions from the discrete test spce W h. In the Glerkin method W h = U h. (In generl, W h U h.) A h is n pproximtion of the biliner form A. F h is n pproximtion of the liner form F. 3.2 System of lgebric equtions In the Glerkin method (W = U) the sme shpe functions, φ i (x), re used to interpolte the pproximte solution s well s the (discrete) test functions: u h (x) = θ j φ j (x), δu h (x) = δθ i φ i (x). (20) j=1 Here, θ i re clled the degrees of freedom. Using this interpoltion for the pproximted problem leds to system of lgebric equtions (s described below). The left-hnd nd right-hnd sides of the problem eqution yield: i=1 A h (u h, δu h ) = F h (δu h ) = A h (φ j, φ i ) θ j δθ i = A ij θ j δθ i, (21) i=1 j=1 F h (φ i ) δθ i = i=1 i=1 i=1 j=1 F i δθ i, (22)

10 Introduction to Finite Element Method ICMM lecture where the (bi)linerity property is used, nd the coefficient mtrix ( stiffness mtrix) nd right-hnd-side vector re defined s follows: A ij = A h (φ j, φ i ), F i = F h (φ i ). (23) Now, the pproximted problem my be written s: i=1 j=1 A ij θ j F i δθ i = 0 δθ i. (24) It is (lwys) true if the expression in brckets equls zero which gives the system of lgebric equtions (for θ j =?): A ij θ j = F i. (25) Exmple 3 (for the model problem). In cse of the model problem: A ij = A h (φ j, φ i ) = F i = F h (φ i ) = b i=1 b α φ i φ j + γ φ i φ j dx, (26) f φ i dx + ˆq φ i x=. (27) 4 Finite element model 4.1 Discretiztion nd (liner) shpe functions Figure 2 presents liner pproximtion functions (the shpe functions) for the domin intervl. The procedure of constructing such liner interpolnts is described below. The domin intervl is divided into (N 1) finite elements (subdomins). There re N nodes, ech with only 1 degree of freedom (DOF). Locl (or element) shpe function is (most often) defined on n element in this wy tht it is equl to 1 in prticulr DOF nd 0 in ll the others. So, there re only two liner interpoltion functions in 1D finite element. Higher-order interpoltion functions involve dditionl nodes (DOF) inside element. Globl shpe function φ i is defined on the whole domin s: locl shpe functions on (neighbouring) elements shring DOF i, identiclly equl zero on ll other elements.

ICMM lecture Introduction to Finite Element Method 11 Shpe functions for internl nodes (i = 2,..., (N 1)) re: x x i 1 for x Ω i 1, h i 1 φ i = x i+1 x for x Ω i, h i 0 otherwise. Shpe functions for boundry nodes (i = 1 or N) re: x 2 x for x Ω 1, x x N 1 for x Ω N 1, φ 1 = h 1 φ N = h N 1 0 otherwise, 0 otherwise. (28) (29) First derivtives of shpe functions (see Figure 3) re discontinuous t interfces (points) between elements (in the cse of liner interpoltion they re element-wise constnt): 1 φ 1 for x Ω i 1, for x Ω 1, h i 1 1 1 = h 1 φ i = 0 otherwise, 1 φ for x Ω N 1, N = h N 1 for x Ω i, h i 0 otherwise. 0 otherwise. (30) 4.2 Lgrnge interpoltion functions Figure 4 presents the liner nd qudrtic Lgrnge interpoltion polynomils. The qudrtic interpoltion introduces n dditionl degree of freedom (in the middle of element). 4.3 Finite element system of lgebric equtions 4.3.1 Mtrix of the system The symmetry of the biliner form A involves the symmetry of the mtrix of the FE system of lgebric equtions, i.e., A ij = A ji. A component A ij (corresponding to the degrees of freedom i nd j) is defined s n integrl (over the problem domin) of sum of product of shpe functions, φ i nd φ j, nd product of their derivtives, φ i nd φ j. The product of two shpe functions (or their derivtives) is nonzero only on the elements tht contin the both corresponding degrees of freedom (since shpe function corresponding to prticulr degree of freedom is nonzero only on the elements shring it).

12 Introduction to Finite Element Method ICMM lecture φ i (x) 1 φ 1 φ i φ i 1 φ i+1 φ N 0 =x 1 x 2 x i 2 x i 1 x i x i+1 x i+2 x N 1 x N =b x h 1 h i 2 h i 1 h i h i+1 h N 1 FIGURE 2: Finite element discretiztion nd interpoltion by liner shpe functionscof 1-dimensionl domin (i.e., the intervl, b). φ i (x) h i 1 φ i 1 φ i φ i+1 φ N 0 =x 1 x 2 x i 2 x i 1 x i x i+1 x i+2 x N 1 x N =b x -1 φ 1 φ i 1 φ i φ i+1 h 1 h i 2 h i 1 h i h i+1 h N 1 FIGURE 3: First derivtives of liner shpe functions. L 1 k (ξ) L 2 k (ξ) L 1 0 L 1 1 1 L 2 0 L 2 1 L 2 2 1 0 0 1 ξ 0 0 0.5 1 ξ 1st order (liner) 2nd order (qudrtic) L 1 0(ξ) = 1 ξ, L 1 1(ξ) = ξ, L 2 0(ξ) = (2ξ 1) (ξ 1), L 2 1(ξ) = 4ξ (1 ξ), L 2 2(ξ) = ξ (2ξ 1). FIGURE 4: Lgrnge interpoltion polynomils of the first (liner) nd second-order (qudrtic). In the ltter cse n dditionl node is needed inside the element t ξ = 0.5.

ICMM lecture Introduction to Finite Element Method 13 Therefore, the integrl cn be computed s sum of the integrls defined only over these finite elements tht shre the both degrees of freedom (since the contribution from ll other elements is null): A ij = e E A (e) ij = e E(i,j) A (e) ij. (31) Here: E is the set of ll finite elements, E(i, j) is the set of finite elements tht contin the (both) degrees of freedom i nd j. For 1D problem pproximted by finite elements with liner shpe functions the mtrix of the system will be tridigonl: A ij = A (1) 11 for i = j = 1, A (i 1) ii + A (i) ii for i = j = 2,..., (N 1), A (N 1) NN for i = j = N, A (i) i,i+1 for i j = 1, 0 for i j > 1. (32) For the model problem the nonzero elements of the mtrix re: A 11 = x 2 x 1 α ( ) φ 2 1 + γ φ 2 1 dx = x 1 +h 1 x 1 α + γ ( x 1 + h 1 x ) 2 dx, (33) h 2 1 A ii = x i+1 x i 1 + α ( ) φ 2 i + γ φ 2 i dx = x i +h i x i x i x i h i 1 α + γ ( ) 2 x x i + h i 1 dx h 2 i 1 α + γ ( x i + h i x ) 2 dx, i = 2,..., (N 1), h 2 i (34) A NN = x N x N 1 α ( ) φ 2 N + γ φ 2 N dx = x N x N h N 1 α + γ ( ) 2 x x N + h N 1 dx, (35) h 2 N 1 A i,(i+1) = x i+1 x i α φ i φ i+1 + γ φ i φ i+1 dx = x i +h i x i α + γ ( x i + h i x )( x x i ) h 2 i dx, i = 1,..., (N 1). (36) For homogeneous mteril, when α(x) = const = α nd γ(x) = const = γ, the integrls in the formuls for non-zero elements of tridigonl mtrix cn be nlyticlly

14 Introduction to Finite Element Method ICMM lecture integrted nd the these non-zero elements re computed s follows: α h 1 + γ h 1 for i = j = 1, 3 α h i 1 + γ h i 1 + α 3 h i + γ h i for i = j = 2,..., (N 1), 3 α A ij = h N 1 + γ h N 1 for i = j = N, 3 α h i + γ h i for i j = 1, 6 0 for i j > 1. (37) 4.3.2 Right-hnd-side vector The element i of the right-hnd-side vector is computed s: F i = F (e) i = F (e) i. (38) e E e E(i) Here: E is the set of ll finite elements, E(i) is the set of finite elements tht contin the degree of freedom i. For the considered model problem the r.h.s. vector is computed s follows: x 2 F 1 = f φ 1 dx + ˆq φ 1 x 1 F i = F N =? x i+1 x i 1 f φ i dx = x i x i h i 1 x=x 1 = x 1 +h 1 x 1 f ( x x i + h i 1 ) f ( x 1 + h 1 x ) h i 1 dx + h 1 dx + ˆq, (39) x i +h i x i f ( x i + h i x ) h i dx, (40) i = 2,..., (N 1), (to be computed s rection to the essentil b.c. imposed t this node) (41) Finlly, for the model problem with uniform source (lod), i.e., when f(x) = const = f, the elements of r.h.s. vector re: f h 1 + ˆq for i = 1, 2 ) f (h F i = i 1 +h i for i = 2,..., (N 1), 2 F N =? for i = N ( rection to the essentil b.c.). (42)

ICMM lecture Introduction to Finite Element Method 15 4.4 Imposition of the essentil boundry conditions In generl, the ssembled mtrix A ij is singulr nd the system of lgebric equtions is undetermined. To mke it solvble the essentil boundry conditions must be imposed. Let B be the set of ll degrees of freedom, where the essentil boundry conditions re pplied, tht is, for n B: θ n = ˆθ n, where ˆθ n is known vlue. In prctice, the essentil BCs re imposed s described below. Compute new r.h.s. vector F i = F i n B A in ˆθn for i = 1,..., N. (43) Set F n = ˆθ n. Set à nn = 1 nd ll other components in the n-th row nd n-th column to zero, i.e., Ãni = Ãin = δ in for i = 1,..., N. Now, the new (sightly modified) system of equtions à ij θ i = F j is solved for θ i. Finlly, rections (lods, forces) t Dirichlet nodes cn be computed s F n = A ni θ i. (44) i=1 For the model problem the essentil b.c. re imposed only in the lst node (i.e., the N-th DOF), where known vlue ˆθ N is given, so the modified mtrix nd r.h.s. vector cn be formlly written s follows: A ij for i, j = 1,..., (N 1), à ij = δ Nj for i = N, j = 1,..., N, δ in for i = 1,..., N, j = N, F i A in ˆθN for i = 1,..., (N 1), F i = ˆθ N for i = N. (45) (46) After the solution of the modified system, the rection my be computed: F N = A Ni θ i = A N,(N 1) θ N 1 + A NN ˆθN. (47) i=1

16 Introduction to Finite Element Method ICMM lecture 4.5 Results: nlyticl nd FE solutions Consider the following dt for the model problem: α(x) = 1, γ = 3, f(x) = 1, = 0, q(0) = ˆq = 1, b = 2, u(2) = û = 0. Figure 5 shows nlyticl nd numericl results for the model problem with the dt ssumed s bove. Finite element clcultions used the liner Lgrnge interpoltion functions. The results obtined for N = 12 degrees of freedom re quite ccurte, however, n even better ccurcy could hve been chieved for only 3 degrees of freedom, if qudrtic interpoltion hd been pplied. u(x) 1 0.75 exct solution FEM: N = 5 FEM: N = 12 0.5 0.25 = 0 0.25 0.5 0.75 1 1.25 1.5 1.75 b = 2 x FIGURE 5: Results of finite element clcultions (with vrious number of DOF, using liner shpe functions) compred to the exct solution.