Jacobi's algorithm extended to the diffusion equation in two dimensions, discretizing
We discretize again position and time, and use the following approximation for the second derivatives
\begin{equation*}
u_{xx}\approx \frac{u(x+h,y,t)-2u(x,y,t)+u(x-h,y,t)}{h^2},
\end{equation*}
which we rewrite as, in its discretized version,
\begin{equation*}
u_{xx}\approx \frac{u^{l}_{i+1,j}-2u^{l}_{i,j}+u^{l}_{i-1,j}}{h^2},
\end{equation*}
where
x_i=x_0+ih ,
y_j=y_0+jh and
t_l=t_0+l\Delta t , with
h=L/(n+1) and
\Delta t the time step.