Heat equation

Consider a thin rod of length L with an initial temperature f(x) throughout and whose ends are held at temperature zero for all time t>0. The temperature u(x,t) in the rod is determined from the boundary-value problem: ut(x,t)=auxx(x,t), 0<x<L, t>0; u(0,t)=0, u(L,t)=0, t>0; u(x,0)=f(x), 0<x<L. In the following simulation, the temperature u(x,t) is graphed as a function of x for various times. Things to try:
  • Change the initial condition u(x,0)=f(x).
  • Increase n, the number of terms in the solution.
  • Change the length L.