The next is an applet that solves the Heat (time dependent) equation in 1-D : (d/dt)u-K*(d2/dxx)u = 0. The equation is solved using the finite difference method.
We want to solve the equation for two connected bars, each of length 5, and with different value for parameter K. We can model a class nambed Bar, and encapsulate the equation in it, then we will connect them, setting the left boundary conditions of the second bar as the temperature of the first bar at the right end, and the right boundary conditions for the first bar as the temperature at the left of the second bar. During simulation , we put a temperature of 10 degrees at the left end of the first bar, and at the right end of the second bar. Initially, the bars have a temperature of 0 degrees. The evolution of the first bar's temperature can be seen in the following simulation :
Last modified 22/12/99 by Juan de Lara ( Juan.Lara@ii.uam.es, http://www.ii.uam.es/~jlara) need help for using this courses?.