HOMEWORK 1: THE BASICS
•
Solve the followng boundary value problem, with domain Ω = (0
,L
),
analytically:
d
dx
±
A
1
du
dx
²
=
k
2
sin
(
2
πkx
L
)
A
1
=
given constant
= 0
.
1
k
=
given constant
L
= 1
u
(0) = Δ
1
=
given constant
= 0
u
(
L
) = Δ
2
=
given constant
= 1
(1)
•
Now solve this with the ﬁnite element method using linear equalsized
elements. In order to achieve
e
N
def
=

u

u
N

A
1
(Ω)

u

A
1
(Ω)
≤
TOL
= 0
.
05
,

u

A
1
(Ω)
def
=
s
Z
Ω
du
dx
A
1
du
dx
dx
(2)
how many ﬁnite elements (
N
) are needed for
k
= 1
⇒
N
=?
k
= 2
⇒
N
=?
k
= 4
⇒
N
=?
k
= 8
⇒
N
=?
k
= 16
⇒
N
=?
k
= 32
⇒
N
=?
(3)
You should set up a general matrix equation and solve it using Gaus
sian elimination. Later we will use other types of more eﬃcient solvers.
1
This preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentPlot the numerical solutions for
N
= 2
,
4
,
8
,
16
,...
, for each
k
, along
with the exact solution. Also make a plot of the
e
N
for each
k
.
Remarks:
You should write a general onedimensional code where you
specify the number of elements. Your code should partition the domain
automatically. However, if you want to make the code more general (for
future assignments), you should put in the following features:
This is the end of the preview.
Sign up
to
access the rest of the document.
 Spring '08
 ZOHDI
 Partial Differential Equations, Finite Element Method, Boundary value problem, dx dx dx, Elliptic boundary value problem

Click to edit the document details