I a computing the eigenvalues and eigenfunctions of a Laplacian on a unit square. I have written it as follows:
{ℒ, ℬ} = {-Laplacian[u[x, y], {x, y}],DirichletCondition[u[x, y] == 0, True]};
{vals, funs} = DEigensystem[{ℒ, ℬ}, u[x, y], {x, 0, 1}, {y, 0, 1}, 8];
vals
Therefore, I have received the list of first $8$ eigenvalues, that is:
$\qquad \{2\pi^2,\, 5\pi^2,\, 5\pi^2,\, 8\pi^2,\, 10\pi^2,\, 10\pi^2,\, 10\pi^2,\, 10\pi^2 \}$.
Now I want to use Tally
to find the multiplicity of a specific eigenvalue (for example, take the eigenvalue $5\pi^2$). I have no idea how to use Tally
within the code written above. Please help me. I have read the reference here, but I have no idea how to use it in my case.
Please help me.
Counts
andCountsBy
are more useful functions thanTally
.Tally
is a bit of a relic of the past. $\endgroup$