Math, Python, Simulation, Heat Equation, Numerical Analysis.
before. for t in range(1, len(t_vec)-1): for x in range(1, len(x_vec)-1): u[t+1, x] = k * (dt / dx**2) * (u[t, x+1] - 2*u[t, x] + u[t, x-1]) + u[t, x] # Notice how this equation substitutes the dx and dt that appear # within the functions themselves with +1 or -1, this is because # while the theory