Matlab determinant equation solver

6 ビュー (過去 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 Center および File ExchangeLinear Algebra についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by