
Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!

−
d dx
( a(x)
du dx
)
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.