Solving for angle (Beta) using vpasolve

3 ビュー (過去 30 日間)
Benneth Perez
Benneth Perez 2021 年 10 月 24 日
コメント済み: Star Strider 2021 年 10 月 24 日
Hello I'm trying to see why I'm not getting the correct angle when i Solve for the following equation. I'm not sure if this is due to a coding error that I dont see or if has to do with an angle property like the refence angle.
The equation I'm solving for is the following the resul i get is
beta =
-196.3722
However if im not mistaken the answer i should get is 23.13 deg.
M1 = 3;
P1 = 1;
theta2 = 5;
thetha3 = 20;
gamma = 1.4;
syms beta
tantheta = tand(theta2);
x = 2*cotd(beta)*((M1^2*((sind(beta))^2)-1));
y = M1^2*(gamma+cosd(2*beta))+2;
eqn = x/y;
result = vpasolve(eqn == tantheta,beta);
beta = result

採用された回答

Star Strider
Star Strider 2021 年 10 月 24 日
That’s the result I get when I solve it (and then correct it by ) —
M1 = 3;
P1 = 1;
theta2 = 5;
thetha3 = 20;
gamma = 1.4;
syms beta
tantheta = tand(theta2);
x = 2*cotd(beta)*((M1^2*((sind(beta))^2)-1));
y = M1^2*(gamma+cosd(2*beta))+2;
eqn = x/y;
result = solve(tantheta == eqn, beta);
beta = vpa(result) + 180
beta = 
23.133257450785606135761291258498
.
  5 件のコメント
Walter Roberson
Walter Roberson 2021 年 10 月 24 日
vpasolve() uses a modified Newton-Raphson algorithm. It might need to take the derivative of the function internally first.
Star Strider
Star Strider 2021 年 10 月 24 日
As always, my pleasure!
I looked at the linked Question, and posted an Answer (of sorts) to it, although I could not find a symbolic solution for it.
.

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeNumeric Solvers についてさらに検索

製品


リリース

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by