︠eaec9b65-76fa-46fb-bcce-6b13ad79d0b3i︠ %html
Portland State University
For a metal rod of unit length, placed (for mathematical convenience) on the real interval $[0,\pi]$, let $u(x,t)$ denote the temperature of the rod at the cross-section $x$ units from the origin at time $t$ (we assume the temperature to be constant on each cross-section of the rod. Then the function $u$ is known to obey the Heat Equation: $u_t = ku_{xx}$, where $k$ is a positive constant that is a property of the material used to form the rod.
Suppose, for simplicity, that $k=1$, and we have these initial-boundary conditions:
(1) the ends of the rod are held at constant temperature zero for all time: $u(0,t)=u(1,t)=0$ for all $t \ge 0$, and
(2) the initial temperature of the rest of the rod is 1, i.e., $u(x,0) \equiv 1$ on $(0,\pi)$.
Then the solution to our our initial-boundary problem, consisting of the heat equation $u_t = u_{xx}$, along with boundary condition (1) and initial condition (2), is given by the series below: $$ (*)~~~~~ {\displaystyle u(x,t) = \sum_{k=0}^\infty e^{-(2k+1)^2 t}~\frac{\sin((2k+1)x)}{2k+1}} $$
To see that this series really does solve our initial-boundary problem for the heat equation, note that formal term-by-term differentiation (justified by the exponential decay of the time-dependent terms) shows that $u$ satisfies the heat equation, while the substitution $x=0$ and $x=\pi$ show that (1) is satisfied. As for (2): the series for $t=0$ is the Fourier sine series for the function $f\equiv 1$ over the interval $[0,\pi]$. See [1, Sec. 1.8.3-1.8.4, pp. 63--70], [2, Sec. 18.10, especially pp. 999--1004], or [3] for more details, and to learn how to discover this formula for $u(x,t)$.
We'll define here a function
SAGE commands featured here:
Portland State University
\r\nFor a metal rod of unit length, placed (for mathematical convenience) on the real interval $[0,\\pi]$, let $u(x,t)$ denote the temperature of the rod at the cross-section $x$ units from the origin at time $t$ (we assume the temperature to be constant on each cross-section of the rod. Then the function $u$ is known to obey the Heat Equation: $u_t = ku_{xx}$, where $k$ is a positive constant that is a property of the material used to form the rod.\r\n
\r\nSuppose, for simplicity, that $k=1$, and we have these initial-boundary conditions:
\r\n\r\n (1) the ends of the rod are held at constant temperature zero for all time: $u(0,t)=u(1,t)=0$ for all $t \\ge 0$, and
\r\n\r\n (2) the initial temperature of the rest of the rod is 1, i.e., $u(x,0) \\equiv 1$ on $(0,\\pi)$.
\r\nThen the solution to our our initial-boundary problem, consisting of the heat equation $u_t = u_{xx}$, along with boundary condition (1) and initial condition (2), is given by the series below: \r\n$$ (*)~~~~~ {\\displaystyle u(x,t) = \\sum_{k=0}^\\infty e^{-(2k+1)^2 t}~\\frac{\\sin((2k+1)x)}{2k+1}} $$\r\n
\r\n\r\nTo see that this series really does solve our initial-boundary problem for the heat equation, note that formal term-by-term differentiation (justified by the exponential decay of the time-dependent terms) shows that $u$ satisfies the heat equation, while the substitution $x=0$ and $x=\\pi$ show that (1) is satisfied. As for (2): the series for $t=0$ is the Fourier sine series for the function $f\\equiv 1$ over the interval $[0,\\pi]$. See [1, Sec. 1.8.3-1.8.4, pp. 63--70], [2, Sec. 18.10, especially pp. 999--1004], or [3] for more details, and to learn how to discover this formula for $u(x,t)$. \r\n
\r\n\r\n\r\n
We'll define here a function
SAGE commands featured here:
Here is the sum of the first five terms of the series (*)
︡895b8714-60a0-4bdd-b5de-c79d8c5ea022︡{"html": "\r\nHere is the sum of the first five terms of the series (*)\r\n
"}︡ ︠976ecec3-cec4-4d71-96b0-a7141d4fee19︠ var('t') u(x,t,5).show() #Sum of first five terms. ︡5958fc04-bc64-46df-8b7b-512040ac36eb︡{"html": "For $t = 0$ the infinite series (*) is the Fourier sine series of the function identically 1 on the interval $(0,\pi)$. We superimpose the graph of this function (in red) on a plot of the sum of the first 25 terms of that sine series.
︡477524e8-56cd-4cde-85c3-824100099460︡{"html": "For $t = 0$ the infinite series (*) is the Fourier sine series of the function identically 1 on the interval $(0,\\pi)$. We superimpose the graph of this function (in red) on a plot of the sum of the first 25 terms of that sine series.\r\n
"}︡ ︠49fb32d5-0105-4d5a-9f49-1c1a90480b03︠ fs = u(x,0,25) #Plot of fs approx. to initial function init_temp = x^0 #The init. temp distn u(x,0) = 1 Pfs = fs.plot((0,pi+.1)) #Plot fs partial sum in blue one = init_temp.plot((0,pi),rgbcolor=[1,0,0]) #Plot init temp in red (Pfs+one).show(xmin=-.1, xmax=pi+.1, ymin=0,figsize=[3,3]) #Show both plots on same set of axes ︡75bf3dee-64ca-4de7-8410-a029f60c394b︡{"html": "
Now we define a function $P$ that maps the $n$-th partial sum of (*) to a graphics object having $t$ as parameter (i.e., $P:[0,\infty)\times\{{\rm Natural~numbers}\}\rightarrow \{\rm Graphics~objects\}$). The
\r\nNow we define a function $P$ that maps the $n$-th partial sum of (*) to a graphics object having $t$ as parameter (i.e., $P:[0,\\infty)\\times\\{{\\rm Natural~numbers}\\}\\rightarrow \\{\\rm Graphics~objects\\}$). The
Next we plot, for t=.01, .5, 1,2,and 3, the 25th partial sum of series for $u(x,t)$. Compare the plot for $t=.01$ with the one above for $t=0$, noting how effectively the exponential "multiplier" smooths out the partial sum.
︡0e138e19-3423-4f99-bfa9-eb205fa4e9cb︡{"html": "\r\nNext we plot, for t=.01, .5, 1,2,and 3, the 25th partial sum of series for $u(x,t)$. Compare the plot for $t=.01$ with the one above for $t=0$, noting how effectively the exponential \"multiplier\" smooths out the partial sum.\r\n
"}︡ ︠c8155695-240d-4895-902b-6d8d0bf95733︠ show(P(.01,25)+P(.5,25)+P(1,25)+P(2,25)+P(3,25),ymin=0,ymax=1) ︡2ac77580-c1fc-4749-bc4f-41e11bb1b32a︡{"html": "@interact
Here's an animation inspired by a Maple program written by Paul Bourdon. We represent the rod by 100 large dots on the $x$-axis, and the temperature $u(x,t)$ of (the center of) each dot by a color, ranging from red (hot) to white(cold). The distribution of colors at time t represents $u(x,t)$. The animation shows the temperature at each point cooling from the initial temperature 1 toward zero as $t\rightarrow\infty$.
The first step is to define the function
@interact
Here's an animation inspired by a Maple program written by Paul Bourdon. We represent the rod by 100 large dots on the $x$-axis, and the temperature $u(x,t)$ of (the center of) each dot by a color, ranging from red (hot) to white(cold). The distribution of colors at time t represents $u(x,t)$. The animation shows the temperature at each point cooling from the initial temperature 1 toward zero as $t\\rightarrow\\infty$. \r\n
\r\n\r\n\r\nThe first step is to define the function
︡8947b66b-641e-4586-aeb2-e26c042ba6c7︡{"html": "
"}︡ ︠73e74360-277a-47b0-bb7b-2acae54104d6︠ #"continuous" parameter t set automatically for 50 equally spaced values in interval [.02,5] @interact def _(t=(0.02,5)): show(cool(t,25), axes=false) ︡2a75c079-78ce-442e-9cff-8ecf91e41667︡︡ ︠543b92f2-d43e-40da-a1f2-6718d37e90d4i︠ %html
[1] H. Dym and H.P. McKean, Fourier Series and Integrals, Academic Press 1972.
[2] A. Jeffrey, Advanced Engineering Mathematics, Harcourt/Academic Press 2002.
[3] Weisstein, Eric W. Heat Conduction Equation. From MathWorld--A Wolfram Web Resource. http://mathworld.wolfram.com/HeatConductionEquation.html
︡b3b18c9a-67d5-44ee-aa9c-b1b3b69f7cfd︡{"html": "\r\n[1] H. Dym and H.P. McKean, Fourier Series and Integrals, Academic Press 1972.\r\n
\r\n\r\n[2] A. Jeffrey, Advanced Engineering Mathematics, Harcourt/Academic Press 2002.\r\n
\r\n\r\n[3] Weisstein, Eric W. Heat Conduction Equation. From MathWorld--A Wolfram Web Resource. \r\n\r\nhttp://mathworld.wolfram.com/HeatConductionEquation.html \r\n
"}︡