Solve a transcendental equation

13 vues (au cours des 30 derniers jours)
Dimitrios Anagnostou
Dimitrios Anagnostou le 4 Mai 2023
I know it is simple but I am puzzled how to force Matlab to solve the following equation
to get
This is what I do (assuming and ; is the coefficient of static friction between a body and an incline plane and θ is the inclination angle):
syms theta mu_s positive
assume(theta > 0 & theta < pi/2)
eq = sin(theta) == mu_s*cos(theta);
sol = solve(eq, theta, 'Real', true, 'ReturnConditions', true, 'PrincipalValue', true);
simplify(sol.theta)
ans = 
Any ideas? Thank you very much!

Réponse acceptée

Piyush Patil
Piyush Patil le 31 Mai 2023
Hello Dimitrios,
One way to force MATLAB to solve the given equation so that you can get the desired result is that try to rearrange the equation and then provide it to MATLAB.
You can write as
So your code will be -
syms theta mu_s positive
assume(theta > 0 & theta < pi/2)
% rearrange the equation
eq = tan(theta) == mu_s;
sol = solve(eq, theta, 'Real', true, 'ReturnConditions', true, 'PrincipalValue', true);
simplify(sol.theta)
By doing this, you will get solution as -
Hope this helps!

Plus de réponses (0)

Catégories

En savoir plus sur Symbolic Math Toolbox dans Help Center et File Exchange

Produits


Version

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by