Workshop on Theoretical and Computational Aspects of PDEs
Indian Institute of Technology Roorkee
Assignment–1 (NA of PDEs)
1. Let Vh be the space of all continuous piecewise linears on a uniform mesh with four nodes
of I = [0, 1]. Find the interpolant Πf ∈ Vh to the following functions f .
(a) f (x) = x2 + 1.
(b) f (x) = cos(πx).
2. Let I = [0, 1] and f (x) = x2 for x ∈ I.
(a) Calculate I f dx analytically.
R
(b) Calculate I f dx using the Mid–point rule.
R
(c) Calculate I f dx using Simpson’s rule.
R
(d) Compute the quadrature errors in (b) and (c).
3. Let I = [0, 1] and f (x) = x2 for x ∈ I.
(a) Let Vh be the space P1 (I) of linear functions on I. Compute the L2 –projection
Ph f ∈ Vh of f .
(b) Divide I into two subintervals of equal length and let Vh be the corresponding space
of continuous piecewise linear functions. Compute the L2 –projection Ph f ∈ Vh of f .
4. Show that
Z
(f − Ph f )v dx = 0 ∀v ∈ Vh ,
Ω
if and only if
Z
(f − Ph f )φi dx = 0 for i = 0, 1, . . . , n,
Ω
where {φi }n0 ⊂ Vh denotes the usual basis of hat functions.
5. Compute the L2 –projection Ph f of the following functions f using MATLAB.
(a) f (x) = x2 .
(b) f (x) = x3 (x − 1)(1 − 2x).
Use a uniform mesh I of the interval I = [0, 1] with n = 5, 10, 20, 40 and 80 subintervals
and plot the interpolant.
6. Let 0 = x0 < x1 < x2 < x3 = 1, where x1 = 1/6 and x2 = 1/2 be a partition of the
interval I = [0, 1] into three subintervals. Furthermore, let Vh,0 be the space of continuous
piecewise linear functions on this partition that vanish at the end–points x = 0 and x = 1.
(a) Compute the stiffness matrix A defined by
Z
Ai,j = φ0i φ0j dx i, j = 1, 2, · · · , n − 1.
I
(b) Compute the load vector b, with f = 1, defined by
Z
fi = f φi dx i = 1, 2, · · · , n − 1.
I
(c) Solve the linear system Aξ = b and compute the finite element solution uh .
7. Consider the problem
−((1 + x)u0 )0 = 0, x ∈ I = [0, 1],
0 (0.1)
u(0) = 0, u (1) = 1.
Divide the interval I into three subintervals of equal length h = 1/3 and let Vh be the
corresponding space of continuous piecewise linear functions vanishing at x = 0.
(a) Determine the analytical solution u.
(b) Use Vh to formulate a finite element method.
(c) Verify that the stiffness matrix A and load vector b are given by
16 −9 0 0
1
A = −9 20 −11 , b = 0 .
2
0 −11 11 2
8. Consider the problem
−u00 = 1, x ∈ I = [0, 1],
(0.2)
u(0) = u(1) = 0.
(a) Choose a suitable finite element space Vh .
(b) Formulate a finite element method.
(c) Derive the discrete system of equations.
9. Solve the problem (0.3) numerically using MATLAB with a uniform mesh of n =
4, 8, 16, 32, 64, 128 and 256 subintervals, and compute the corresponding L2 and H 1 –norm
errors and verify the convergence rates.
−u00 + u = 1, x ∈ I = [0, 1],
(0.3)
u(0) = u(1) = 0.
10. Consider the model problem
−u00 + xu0 + u = f, x ∈ I = [0, L],
0
u(0) = u (L) = 0,
where > 0 is a constant. Prove that the solution satisfies
ku00 kL2 (I) ≤ kf kL2 (I) .
2
11. Consider the model problem
−u00 = f, x ∈ I = [0, L],
u(0) = u(L) = 0.
Its variational formulation reads: find u ∈ V0 such that
Z Z
0 0
u v dx = f v dx ∀v ∈ V0 .
I I
Show that the solution u ∈ V0 to the above variational formulation minimizes the func-
tional
Z Z
1 02
F (w) = w dx − f w dx,
2 I I
over the space V0 . Hint: Write w = u + v and show that F (w) = F (u) + · · · ≥ F (u).