Solve a transcendental equation

14 visualizzazioni (ultimi 30 giorni)
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!

Risposta accettata

Piyush Patil
Piyush Patil il 31 Mag 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!

Più risposte (0)

Categorie

Scopri di più su Symbolic Math Toolbox in Help Center e File Exchange

Prodotti


Release

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by