Calculating eigenvalues and eigenfunctions ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In the previous example, we have found stationary solutions, but we could not obtain the stability of these solutions. To explicitly calculate the eigenvalues, we can use the method :py:meth:`~pyoomph.generic.problem.Problem.solve_eigenproblem` of the problem class, which requires the number of eigenvalues we want to calculate. Here, there is just one degree of freedom, namely :math:`x`, so we should only aim for a single eigenvalue. The method will return a list of eigenvalues (complex numbers) and a list of the corresponding eigenvectors. Of course, using :py:meth:`~pyoomph.generic.problem.Problem.solve_eigenproblem` is only meaningful if the problem is currently on a stationary solution. The rest is more or less the same as the previous code, i.e. first importing the problem and equation from the previous example :download:`bifurcation_transient_transcritical.py` and then using :py:meth:`~pyoomph.generic.problem.Problem.solve_eigenproblem` after finding the stationary solutions via the :py:meth:`~pyoomph.generic.problem.Problem.solve` call. .. literalinclude:: bifurcation_eigenvalues_transcritical.py :language: python :start-at: from bifurcation_transient_transcritical import * #Import the equation and problem from the previous script :end-at: print("Thus, this solution is "+("unstable" if eigen_vals[0].real>0 else "stable")) .. only:: html .. container:: downloadbutton :download:`Download this example ` :download:`Download all examples <../../tutorial_example_scripts.zip>`