Você está na página 1de 31

Introduction to Galerkin and Finite Element Methods

Scott Small

December 4th, 2008

Scott Small

Introduction to Galerkin and Finite Element Methods

Outline

Overview of Dierential Equations The Galerkin Method The Finite Element Method

Scott Small

Introduction to Galerkin and Finite Element Methods

Outline

Overview of Dierential Equations The Galerkin Method The Finite Element Method

Scott Small

Introduction to Galerkin and Finite Element Methods

Overview of Dierential Equations


There are two types of dierential equations: Ordinary dierential equations (ODEs) are dierential equations where the solution has one independent variable. An example is y (t) = t 2 y (t) Partial dierential equations (PDEs) are dierential equations where the solution has many independent variables. An example is u u (x, y ) + (x, y ) = x 2 + xy x y Dierential equations usually have an associated domain with initial conditions (called boundary conditions).

Scott Small

Introduction to Galerkin and Finite Element Methods

Overview of Dierential Equations


PDEs have many applications to real world problems. Helmholtzs Equation: Used in electrodynamics 2u 2u (x, y ) 2 (x, y ) ku(x, y ) = f (x, y ) x 2 y

Heat Equation: Governs distribution of heat u 2u 2u (x, y , t) 2 (x, y , t) 2 (x, y , t) = f (x, y , t) t x y Burgers Equation: Used for trac ow u u (x, t) + u(x, t) (x, t) = 0 t x Beam Equation: Used in elasticity of materials u 4u (x, t) + 4 (x, t) = 0 t x
Scott Small Introduction to Galerkin and Finite Element Methods

Overview of Dierential Equations

An exact solution to a dierential equation is a function that, when substituted into the dierential equation, results in a true statement. A numerical solution to a dierential equation is an approximation to an exact solution.

Scott Small

Introduction to Galerkin and Finite Element Methods

Outline

Overview of Dierential Equations The Galerkin Method The Finite Element Method

Scott Small

Introduction to Galerkin and Finite Element Methods

The Galerkin Method

The Galerkin Method is very popular for nding numerical solutions to dierential equations.

The idea is to approximate the solution to a dierential equation by very nice and simple functions.

Scott Small

Introduction to Galerkin and Finite Element Methods

The Galerkin Method

Identify the dierential equation to solve, along with its domain and boundary conditions. Identify the vector space in which to look for a solution, called the solution space. Rewrite the dierential equation in a special way, know as the weak formulation. Decide what type of functions are to be used to approximate the solution. Rewrite the weak formulation to reect these approximating functions. Solve the resulting weak formulation for an approximate solution.

Scott Small

Introduction to Galerkin and Finite Element Methods

1. Identify the Dierential Equation

We will use Helmholtzs Equation in one dimension (an ODE). u (x) 3u(x) = cos(x) for x [0, 2] u(0) = 0 u (2) = 1

Scott Small

Introduction to Galerkin and Finite Element Methods

2. Identify the Solution Space

Based upon the given dierential equation and domain, we use for our solution space the set of all smooth functions with domain [0, 2] that are 0 for x = 0. We will call this vector space V .

Note that we want the solution of the dierential equation to come from this set. (But it also should satisfy the condition u (2) = 1.)

Scott Small

Introduction to Galerkin and Finite Element Methods

3. Find the Weak Formulation


Let v V .

u (x) 3u(x) = cos(x) u (x)v (x) 3u(x)v (x) = cos(x)v (x)


2 2 2

u (x)v (x)dx
0 2 0

3u(x)v (x)dx

=
0 2

cos(x)v (x)dx cos(x)v (x)dx


0 2

v (2) +
0 2

u (x)v (x) 3u(x)v (x)dx u (x)v (x) 3u(x)v (x)dx


0

= =
0

cos(x)v (x)dx + v (2)

The last line is the weak formulation.

Scott Small

Introduction to Galerkin and Finite Element Methods

4. Develop Approximating Functions


To approximate the solution, we use a subspace of V .

Consider {x, x 2 , x 3 }. We use we use this as a basis for our approximating subspace.

Let V3 = span{x, x 2 , x 3 }. We will also let u3 denote our approximate solution (in V3 ). As such, there exists {i }, i = 1, 2, 3 such that u3 (x) = 1 x + 2 x 2 + 3 x 3

Scott Small

Introduction to Galerkin and Finite Element Methods

5. Update Weak Formulation

To approximate the solution, we replace our solution space V with our approximating solution space V3 . The weak formulation becomes:
2 2

u (x)v (x) 3u(x)v (x)dx


0 2

=
0 2

cos(x)v (x)dx + v (2) cos(x)v3 (x)dx + v3 (2)


0

u3 (x)v3 (x) 3u3 (x)v3 (x)dx


0

for all v3 V3 .

Scott Small

Introduction to Galerkin and Finite Element Methods

6. Solve the Approximate Weak Formulation


To solve this for our approximation, we start by using
3 3

u3 (x) =
i=1

i x i and u3 (x) =
i=1

i ix i1

This gives us
2 2

u3 (x)v3 (x) 3u3 (x)v3 (x)dx =


0 2 3 3 0

cos(x)v3 (x)dx + v3 (2)

[
0 i=1

i ix

i1

]v3 (x) 3[
i=1

i x i ]v3 (x)dx =
2

cos(x)v3 (x)dx + v3 (2)


0

Scott Small

Introduction to Galerkin and Finite Element Methods

6. Solve the Approximate Weak Formulation

The approximate weak formulation can be written as


3 2 2

[i
i=1 0

ix i1 v3 (x) 3x i v3 (x)dx] =
0

cos(x)v3 (x)dx + v3 (2)

Since this still holds for all v3 V3 , we get three equations by picking three choices for v3 V3 : x, x 2 , and x 3 (the basis for our approximation space V3 ).

Scott Small

Introduction to Galerkin and Finite Element Methods

6. Solve the Approximate Weak Formulation

[i
i=1 3 2 0

ix i1 3x i xdx] =
0 2

cos(x)x dx + 2 cos(x)x 2 dx + 4
0 2

[i
i=1 3 0 2

2ix i1 x 3x i x 2 dx] = 3ix i1 x 2 3x i x 3 dx] =


0 0

[i
i=1

cos(x)x 3 dx + 8

Scott Small

Introduction to Galerkin and Finite Element Methods

6. Solve the Approximate Weak Formulation

The resulting linear system is

61 82 11.23 = 2.402448 81 8.5333332 83 = 4.154008 11.21 82 + 2.7428573 = 7.865929 Solving gives u3 (x) = .350567x .402926x 2 + .261104x 3 .

Scott Small

Introduction to Galerkin and Finite Element Methods

The Galerkin Method

Ways to improve accuracy of our approximation


1 2

Higher degree polynomials Use other functions for a basis

Scott Small

Introduction to Galerkin and Finite Element Methods

Outline

Overview of Dierential Equations The Galerkin Method The Finite Element Method

Scott Small

Introduction to Galerkin and Finite Element Methods

The Finite Element Method

The Finite Element Method is a Galerkin Method that uses piecewise functions to approximate the solution of a dierential equation. We divide the domain into geometric regions called elements. We then form an approximate solution on each of these elements.

Scott Small

Introduction to Galerkin and Finite Element Methods

The Finite Element Method

As an example, consider Poissons Equation in 2 variables: 2u 2u (x, y ) 2 (x, y ) = y 2 sin(xy ) + x 2 sin(xy ) x 2 y u(0, y ) = 0 u(x, 0) = 0 u(2, y ) = sin(2y ) u(x, 2) = sin(2x) The solution is given by u(x, y ) = sin(xy ).

Scott Small

Introduction to Galerkin and Finite Element Methods

The Finite Element Method


Domain

Scott Small

Introduction to Galerkin and Finite Element Methods

The Finite Element Method

Exact Solution

Scott Small

Introduction to Galerkin and Finite Element Methods

The Finite Element Method

Triangular Mesh - 20 Triangles

Scott Small

Introduction to Galerkin and Finite Element Methods

The Finite Element Method


Approximate Solution with 20 Triangles

Scott Small

Introduction to Galerkin and Finite Element Methods

The Finite Element Method

Triangular Mesh - 80 Triangles

Scott Small

Introduction to Galerkin and Finite Element Methods

The Finite Element Method


Approximate Solution with 80 Triangles

Scott Small

Introduction to Galerkin and Finite Element Methods

The Finite Element Method

Triangular Mesh - 320 Triangles

Scott Small

Introduction to Galerkin and Finite Element Methods

The Finite Element Method


Approximate Solution with 320 Triangles

Scott Small

Introduction to Galerkin and Finite Element Methods

References

Atkinson Kendall, Han Weimin. Theoretical Numerical Analysis A Functional Analysis Framework. Springer: New York. 2005. Evans Lawrence C. Partial Dierential Equations. AMS: Providence. 1998. Quarteroni Alo, Sacco Riccardo, Saleri Fausto. Numerical Mathematics. Springer-Verlag: New York. 2000.

Scott Small

Introduction to Galerkin and Finite Element Methods

Você também pode gostar