how to solve equation to find angle
4 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
I have the values of variables be like:
clear;
Vau = 43.0;
Vsu = 47.45;
beta = 1.41;
gamma = 5/3;
syms theta_u
I wish to find the value of theta_u.
For this, I have an equation like ![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/353393/image.jpeg)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/353393/image.jpeg)
when i solved this equation it turns out to be like
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/353396/image.jpeg)
Now I put this equation for solving it to matlab using code:
Q3 = double(solve(Vsu*(cosd(theta_u*(sqrt(2/(beta*gamma)))))*(1/(Vau*(cosd(theta_u))))-1))
it gives an error
Q3 = double(solve(Vsu*(cosd(theta_u*(sqrt(2/(beta*gamma)))))*(1/(Vau*(cosd(theta_u))))-1))
Warning: Unable to solve symbolically. Returning a numeric approximation instead.
> In solve (line 304)
Q3 =
-162.2052
which is also a wrong answer. The correct answer is 71.8. Please suggest if there are any corrections.
2 commentaires
Alan Stevens
le 29 Août 2020
Using fzero, I also get either 162.2052 or -162.2052 (depending on the initial guess). Why do you think the answer should be 71.8? Have you doube checked your equation and constants?
VBBV
le 8 Sep 2020
Place the term in sqrt outside the cost parenthesis
Try this
Q3 = solve(sqrt((beta*gamma)/2)*acos((sin(theta_u)*Vau)/Vsu),theta_u)
You will get two values ...
Q3 =
asin(949/860)
pi - asin(949/860)
Multply the first real(asin(949/860)*180/pi)
To get 90 deg
Réponses (1)
Ayush
le 6 Nov 2024
Modifié(e) : Ayush
le 6 Nov 2024
Hi @Megha
I used solve function and here is the output:
% Clear the workspace
clear;
% Given values
Vau = 43.0;
Vsu = 47.45;
beta = 1.41;
gamma = 5/3;
% Define the symbolic variable
syms theta_u
% Define the equation
equation = cos(theta_u) == (Vau * cos(theta_u) / Vsu) * sqrt(beta * gamma / 2);
% Solve the equation for theta_u
solution = solve(equation, theta_u);
% Convert the solution from radians to degrees
solution_degrees = rad2deg(vpa(solution));
% Display the solution
disp('The solution for theta_u in degrees is:');
disp(vpa(solution_degrees, 4)); % Display the solution with 4 decimal places
I am also getting 90 degrees.
0 commentaires
Voir également
Catégories
En savoir plus sur Assumptions dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!