Solving Determinant w/ Symbolic Values?

16 ビュー (過去 30 日間)
Carlen
Carlen 2014 年 10 月 29 日
I essentially have this determinant here that I need to solve:
Just not sure how to do it symbolically in MATLAB without values...
Also, is there a way that I could then solve for w(omega) smybolically?

採用された回答

Star Strider
Star Strider 2014 年 10 月 29 日
If you have the Symbolic Math Toolbox, use the symbolic det function:
syms m1 m2 k1 k2 w
M = [(-m1*w^2 + k1) (-k1); (-k1) (-m2*w^2 + k1 + k2)];
detM = det(M);
w = solve(detM,w)
  4 件のコメント
Star Strider
Star Strider 2020 年 12 月 14 日
My pleasure!
Thank you!
(A Vote would be appreciated!)
Aditya Vikram Singh
Aditya Vikram Singh 2021 年 9 月 5 日
@Star Strider can you please also tell how to obtain the fourth degree equation in omega here with coeffiecient of each term in omega.

サインインしてコメントする。

その他の回答 (3 件)

Carlen
Carlen 2014 年 10 月 29 日
編集済み: Carlen 2014 年 10 月 29 日
Awesome thanks! If I wanted to solve for w^2 instead of w is there a way to do that?
  1 件のコメント
Star Strider
Star Strider 2014 年 10 月 29 日
My pleasure!
Probably the easiest way to solve for w^2 is simply to substitute w2 for it:
syms m1 m2 k1 k2 w w2
M = [(-m1*w2 + k1) (-k1); (-k1) (-m2*w2 + k1 + k2)];
detM = det(M);
w2 = solve(detM, w2)
That produces two quadratic roots.
If you want to use the roots as a function in other MATLAB code, use matlabFunction and its friends. It is much easier than coding it yourself, and it also vectorises the expression in the process.
For example:
wsq = matlabFunction(w2);
detmat = wsq(3, 5, 7, 13);
will produce a (2x1) vector of solutions.

サインインしてコメントする。


Carlen
Carlen 2014 年 10 月 30 日
Thanks a lot for the help!
  1 件のコメント
Star Strider
Star Strider 2014 年 10 月 30 日
My pleasure!

サインインしてコメントする。


Caio Contezini
Caio Contezini 2020 年 11 月 18 日
Star Strider, how can I solve that if I dont have Symbolic Math Toolbox?

カテゴリ

Help Center および File ExchangeConversion Between Symbolic and Numeric についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by