title: can i solve a non-linear eigen value problem with fsolve in python?
body: <p>i have a an eigenvalue problem of non linear type</p>
  
  <p><code>c_0 + lambda*c_1 + lambda^2*c_2 + c_3*lambda^3=0</code></p>
  
  <p>i've been trying by inversing the matrix of coefficients c, but is a singular matrix, it will create complex values. somebody sujeted me that i can solve it with function fsolve(), i'm  looking for a function in python that works like polyeig in matlab. "c" coefficients are square matrix each one. The idea is to recive as a result the eigenvalues and eigenvectors at the end of the operation</p>
  
  <p><strong>EDIT</strong></p>
  
  <pre><code>c1=np.zeros([Np_t,Np_t])
  c2=np.zeros([Np_t,Np_t])
  c3=np.zeros([Np_t,Np_t])
  for i in range(Np_t):
   c0[i][:] = d2[i][:]*w + d1[i][:]*w/r[i] + (rho_0*M_o**2*w**3)*Ii[i][:] - (m**2/r[i]**2)*w*Ii[i][:]
   c1[i][:] = -rho_0*(M_o**2)*2*w**2*u_z0*Ii[i][:] - d2[i][:]*u_z0 - d1[i][:]*u_z0/r[i] - u_z0*rho_0*M_o**2*w**2*Ii[i][:] + d1[i][:]*2*du[i] + (m**2/r[i]**2)*u_z0*Ii[i][:]
   c2[i][:] = w*rho_0*M_o**2*u_z0**2*Ii[i][:] - w*Ii[i][:] + rho_0*M_o**2*2*w*u_z0**2*Ii[i][:] 
   c3[i][:] = rho_0*M_o**2*u_z0**3*Ii[i][:] + u_z0*Ii[i][:]
  
  
  #%% Conditions aux limites
  
  
  c0[0][:]=0
  c1[0][:]=0
  c2[0][:]=0
  c3[0][:]=0
  c0[Np_t-1][:]=0
  c1[Np_t-1][:]=0
  c2[Np_t-1][:]=0
  c3[Np_t-1][:]=0
  
  #conditions à rmax
  
  c0[Np_t-1][Np_t-3]= (dr[Np_t-1]/dr[Np_t-2]*(dr[Np_t-1]+dr[Np_t-2]))
  c0[Np_t-1][Np_t-2]= -(dr[Np_t-1]+dr[Np_t-2])/(dr[Np_t-2]*dr[Np_t-1]) 
  c0[Np_t-1][Np_t-1]= (dr[Np_t-1]+dr[Np_t-2])/(dr[Np_t-2]*dr[Np_t-1]) - (dr[Np_t-1]/(dr[Np_t-2]*(dr[Np_t-1]+dr[Np_t-2])))
  
  if m == 0:
   c0[0][0] = (-3/2)/dr[1]
   c0[0][1] = 2/dr[1]
   c0[0][2] = (-1/2)/dr[1]
  else:
   c0[0][0] = 1
   c0[0][0] = 0
   c0[0][0] = 0
  
  #from scipy.optimize import fsolve
  
  #[X,Y] = sc.optimize.fsolve(c0,c1,c2,c3)
  
  #A11 = np.zeros([Np_t,Np_t])
  #A12 = Ii
  #A13 = np.zeros([Np_t,Np_t])
  #A21 = np.zeros([Np_t,Np_t])
  #A22 = np.zeros([Np_t,Np_t])
  #A23 = Ii
  #A31 = np.nan_to_num(-np.linalg.inv(c3)*c0)
  #A32 = np.nan_to_num(-np.linalg.inv(c3)/c1)
  #A33 = np.nan_to_num(-np.linalg.inv(c3)/c2)
  #
  #A = ([[A11,A12,A13],[A21,A22,A23],[A31,A32,A33]])
  # 
  #
  #[vp,vcp]=np.linalg.eig(A)
  #
  #real = np.real(vcp)
  #img = np.imag(vcp)````
  </code></pre>