Computational Physics, Physics, Heat Equation, Python, Math.
create the function to animate the solution. def animate(k): plotheatmap(u[k], k) anim = animation.FuncAnimation(plt.figure(), animate, interval=1, frames=max_iter_time, repeat=False) anim.save("heat_equation_solution.gif") Now, we’re done! Let’s see the complete code below and run it. import numpy