Solving Trigonometric Equations with More Than One Variables
Show older comments
Hi.
My problem is that I have a 3x1 matrix with trigonometric expressions such that:
x = [cos(theta)*sin(phi)*sin(psi) + cos(phi)*sin(theta); -cos(psi)*sin(theta); cos(phi)*sin(psi)*cos(theta) - sin(phi)*cos(psi)*sin(theta)]
And it should be equal to another matrix
with real numbers like:
y = [0.6,-0.76,0]
My code is:
syms theta phi psi
eqn_1 = cos(theta)*sin(phi)*sin(psi) + cos(phi)*sin(theta) == 0.6;
eqn_2 = -cos(psi)*sin(theta) == -0.76 ;
eqn_3 = cos(phi)*sin(psi)*cos(theta) - sin(phi)*cos(psi)*sin(theta) == 0 ;
eqn_4 = theta == -30 * pi / 180 ;
s = solve(eqn_1,eqn_2,eqn_3,eqn_4,theta,phi,psi,'ReturnConditions',true) ;
s.theta
s.phi
s.psi
But as you can see, it does not work. Can you help me,please?
Thanks.
Accepted Answer
More Answers (1)
Alan Stevens
on 4 Aug 2022
0 votes
You have theta = 30degrees, so sin(theta) is 1/2.
Therefore, in equation 2, you have cos(psi)/2 = 0.76, so cos(psi) > 1. If you are dealing with real numbers this is invalid!
3 Comments
Yagmur Savkay Öztok
on 4 Aug 2022
Sam Chak
on 4 Aug 2022
If no restriction on
, then there are complex-valued solutions on Wolfram.

Yagmur Savkay Öztok
on 8 Aug 2022
Categories
Find more on Surrogate Optimization in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!