Wolfram Language

Differential Eigensystems

Find a 1D Laplacian's Symbolic Eigenfunctions

Specify a 1D Laplacian operator.

In[1]:=
Click for copyable input
\[ScriptCapitalL] = -Laplacian[u[x], {x}];

Specify homogeneous Dirichlet boundary conditions for the eigenfunctions.

In[2]:=
Click for copyable input
\[ScriptCapitalB]1 = DirichletCondition[u[x] == 0, True];

Find the five smallest eigenvalues and eigenfunctions.

In[3]:=
Click for copyable input
{vals, funs} = DEigensystem[{\[ScriptCapitalL], \[ScriptCapitalB]1}, u[x], {x, 0, \[Pi]}, 5];

Inspect the eigenvalues.

In[4]:=
Click for copyable input
vals
Out[4]=

Inspect the eigenfunctions.

In[5]:=
Click for copyable input
funs
Out[5]=

Visualize the eigenfunctions.

In[6]:=
Click for copyable input
Plot[Evaluate[funs + 2 Range[5]], {x, 0, \[Pi]}]
Out[6]=

Specify a homogeneous Neumann boundary condition.

In[7]:=
Click for copyable input
\[ScriptCapitalB]2 = NeumannValue[0, True];

Find the five smallest eigenvalues and eigenfunctions.

In[8]:=
Click for copyable input
{vals, funs} = DEigensystem[\[ScriptCapitalL] + \[ScriptCapitalB]2, u[x], {x, 0, \[Pi]}, 5];

Inspect the eigenvalues. Relative to the Dirichlet conditions, a zero mode has been added.

In[9]:=
Click for copyable input
vals
Out[9]=

Sines have replaced cosines in the eigenfunctions.

In[10]:=
Click for copyable input
funs
Out[10]=

Visualize the eigenfunctions.

In[11]:=
Click for copyable input
Plot[Evaluate[funs + 2 Range[5]], {x, 0, \[Pi]}]
Out[11]=

Related Examples

de es fr ja ko pt-br ru zh