please explain the solution

2 ビュー (過去 30 日間)
Shimon Katzman
Shimon Katzman 2020 年 1 月 5 日
編集済み: Ridwan Alam 2020 年 1 月 5 日
Hi everybody,
Can't figure the solution of this code (should get 3 answres in form: w=number*k)
syms k;
syms w1;
m=240;I=10000;
Tuq = [0 1 -10;
1 0 -5;
1 0 5;
-1/sqrt(5) 2/sqrt(5) 21/sqrt(5);
-1/sqrt(5) -2/sqrt(5) -21/sqrt(5)];
K = Tuq'*eye(5)*Tuq;
M = [ m 0 0 ; 0 m 0 ; 0 0 I ];
eq = det(K*k-w1*M);
s = solve(eq,w1);
w = real(sqrt(s));
Thank you very much.

採用された回答

Ridwan Alam
Ridwan Alam 2020 年 1 月 5 日
編集済み: Ridwan Alam 2020 年 1 月 5 日
K = round(Tuq'*eye(5)*Tuq,2);
M = [ m 0 0 ; 0 m 0 ; 0 0 I ];
eq = det(K*k-w1*M);
s = solve(eq,w1);
will prevent sym() to consider the higher precision values.
Output:
vpa(s)
ans =
0.009983*k
0.03349*k
0.01*k

その他の回答 (0 件)

カテゴリ

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