[petsc-users] qep results different from polyeig in matlab

Jose E. Roman jroman at dsic.upv.es
Wed Sep 4 02:04:22 CDT 2013


El 04/09/2013, a las 06:42, 张伟 escribió:

> Hello 
> every one. I am Wei. I want to use slepc to solver my quadratic eigenvalue problem. and now I start with the tutorial ex16 and compare with polyeig function matlab. but the two give different results.
> here is the results from slepc
> 
> Number of requested eigenvalues:  6
> Stopping condition: tol= 1e-08 , maxit= 100
> Number of converged approximate eigenpairs:  8
> 
>           k           ||(k^2M+Ck+K)x||/||kx|| 
> -------------------- -------------------------
> -7.85046229415e-16 + 2.81636155327 J, 3.31272023702e-09
> -7.85046229415e-16 + -2.81636155327 J, 3.31272023702e-09
> 6.28036983474e-16 + 2.79837285903 J, 2.31471998545e-09
> 6.28036983474e-16 + -2.79837285903 J, 2.31471998545e-09
> -5.4953236053e-16 + 2.78026777804 J, 6.1734628482e-10
> -5.4953236053e-16 + -2.78026777804 J, 6.1734628482e-10
> 7.85046229433e-17 + 2.76882293959 J, 8.38075971231e-10
> 7.85046229433e-17 + -2.76882293959 J, 8.38075971231e-10
> 
> and here is the results from polyeig in Matlab.
> tol =
> 
>  &nb sp;1.0000e-008
> 
> ee =
> 
>         0 + 2.4425i
>         0 - 2.4425i
>         0 + 2.4218i
>         0 - 2.4218i
>         0 + 2.3876i
>         0 - 2.3876i
>         0 + 2.3405i
>         0 - 2.3405i
>         0 + 2.2815i
>         0 - 2.2815i
>         0 + 2.2117i
>         0 - 2.2117i
>         0&nb sp;+ 2.1324i
>         0 - 2.1324i
>         0 + 2.0456i
>         0 - 2.0456i
>         0 + 1.4262i
>         0 - 1.4262i
>         0 + 1.4612i
>         0 - 1.4612i
>         0 + 1.5164i
>         0 - 1.5164i
>         0 + 1.5881i
>         0 - 1.5881i
>         0 + 1.9533i
>         0 - 1.9533i
>    & nbsp;    0 + 1.6717i
>         0 - 1.6717i
>         0 + 1.7631i
>         0 - 1.7631i
>         0 + 1.8581i
>         0 - 1.8581i  
> 
> it is different a lot especially for imagine part even if both converged to 1e-8. I tried both linear solver and qarnoldi method.   could any one tell me what is that? is it error?
> 
> ---------------------------------------
> 
> Wei zhang
> 
> PhD
> 

Please do not send a query to both petsc-users and slepc-maint, only to one of them.

I have checked the output of ex16 and quadeig and they match. Probably you are not solving exactly the same problem with polyeig as with SLEPc. Use the option
-mat_view ::ascii_matlab
in ex16 and paste the matrices in Matlab. [Note this option is for petsc-3.4, it is different in previous versions.]

Jose



More information about the petsc-users mailing list