Docsity

Numerical Methods for Partial Differential Equations (PDE) Homework 5 - Prof. Ricardo H. N, Assignments of Mathematics

Toggle sidebar
bg1
AMSC 612 Fall 2008
NUMERICAL METHODS FOR PDE
HOMEWORK # 5
due Fr 12/19
1 (25 pts). FEM for the Heat Equation: (a) Modify the MATLAB code fem of HW#4-
Pb1 by adding a loop 1 ≤n≤Nto account for a backward Euler discretization of the
time variable.
(b) Let Ω = (0,1)2and T= 1. Let a Neumann condition gNbe imposed on the side
x= 1, and a Dirichlet condition gDon the rest of the boundary ∂Ω. Let
u(x, y, t) = sin(3πx)e−y−2t.
be the exact solution. Find gDand the forcing f=∂t−∆u.
(c) Compute the discrete solution Uat T= 1, along with the L2,H1, and L∞errors. To
this end, use the relation k=h2between time-step and meshsize, and find the discrete
solution for meshsizes h= 2−jwith j= 3,4,5,6. Plot the discrete solution at T= 1
for h= 2−4and plot the three errors in terms of hin a log-log scale. Verify the decay
ku(T)−U(T)k ≈ hsand relate sto theory.
2 (25 pts). Lax-Wendroff Scheme: (a) Problem 12.2 of Larsson and Thom´ee.
(b) Show that the scheme in p.191 of Larsson and Thom´ee can be written as
Un+1
j−Un
j
k−aUn
j+1 −Un
j−1
2h−ka2
2
Un
j+1 −2Un
j+Un
j−1
h2= 0.
(c) Prove that the method is of second order by direct use of Taylor expansion.
3 (25 pts). (a) Consider the linear 1st order hyperbolic PDE ut+ux= 0.in the space
interval Ω = (−1,1) and time interval (0,0.5). Let the initial conditions be either
v(x) = max(1 −4|x+ 0.25|,0), v(x) = (1x≤ −0.25
0x > −0.25
and boundary conditions U0=v(−1) at x0=−1 (inflow) and Un
J=Un
J−1at xJ= 1
(outflow). Implement the following schemes for arbitrary k, h: (i) Upwind, (ii) Lax-
Friedrichs, (iii) Lax-Wendroff.
(b) Run the programs with k
h= 0.8 and h= 0.01,0.005,0.0025, and plot both the
computed and true solutions at t= 0.5.
(c) Compare the methods in terms of the smearing effect around corners and jumps and
the presence of oscillations.
4 (25 pts). Problem 13.3 of Larsson and Thom´ee. To compare with the method (13.5)
in Larsson and Thom´ee, consider the time-discrete scheme only (i.e. without space dis-
cretization).

Partial preview of the text

Download Numerical Methods for Partial Differential Equations (PDE) Homework 5 - Prof. Ricardo H. N and more Assignments Mathematics in PDF only on Docsity!

AMSC 612 Fall 2008 NUMERICAL METHODS FOR PDE

HOMEWORK # 5 due Fr 12/

1 (25 pts). FEM for the Heat Equation: (a) Modify the MATLAB code fem of HW#4- Pb1 by adding a loop 1 ≤ n ≤ N to account for a backward Euler discretization of the time variable. (b) Let Ω = (0, 1)^2 and T = 1. Let a Neumann condition gN be imposed on the side x = 1, and a Dirichlet condition gD on the rest of the boundary ∂Ω. Let

u(x, y, t) = sin(3πx)e−y−^2 t.

be the exact solution. Find gD and the forcing f = ∂t − ∆u. (c) Compute the discrete solution U at T = 1, along with the L^2 , H^1 , and L∞^ errors. To this end, use the relation k = h^2 between time-step and meshsize, and find the discrete solution for meshsizes h = 2−j^ with j = 3, 4 , 5 , 6. Plot the discrete solution at T = 1 for h = 2−^4 and plot the three errors in terms of h in a log-log scale. Verify the decay ‖u(T ) − U (T )‖ ≈ hs^ and relate s to theory.

2 (25 pts). Lax-Wendroff Scheme: (a) Problem 12.2 of Larsson and Thom´ee. (b) Show that the scheme in p.191 of Larsson and Thom´ee can be written as

U (^) jn +1− U (^) jn k

− a

U (^) jn+1 − U (^) jn− 1 2 h

ka^2 2

U (^) jn+1 − 2 U (^) jn + U (^) jn− 1 h^2

(c) Prove that the method is of second order by direct use of Taylor expansion.

3 (25 pts). (a) Consider the linear 1st order hyperbolic PDE ut + ux = 0. in the space interval Ω = (− 1 , 1) and time interval (0, 0 .5). Let the initial conditions be either

v(x) = max(1 − 4 |x + 0. 25 |, 0), v(x) =

1 x ≤ − 0. 25 0 x > − 0. 25

and boundary conditions U 0 = v(−1) at x 0 = −1 (inflow) and U (^) Jn = U (^) Jn− 1 at xJ = 1 (outflow). Implement the following schemes for arbitrary k, h: (i) Upwind, (ii) Lax- Friedrichs, (iii) Lax-Wendroff. (b) Run the programs with (^) hk = 0.8 and h = 0. 01 , 0. 005 , 0 .0025, and plot both the computed and true solutions at t = 0.5. (c) Compare the methods in terms of the smearing effect around corners and jumps and the presence of oscillations.

4 (25 pts). Problem 13.3 of Larsson and Thom´ee. To compare with the method (13.5) in Larsson and Thom´ee, consider the time-discrete scheme only (i.e. without space dis- cretization).