Vpa Solve solving for B
2 views (last 30 days)
Show older comments
Benneth Perez
on 24 Oct 2021
Edited: Benneth Perez
on 25 Oct 2021
Hello,
This is a follow up question to this one. Previous Question
For some reason i was previously getting a different answer using vpasolve and vpa which now works and I get the right answers for solving for the Beta variable. I'm now using the code to solve B for when the values of M1=3 and theta2=15. When i do this i start getting results with imaginary answers.
The correct answer should be something like 32.24 but I'm getting:
beta =
84.4217 + 5.8932e-37i
M1 = 3;
P1 = 1;
theta2 = 15;
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
0 Comments
Accepted Answer
Walter Roberson
on 24 Oct 2021
M1 = 3;
P1 = 1;
theta2 = 15;
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;
b0 = 1;
result = vpasolve(tantheta == eqn, beta, b0);
beta = vpa(result)+180
More Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!