Unknown angles as functions of time

6 ビュー (過去 30 日間)
Dario Saracchi
Dario Saracchi 2021 年 6 月 1 日
コメント済み: William Rose 2021 年 6 月 3 日
I have 2 functions in which the unknown variables are funcions of time, here are the equations:
AB=150;
AEh=90+sqrt(250^2-180^2);
k2=(150*sin(3*pi/4));
BE=sqrt((AEh+k2)^2+(k2)^2);
CE=250;
AC=sqrt(90^2+180^2);
delta=atan(2);
t_vec=0:0.1:3*pi;
alfa=3/4*pi+1/9*pi*sin(t_vec);
AB*cos(alfa)+BE*cos(beta)+CE*cos(gamma)-AC*cos(delta)=0
AB*sin(alfa)+BE*sin(beta)+CE*sin(gamma)-AC*sin(delta)=0
(beta and gamma are unknown variables)
I tried to use the syms function but it didn't work.
syms beta gamma
eq=[AB*cos(alfa)+BE*cos(beta)+CE*cos(gamma)-AC*cos(delta)==0,AB*sin(alfa)+BE*sin(beta)+CE*sin(gamma)-AC*sin(delta)==0];
sol=solve(eq);
betasol=vpa(sol.beta)
gammasol=vpa(sol.gamma)
How do I write a code to find beta and gamma?

採用された回答

William Rose
William Rose 2021 年 6 月 1 日
@Dario Saracchi, You can do some algebra before you do some code.
Define some constants:
d=AB*cos(alfa)-AC*cos(delta)
e=AB*sin(alfa)-AC*sin(delta)
a=BE, c=CE.
Then the equations
AB*cos(alfa)+BE*cos(beta)+CE*cos(gamma)-AC*cos(delta)=0
AB*sin(alfa)+BE*sin(beta)+CE*sin(gamma)-AC*sin(delta)=0
can be written
Now define and . Then the equations above can be written as
Therefore , and therefore
which is one equation and one unknown. Try solving this with solve() or with vpasolve() or numerically with fzero(). Then you can compute and .
  2 件のコメント
Dario Saracchi
Dario Saracchi 2021 年 6 月 1 日
Thank you so much! And to plot Beta and Gamma as functions of time can I just use the plot function?
William Rose
William Rose 2021 年 6 月 3 日
@Dario Saracchi, You're welcome. Yes.

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

その他の回答 (0 件)

カテゴリ

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

タグ

製品


リリース

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by