Docsity

Finite Element Method Homework: Deriving Matrix System for Boundary Value Problem, Study notes of Mathematics

Toggle sidebar
bg1
MATH 493 (Homework 4)
Finite Element Methods (Summer 2008)
1. Consider solving the following Boundary Value Problem (BVP) using the finite element
method:
−
d
dx a(x)du
dx!+b(x)u(x) = f(x) 0 < x < 1
u(0) = 0
u(1) = 0
(a) Derive the continuous weak-variational form of the BVP.
(b) Consider the finite element discretization of the given problem. Let the domain
[0, 1] be partitioned into a finite number of sub-intervals M with nodes x1=
0, x2, . . . , xN= 1. Let uh(x) be the finite element approximation to the exact
solution u(x) and let uh(x) =
N
X
i=1
ciφi(x) where φi(x) is the finite element hat
function defined at node xi. Starting from the discrete weak-variational form
(corresponding to part(a)), derive the following matrix system:
(K+M)~c =~
f
where we have for i, j = 1, . . . , N ,
Kij =Z1
0
a(x)dφj
dx (x)dφi
dx (x)dx
Mij =Z1
0
b(x)φj(x)φi(x)dx
fj=Z1
0
f(x)φj(x)dx
Here Kis the global stiffness matrix, Mis the global mass matrix, ~
fis the global
load vector and ~c is the vector of unknown coefficients.
(c) Let a(x) = x, b(x) = 1, f(x) = x2
−5x+ 1. Consider partitioning the domain
[0,1] into 3 elements (M= 3) and 4 nodes (N= 4). By defining the appropriate
basis functions over these elements, setup the matrix system in part (b) and solve
for the unknown coefficents. Determine uh(0.5) and compare the approximate
value obtained with the exact solution u(0.5).
(d) Implement a one-dimensional finite element program for the given boundary value
problem with a(x) = x, b(x)=1, f (x) = x2
−5x+ 1. Plot the exact solution
u(x) against the finite element solution uh(x) in the interval [0, 1] for the cases
M=3, 6, 12 and explain your observation.
(e) Write a subroutine to evaluate the error in the L2-norm between the exact and
the finite element solution over the domain. Perform a convergence study.

Partial preview of the text

Download Finite Element Method Homework: Deriving Matrix System for Boundary Value Problem and more Study notes Mathematics in PDF only on Docsity!

MATH 493 (Homework 4)

Finite Element Methods (Summer 2008)

  1. Consider solving the following Boundary Value Problem (BVP) using the finite element method:

−

d dx

( a(x)

du dx

)

  • b(x)u(x) = f (x) 0 < x < 1

u(0) = 0 u(1) = 0

(a) Derive the continuous weak-variational form of the BVP. (b) Consider the finite element discretization of the given problem. Let the domain [0, 1] be partitioned into a finite number of sub-intervals M with nodes x 1 = 0 , x 2 ,... , xN = 1. Let uh(x) be the finite element approximation to the exact

solution u(x) and let uh(x) =

∑^ N

i=

ciφi(x) where φi(x) is the finite element hat

function defined at node xi. Starting from the discrete weak-variational form (corresponding to part(a)), derive the following matrix system: (K + M ) ~c = f~ where we have for i, j = 1,... , N ,

Kij =

∫ (^1)

0

a(x)

dφj dx

(x)

dφi dx

(x) dx

Mij =

∫ (^1)

0

b(x)φj (x) φi(x) dx

fj =

∫ (^1)

0

f (x)φj (x) dx

Here K is the global stiffness matrix, M is the global mass matrix, f~ is the global load vector and ~c is the vector of unknown coefficients. (c) Let a(x) = x, b(x) = 1, f (x) = x^2 − 5 x + 1. Consider partitioning the domain [0, 1] into 3 elements (M = 3) and 4 nodes (N = 4). By defining the appropriate basis functions over these elements, setup the matrix system in part (b) and solve for the unknown coefficents. Determine uh(0.5) and compare the approximate value obtained with the exact solution u(0.5). (d) Implement a one-dimensional finite element program for the given boundary value problem with a(x) = x, b(x) = 1, f (x) = x^2 − 5 x + 1. Plot the exact solution u(x) against the finite element solution uh(x) in the interval [0, 1] for the cases M=3, 6, 12 and explain your observation. (e) Write a subroutine to evaluate the error in the L 2 -norm between the exact and the finite element solution over the domain. Perform a convergence study.