Docsity

Assignment # 4 Numerical Method - Partial Differential Equations | AMSC 612, Assignments of Mathematics

Toggle sidebar
bg1
AMSC 612 Fall 2008
NUMERICAL METHODS FOR PDE
HOMEWORK # 4
(Pbs 1-2 due Tu Nov 13, Pbs 2-6 due Th Nov 20)
1 (15 pts). Use the MATLAB code fem from the website morin.pedro.googlepages.com
to solve the following problem. Let Ω = [−1,1]2\[0,1] ×[0,−1] be an L-shaped domain.
Let u, given in polar coordinates (r, θ),
u(x, y) = r2/3sin(2θ/3)
be the exact solution of the Dirichlet boundary value problem −∆u=fin Ω.
(a) Generate the data files vertex−coordinates.txt,elem−vertices.txt,dirichlet.txt,
and neumann.txt using gen−mesh−L−shape.m for uniform refinement with meshsize
h=1
N= 2−kand k= 2,3,4,5,6,7. Find the corresponding solutions uh.
(b) Show that the stiffness matrices for these meshes and those for finite differences with
a 5-point stencil coincide.
(c) Find the errors |u−uh|H1
0(Ω) and ku−uhkL2(Ω), and plot them in a log-log plot. Deter-
mine the experimental order of convergence and comprae with theory. Draw conclusions.
2 (20 pts). Consider the following second order initial value problem modeling a spring-
dashpot system:
y00 + 101y+ 100y= sin x, y(0) = 2, y0(0) = 0.(1)
(a) Solve this problem by hand. To this end find first the solution to the homogeneous
equation (natural modes), and next a particular solution using the method of undeter-
mined coefficients. Explain whether the problem is stiff or not.
(b) Convert (1) into a first order system, and write the forward Euler (FE), backward
Euler (BE) and Trapezoid methods (TM).
(c) Write MATLAB programs that implement FE, BE, and TM with step-sizes h= 10−k
for k= 1,2,3 on the interval (0,10).
(d) Find the error between computed solutions of (c) and exact solution of (a) at tn=nh
and plot the results. Explain the results in terms of `∞-stability, and draw conclusions.
3 (15 pts). Problem 8.5 of Larsson and Thom´ee.
4 (15 pts). Problem 8.7 of Larsson and Thom´ee.
5 (15 pts). Problem 9.4 of Larsson and Thom´ee. To derive the 5-point stencil proceed as
follows. Suppose that u∈C6and show an error estimate for u00(0) −D2
h(0) where
D2
h(0) = h−2u(−h)−2u(0) + u(h),
is the usual 3-point stencil; keep all terms in the error expression up to order 4. Combine
now D2
h(0) with D2
2h(0) in order to eliminate the leading error term of order 2. This
process is called extrapolation.
pf2

Partial preview of the text

Download Assignment # 4 Numerical Method - Partial Differential Equations | AMSC 612 and more Assignments Mathematics in PDF only on Docsity!

AMSC 612 Fall 2008 NUMERICAL METHODS FOR PDE

HOMEWORK # 4 (Pbs 1-2 due Tu Nov 13, Pbs 2-6 due Th Nov 20)

1 (15 pts). Use the MATLAB code fem from the website morin.pedro.googlepages.com to solve the following problem. Let Ω = [− 1 , 1]^2 [0, 1] × [0, −1] be an L-shaped domain. Let u, given in polar coordinates (r, θ),

u(x, y) = r^2 /^3 sin(2θ/3)

be the exact solution of the Dirichlet boundary value problem −∆u = f in Ω. (a) Generate the data files vertex−coordinates.txt, elem−vertices.txt, dirichlet.txt, and neumann.txt using gen−mesh−L−shape.m for uniform refinement with meshsize h = (^) N^1 = 2−k^ and k = 2, 3 , 4 , 5 , 6 , 7. Find the corresponding solutions uh. (b) Show that the stiffness matrices for these meshes and those for finite differences with a 5-point stencil coincide. (c) Find the errors |u − uh|H 01 (Ω) and ‖u − uh‖L (^2) (Ω), and plot them in a log-log plot. Deter- mine the experimental order of convergence and comprae with theory. Draw conclusions.

2 (20 pts). Consider the following second order initial value problem modeling a spring- dashpot system:

y′′^ + 101y + 100y = sin x, y(0) = 2, y′(0) = 0. (1)

(a) Solve this problem by hand. To this end find first the solution to the homogeneous equation (natural modes), and next a particular solution using the method of undeter- mined coefficients. Explain whether the problem is stiff or not. (b) Convert (1) into a first order system, and write the forward Euler (FE), backward Euler (BE) and Trapezoid methods (TM). (c) Write MATLAB programs that implement FE, BE, and TM with step-sizes h = 10−k for k = 1, 2 , 3 on the interval (0, 10). (d) Find the error between computed solutions of (c) and exact solution of (a) at tn = nh and plot the results. Explain the results in terms of `∞-stability, and draw conclusions.

3 (15 pts). Problem 8.5 of Larsson and Thom´ee.

4 (15 pts). Problem 8.7 of Larsson and Thom´ee.

5 (15 pts). Problem 9.4 of Larsson and Thom´ee. To derive the 5-point stencil proceed as follows. Suppose that u ∈ C^6 and show an error estimate for u′′(0) − D^2 h(0) where

D^2 h(0) = h−^2

u(−h) − 2 u(0) + u(h)

is the usual 3-point stencil; keep all terms in the error expression up to order 4. Combine now D h^2 (0) with D 22 h(0) in order to eliminate the leading error term of order 2. This process is called extrapolation.

6 (20 pts). Problem 9.11 of Larsson and Thom´ee in Ω = (− 1 , 1). To this end (a) Combine Problems 4 of HW#1 and 2 of HW#4 to implement the forward Euler (FE),

backward Euler (BE) and Crank-Nicolson methods (CN) for (9.19) with initial value v(x) and boundary value g(x, t) given by

v(x) = sin(πx) − sin(3πx), g(± 1 , t) = 0, v(x) = sign(x), g(x, t) = erf(± 1 /

4 t);

erf is the solution of the heat equation in the whole line with initial condition sign(x). (b) Let h = 1/10. Compute the discrete solution with k = 1/ 100 , 1 / 300 , 1 /600 for FE and BE and with k = 1/10 for CN. (c) Find the exact solutions and compute the errors at (0. 5 , 1). Draw conclusions.