Matlab determinant equation solver

조회 수: 10 (최근 30일)
Nasimi Bayramli
Nasimi Bayramli 2020년 5월 15일
댓글: Nasimi Bayramli 2020년 5월 16일
Hi, i would like to solve det (I+lambda*M)=0 (not eigenvalue problem) where lambda is complex number and M has 792 3x3 matrix, please can you advise me code to do it?
Thanks beforehand
  댓글 수: 3
Nasimi Bayramli
Nasimi Bayramli 2020년 5월 15일
sorry, i have edited it, it was 792 3x3 matrix and I is identity matrix
John D'Errico
John D'Errico 2020년 5월 15일
편집: John D'Errico 2020년 5월 15일
What is a 792 3x3 matrix? Are you saying that M is 792x3x3, so a 3-dimensional matrix? In that case, the determinant of a multi-dimensional matrix is undefined.
Perhaps you want to solve 792 such 3x3 problems. But then, even though you CLAIM this to be not an eigenvalue problem, you are wrong. It is exactly that, just with a twist. (THINK ABOUT IT!) And then all you need to do is use a loop.

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

채택된 답변

John D'Errico
John D'Errico 2020년 5월 15일
편집: John D'Errico 2020년 5월 15일
Just for kicks, I assume that you really have 792 such 3x3 problems. JUST USE A LOOP. Could you convert this into a cell array of 3x3 matrices? Well, yes. Then you could just use cellfun. Not a problem either way, nor would the code written using cellfun be essentially any better or faster to run. cellfun is just an implicit, internally implemented loop. And the time required for loop over 792 3x3 arrays is quite minimal. So either way you do it is the same.
Next, to your claim this is not an eigenvalue problem. False. It is. With a twist.
Suppose you want to solve the problem
det(I + lambda*M) = 0
where M is a 3x3 matrix? Any nxn matrix applies too, of course.
First, what is the determinant det(k*A), where A is a square 3x3 matrix?
det(k*A) = k^3 *det(A)
For an nxn matrix, we would just have k^n*det(A).
go back and look at your problem.
det(I + lambda*M) = 0
You wish to solve for lambda, suc that this expression is zero. As long as lambda is not zero, then you can divide by lambda^3. And we just showed that we can distribute that into the matrix inside the determinant. So we can write the problem as:
det(I*1/lambda + M) = 0
AND THAT IS AN EIGENVALUE PROBLEM. Solve for the eigenvalues of the 3x3 matrix M. Then invert them, and multiply by -1, since the eigenvalues of a system solve the problem:
det(A - lambda*I) = 0
The only case where you have a problem is then M is singular, in which case one or more of the eigenvalues of M is zero.
  댓글 수: 1
Nasimi Bayramli
Nasimi Bayramli 2020년 5월 16일
thanks for your reply i understand hw to solve

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Linear Algebra에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by