<div dir="ltr">Hi Jose,<div><br></div><div>I'm interested to know more about this comment from your email below:</div><div>"You can also try the symmetric-indefinite solver, but this is not recommended since it is not numerically stable."<br></div><div><div class="gmail_extra"><div class="gmail_quote"><br></div><div class="gmail_quote">I frequently use SLEPc's symmetric-indefinite solver for buckling eigenvalue problems (which are naturally symmetric and indefinite), and this works well in my experience. But, based on your comment, I was wondering if you would recommend a different solver for this case?</div><div class="gmail_quote"><br></div><div class="gmail_quote">Thanks,</div><div class="gmail_quote">David</div><div class="gmail_quote"><br></div><div class="gmail_quote"><br></div><div class="gmail_quote"><br></div><div class="gmail_quote">On Mon, Apr 4, 2016 at 12:18 PM, Jose E. Roman <span dir="ltr"><<a href="mailto:jroman@dsic.upv.es" target="_blank">jroman@dsic.upv.es</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><br>
> El 4 abr 2016, a las 18:06, Manav Bhatia <<a href="mailto:bhatiamanav@gmail.com" target="_blank">bhatiamanav@gmail.com</a>> escribió:<br>
><br>
> Hi Jose,<br>
><br>
> I also read these matrices into matlab and found the eigenvalues as<br>
><br>
> >>A = PetscBinaryRead('A.petsc’);<br>
> >>B = PetscBinaryRead(‘B.petsc’);<br>
> >> [v,d] = eigs(A,B)<br>
> (*** got a lot of output about poor-conditioning ***)<br>
> >> diag(d)<br>
><br>
> ans =<br>
><br>
> 1.0e-05 *<br>
><br>
> -0.2219<br>
> 0.0229<br>
> 0.0229<br>
> 0.0025<br>
> 0.0019<br>
> 0.0014<br>
><br>
> >> So, one of these is turning out to be negative, but I am still getting numbers.<br>
><br>
><br>
><br>
> Using these matrices with ex7 produces an error:<br>
><br>
> Dhcp-90-243:T_400_V_0 manav$ /Users/manav/Documents/codes/numerical_lib/slepc/slepc-3.6.2/src/eps/examples/tutorials/ex7 -f1 A.petsc -f2 B.petsc -eps_gen_hermitian -eps_view -eps_nev 1<br>
><br>
> Generalized eigenproblem stored in file.<br>
><br>
> Reading REAL matrices from binary files...<br>
> [0]PETSC ERROR: --------------------- Error Message --------------------------------------------------------------<br>
> [0]PETSC ERROR: Error in external library<br>
> [0]PETSC ERROR: Error in Lapack xSTEQR 15<br>
> [0]PETSC ERROR: See <a href="http://www.mcs.anl.gov/petsc/documentation/faq.html" rel="noreferrer" target="_blank">http://www.mcs.anl.gov/petsc/documentation/faq.html</a> for trouble shooting.<br>
> [0]PETSC ERROR: Petsc Release Version 3.6.3, Dec, 03, 2015<br>
> [0]PETSC ERROR: /Users/manav/Documents/codes/numerical_lib/slepc/slepc-3.6.2/src/eps/examples/tutorials/ex7 on a arch-darwin-cxx-opt named <a href="http://ws243-49.walker.dynamic.msstate.edu" rel="noreferrer" target="_blank">ws243-49.walker.dynamic.msstate.edu</a> by manav Mon Apr 4 11:05:30 2016<br>
> [0]PETSC ERROR: Configure options --prefix=/Users/manav/Documents/codes/numerical_lib/petsc/petsc-3.6.3/../ --CC=mpicc --CXX=mpicxx --FC=mpif90 --with-clanguage=c++ --with-fortran=0 --with-mpiexec=/opt/local/bin/mpiexec --with-shared-libraries=1 --with-x=1 --with-x-dir=/opt/X11 --with-debugging=0 --with-lapack-lib=/usr/lib/liblapack.dylib --with-blas-lib=/usr/lib/libblas.dylib --download-superlu=yes --download-superlu_dist=yes --download-suitesparse=yes --download-mumps=yes --download-scalapack=yes --download-parmetis=yes --download-parmetis-shared=1 --download-metis=yes --download-metis-shared=1 --download-hypre=yes --download-hypre-shared=1 --download-ml=yes --download-ml-shared=1 --download-sundials=yes --download-sundials-shared=1<br>
> [0]PETSC ERROR: #1 DSSolve_HEP_QR() line 495 in /Users/manav/Documents/codes/numerical_lib/slepc/slepc-3.6.2/src/sys/classes/ds/impls/hep/dshep.c<br>
> [0]PETSC ERROR: #2 DSSolve() line 543 in /Users/manav/Documents/codes/numerical_lib/slepc/slepc-3.6.2/src/sys/classes/ds/interface/dsops.c<br>
> [0]PETSC ERROR: #3 EPSSolve_KrylovSchur_Symm() line 68 in /Users/manav/Documents/codes/numerical_lib/slepc/slepc-3.6.2/src/eps/impls/krylov/krylovschur/ks-symm.c<br>
> [0]PETSC ERROR: #4 EPSSolve() line 101 in /Users/manav/Documents/codes/numerical_lib/slepc/slepc-3.6.2/src/eps/interface/epssolve.c<br>
> [0]PETSC ERROR: #5 main() line 147 in /Users/manav/Documents/codes/numerical_lib/slepc/slepc-3.6.2/src/eps/examples/tutorials/ex7.c<br>
> [0]PETSC ERROR: PETSc Option Table entries:<br>
> [0]PETSC ERROR: -eps_gen_hermitian<br>
> [0]PETSC ERROR: -eps_nev 1<br>
> [0]PETSC ERROR: -eps_view<br>
> [0]PETSC ERROR: -f1 A.petsc<br>
> [0]PETSC ERROR: -f2 B.petsc<br>
> [0]PETSC ERROR: -matload_block_size 1<br>
> [0]PETSC ERROR: ----------------End of Error Message -------send entire error message to petsc-maint@mcs.anl.gov----------<br>
> --------------------------------------------------------------------------<br>
> MPI_ABORT was invoked on rank 0 in communicator MPI_COMM_WORLD<br>
> with errorcode 76.<br>
><br>
> NOTE: invoking MPI_ABORT causes Open MPI to kill all MPI processes.<br>
> You may or may not see output from other processes, depending on<br>
> exactly when Open MPI kills them.<br>
> --------------------------------------------------------------------------<br>
><br>
<br>
The problem is that now K is indefinite. The check for indefinite B-matrix was not done correctly. This is fixed in 3.6.3, where you should get a more informative error:<br>
<br>
[0]PETSC ERROR: The inner product is not well defined: indefinite matrix<br>
<br>
When considered as a non-symmetric problem, the solver returns reasonable output:<br>
<br>
$ ./ex7 -f1 ~/tmp/bhatia/A.petsc -f2 ~/tmp/bhatia/B.petsc<br>
<br>
Generalized eigenproblem stored in file.<br>
<br>
Reading REAL matrices from binary files...<br>
Number of iterations of the method: 1<br>
Number of linear iterations of the method: 16<br>
Solution method: krylovschur<br>
<br>
Number of requested eigenvalues: 1<br>
Stopping condition: tol=1e-08, maxit=768<br>
Linear eigensolve converged (6 eigenpairs) due to CONVERGED_TOL; iterations 1<br>
---------------------- --------------------<br>
k ||Ax-kBx||/||kx||<br>
---------------------- --------------------<br>
-22.185956 8.66397e-08<br>
2.291422 1.32466e-07<br>
2.291422 1.55081e-07<br>
0.252494 8.88997e-05<br>
0.192453 0.000780395<br>
0.141618 0.00113141<br>
---------------------- --------------------<br>
<br>
The large residuals are due to bad scaling/conditioning of your matrices. You can also try the symmetric-indefinite solver, but this is not recommended since it is not numerically stable.<br>
<br>
$ ./ex7 -f1 ~/tmp/bhatia/A.petsc -f2 ~/tmp/bhatia/B.petsc -eps_gen_indefinite<br>
<br>
Generalized eigenproblem stored in file.<br>
<br>
Reading REAL matrices from binary files...<br>
Number of iterations of the method: 1<br>
Number of linear iterations of the method: 17<br>
Solution method: krylovschur<br>
<br>
Number of requested eigenvalues: 1<br>
Stopping condition: tol=1e-08, maxit=768<br>
Linear eigensolve converged (6 eigenpairs) due to CONVERGED_TOL; iterations 1<br>
---------------------- --------------------<br>
k ||Ax-kBx||/||kx||<br>
---------------------- --------------------<br>
-22.185956 7.08858e-09<br>
2.291422 5.87577e-09<br>
2.291422 6.39304e-09<br>
0.252494 1.7497e-07<br>
0.192453 1.63916e-06<br>
0.141618 1.75568e-06<br>
---------------------- --------------------<br>
<br>
<br>
Jose<br>
<br>
<br>
</blockquote></div><br></div></div></div>