In this Matlab exercise sheet, we consider the heat equation of the form:
∂u/∂t = D(∂^2u/∂x^2)
u(x,0) = u_b(x), u(0,t) = f(x)
where D > 0. We will use the backward difference code BD_heat to solve the heat equation with the following initial conditions. In each case, choose k in a way that would result in the instability of the forward difference scheme:
1. L = 4, N = 40, a = 0, f = u_0 = sin(x)
2. a = -10, b = 10, h = 0.25, f = u_0 = sech(x)
Write a Matlab code to compute the Backward difference scheme.