What do I do next to solve for m?
2 ビュー (過去 30 日間)
古いコメントを表示
clear
syms f m g L I
E = 2*pi*f == sqrt((m*g*L)/I)
%What is the mass when...
m = solve(E,m)
subs(E, f ,0.1);
subs(E, I, 50);
subs(E, g, 9.8);
subs(E, L, 0.5);
Now I need to find a value for m but I'm not sure how to move forward with it
0 件のコメント
回答 (1 件)
Star Strider
2021 年 10 月 23 日
The conditions only apply if the values of the constants are not defined first.
Try this —
syms f m g L I
f = sym(0.1);
I = sym(50);
g= sym(9.81);
L = sym(0.5);
E = 2*pi*f == sqrt((m*g*L)/I);
m = solve(E,m)
m_vpa = vpa(m, 42)
.
2 件のコメント
Star Strider
2021 年 10 月 23 日
It’s not necessary to use the Symbolic Math Toolbox at all —
f = 0.1;
I = 50;
g = 9.81;
L = 0.5;
E = @(m) 2*pi*f - sqrt((m*g*L)/I) % Anonymous Function
m = fzero(E, 10)
Although it only shows four decimal places, it retains full internal precison, so nothing is lost.
.
参考
カテゴリ
Help Center および File Exchange で Symbolic Math Toolbox についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!