Compute the Exact Eigenmodes of the Heat Equation
Specify a heat equation with homogeneous Dirichlet boundary conditions.
In[1]:=
![Click for copyable input](assets.en/compute-the-exact-eigenmodes-of-the-heat-equation/In_124.png)
{\[ScriptCapitalL], \[ScriptCapitalB]} = {D[u[t, x], t] ==
Laplacian[u[t, x], {x}], DirichletCondition[u[t, x] == 0, True]};
Find the four smallest eigenvalues and eigenfunctions.
In[2]:=
![Click for copyable input](assets.en/compute-the-exact-eigenmodes-of-the-heat-equation/In_125.png)
{vals, funs} =
DEigensystem[{\[ScriptCapitalL], \[ScriptCapitalB]}, u[t, x],
t, {x, 0, \[Pi]}, 4]
Out[2]=
![](assets.en/compute-the-exact-eigenmodes-of-the-heat-equation/O_61.png)
Visualize the eigenfunctions.
In[3]:=
![Click for copyable input](assets.en/compute-the-exact-eigenmodes-of-the-heat-equation/In_126.png)
Table[Plot3D[funs[[i]] // Evaluate, {x, -3, 3}, {t, 0, 1/3},
PlotRange -> All, Ticks -> False, Mesh -> False], {i, 4}]
Out[3]=
![](assets.en/compute-the-exact-eigenmodes-of-the-heat-equation/O_62.png)