LAPACK error: info -5

조회 수: 4 (최근 30일)
Robert
Robert 2016년 7월 28일
댓글: Robert 2016년 8월 15일
Hi All,
I'm getting an error when running a Simulink model. I'm not sure what its from. As far as I know I'm not specifically calling out an use of LAPACK. Any insight into possible causes would be great!
Thanks
An error occurred while running the simulation and the simulation was terminated Caused by: The LAPACK call to 'LAPACKE_zgeev' failed with info -5. Please contact MathWorks Technical Support if you can reproduce this error.
  댓글 수: 3
James Tursa
James Tursa 2016년 7월 28일
Can you reproduce the error and have you contacted Technical Support?
Robert
Robert 2016년 7월 29일
편집: Robert 2016년 7월 29일
Thanks for the thoughtful response. Yes it can be reproduced and yes technical support was contacted. Wanted to see if anyone out here has seen anything close to this issue before (I've never heard of LAPACK until today) and could give any insight into what could possibly be causing it. Since I couldn't find any help through searching online, thought it would be helpful to others in the future if an answer is found.

댓글을 달려면 로그인하십시오.

채택된 답변

James Tursa
James Tursa 2016년 7월 29일
편집: James Tursa 2016년 7월 29일
BLAS and LAPACK are the math libraries that MATLAB uses for linear algebra. zgeev is the name of one of the routines in the LAPACK library. E.g., a description can be found on netlib.org (showing Fortran code although the actual libraries that MATLAB uses are likely highly optimized C/assembly using the same interface):
If you look at the comments for this routine, you see this for "info":
* INFO (output) INTEGER
* = 0: successful exit
* < 0: if INFO = -i, the i-th argument had an illegal value.
* > 0: if INFO = i, the QR algorithm failed to compute all the
* eigenvalues, and no eigenvectors have been computed;
* elements and i+1:N of W contain eigenvalues which have
* converged.
So it appears that the 5th argument had an illegal value. If you look at the signature and the code for generating the error you see this:
SUBROUTINE ZGEEV( JOBVL, JOBVR, N, A, LDA, W, VL, LDVL, VR, LDVR,
$ WORK, LWORK, RWORK, INFO )
:
* ZGEEV computes for an N-by-N complex nonsymmetric matrix A, the
* eigenvalues and, optionally, the left and/or right eigenvectors.
:
ELSE IF( LDA.LT.MAX( 1, N ) ) THEN
INFO = -5
So the 5th input argument, LDA, was less than MAX(1,N), generating the error. Based on nothing more than what you have posted, this looks like a bug in the calling routine. So technical support needs to look at the underlying code that is generating this call.
Is there something unusual about the inputs you are using for your apparent eigenvalue calculations? E.g., if LDA = 0 then this would generate this error. And if you look at what LDA is in the code:
COMPLEX*16 A( LDA, * ), VL( LDVL, * ), VR( LDVR, * ),
$ W( * ), WORK( * )
You see that it is the first dimension of one of the input arrays. Are you passing in (i.e. trying to compute the eigenvalues of) a matrix with this first dimension equal to 0?
  댓글 수: 3
James Tursa
James Tursa 2016년 7월 29일
Hmmm ... that link shows a different interface with different meanings for the error codes (-5 being a NaN check failure instead of a dimension failure). Does your matrix have NaN's in it?
Robert
Robert 2016년 8월 15일
So in the end, it did end up being NaN's going into the eig() function!
According to mathworks support: "Pre-R2015b, passing NaNs to 'eig' in a MATLAB function block did not error out. A matrix with real NaNs and a diagonal NaN matrix were returned as the eigenvalues and vectors. "
Unfortunately, as they pointed out, I think the resulting error was less helpful than usual because the eig() call was inside of function block. So instead of Simulink pointing to where the error was, it simply gave the LAPACK error above.
Thanks for the help! Hope this helps people in the future.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Simulink Functions에 대해 자세히 알아보기

제품

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by