Explict scheme for the diffusion equation in two dimensions
We have defined our domain to start
x(y)=0 and end at
X(y)=L.
The second derivative with respect to
y reads
uyy≈uli,j+1−2uli,j+uli,j−1h2.
We use again the so-called forward-going Euler formula for the first derivative in time. In its discretized form we have
ut≈ul+1i,j−uli,jΔt,
resulting in
ul+1i,j=uli,j+α[uli+1,j+uli−1,j+uli,j+1+uli,j−1−4uli,j],
where the left hand side, with the solution at the new time step, is the only unknown term, since starting with
t=t0, the right hand side is entirely
determined by the boundary and initial conditions. We have
α=Δt/h2.
This scheme can be implemented using essentially the same approach as we used in Eq.
(7).