Some linear systems may be ill-conditioned and probably PETSc's LU is having a hard time with them. I would suggest installing PETSc with --download-mumps and run with MUMPS as the linear solver, without the st_pc_factor_shift* options. See section 3.4.1 of SLEPc's manual.
Let us know if this helps. Jose > El 6 mar 2018, a las 23:32, Habib <abuabib2...@yahoo.com> escribió: > > Hi Everyone, > I hope this is the right medium to post my question as it is related to > slepc4py. > I have just installed slepc4py with complex scaler and I intend to use it to > solve large sparse generalised eigenvalue problems that result from the > stability of flows that can be described by linearised Navier-Stokes > equations. For my problem, Ax = kBx, matrices A and B are non-Hermitian, B, > in particular, is singular and I am interested in eigenvalue with maximum > real part which could be positive if the flow is unstable or negative for a > stable flow. Following the steps described in exp1.py, I wrote a code for > Non-Hermitian Generalised Eigenvalue problem. I test the code on a problem > that is stable and with known solution using Shift and Invert transformation > with complex shift value and the solution seems okay but I have the following > concerns that I would be grateful if you could clarify on. > > (1) If I used a shift value that is close to the solution (which I already > know for this test problem), the code converge at the correct eigenvalue but > the computed relative error is very large. I was wondering why the error is > large and the implication on my eigenvectors. How can this be corrected? > Below is a typical command line option I entered and the results I got from > solution: > > python ComputeEigenValueUsingSlepc4Python.py -eps_nev 1 -eps_tol 1e-10 > -st_type sinvert -eps_target -105.01+252.02i -eps_converged_reason > -eps_conv_abs -st_pc_factor_shift_type NONZERO -st_pc_factor_shift_amount > 1e-10. > > *** SLEPc Solution Results *** > > Number of iterations of the method: 1 > Solution method: krylovschur > Number of requested eigenvalues: 1 > Stopping condition: tol=1e-10, maxit=23923 > Number of converged eigenpairs 1 > > k ||Ax-kx||/||kx|| > ----------------- ------------------ > -106.296653+251.756509 j 3.64763e+11 > > (2) Since my goal is to use the code to test the stability of flows in which > I have no idea of what the maximum eigenvalue would be, I tried solving the > problem I stated in 1 with different target values that are not close to the > eigenvalue, but it was not successful. The code kept running for a very long > time that I had to cancel it. With a target value of zero, I had convergence > in finite time but to a spurious-like eigenvalue. Any suggestion on how I > could go about getting the true eigenvalue for my main problem for which I > have no idea of what a close target value to the maximum value would be and > considering that matrix B is singular? > > Looking forward to your suggestions. > > Regards, > Habib > Department of Chemical Engineering, > Ahmadu Bello University, Zaria > Samaru Campus, > Kaduna State, Nigeria >