Numerical Partial Differential Equations I Homework 3
(Due: Dec. 27, 2006) Consider the parabolic partial differential equation
ut= auxx, 0 < x < 1, 0 < t < 1, u(0, t) = u(1, t) = 0, 0 < t < 1,
u(x, 0) = v(x), 0 < x < 1,
where a > 0. Recall that if v(x) = sin πlx, then the exact solution is u(x, t) = e−π2l2atsin πlx.
Consider uniform refinement, that is, for h = 1/N and k = 1/M , we let xj = jh and tn = nk.
Write a Matlab program to solve the equation with the finite difference schemes (12.5) and (12.6).
• For h = 0.05, k = 0.05, a = .1 and v(x) = sin πx, graph the results at t = 1. Which one is better? Give analytical reasons to support your computational results.
• Next, for h = 0.05, k = 0.05 and a = 2, graph the results for v(x) = sin 10πx at t = .05, .1, .5, 1.
Why are the results so poor? Would a different choice or r = hk2 improve the results?
• For v(x) = sin πx + sin 10πx and a = 1, suppose that we want a numerical solution whose relative error is about 10−4, how do you choose k and h for (12.5) and (12.6)? What if we want the error is about 10−6?