I want to find the equilibrium point of a differential equation and check whether the equilibrium point is stable.
Here's a minimal working example
import numpy as np
from scipy.optimize import fsolve
dim = 2
A = np.random.uniform(size = (dim,dim))
sol, infodict, ier, mesg = fsolve(lambda x: 1-np.dot(A,x),
np.ones(dim), full_output = True)
To find whether the solution sol is stable all the eigenvalues of the Jacobian must have negative real part. However the Jacobian is not saved in the infodict, rather the QR decomposition is saved in the infodict.
How do I get the Jacoian back from the QR decomposition of fsolve?
All I could do was something like
eigenvalues = np.linalg.eigvals(infodict["fjac"])*infodict["r"][ind]
Where ind are the diagonal entries of r, however I doubt this is the best possible way.