I have written a code to approximate the solution of the heat equation. I want to consider uniform partitions in order to approximate the solution of the given boundary / initial value problem.
So we partition $[a,b]$ in $N_x$ subintervals with length $h=\frac{b-a}{N_x}$, where the points $x_i, i=1, \dots ,N_x+1$, are given by the formula $x_i=a+(i-1)h$, and so we have $a=x_1<x_2< \dots <x_{N_x}<x_{N_{x+1}}=b$ and respectively we partition $[0,T_f]$ in $N_t$ subintervals of length $\tau=\frac{T_f-t_0}{N_t}$ and the points are $t_n=t_0+(n-1)\tau, n=1, \dots ,N_t+1$, so we have $t_0=t_1<t_2<…