Solving four trigonometric equations, four unknowns

Please I want to solve these four trigonometric equations, four unknowns using a matlab code
10 cos ∅3 + 10 cos ∅2 − 𝑟1 = 0
15 cos ∅4 + 12 cos ∅2 − 𝑟1 = 0
10 sin∅3 + 10 sin∅2 = 0
15 sin∅4 + 12 sin∅2 = 0
thank you in advance.

 Akzeptierte Antwort

It seems that only 4 complex solutions exist.
syms phi2 phi3 phi4 r1
eqn1 = 10*cos(phi3)+10*cos(phi2)-r1 == 0;
eqn2 = 15*cos(phi4)+12*cos(phi2)-r1 == 0;
eqn3 = 10*sin(phi3)+10*sin(phi2) == 0;
eqn4 = 15*sin(phi4)+12*sin(phi2) == 0;
sol = solve([eqn1,eqn2,eqn3,eqn4],[phi2 phi3 phi4 r1])
sol = struct with fields:
phi2: [4×1 sym] phi3: [4×1 sym] phi4: [4×1 sym] r1: [4×1 sym]
double(sol.phi2)
ans =
1.5708 + 0.8858i -1.5708 - 0.8858i 1.5708 - 0.8858i -1.5708 + 0.8858i
double(sol.phi3)
ans =
-1.5708 - 0.8858i 1.5708 + 0.8858i -1.5708 + 0.8858i 1.5708 - 0.8858i
double(sol.phi4)
ans =
-1.5708 - 0.5138i 1.5708 + 0.5138i -1.5708 + 0.5138i 1.5708 - 0.5138i
double(sol.r1)
ans =
0.0000 -20.1246i 0.0000 -20.1246i 0.0000 +20.1246i 0.0000 +20.1246i

Weitere Antworten (1)

You can solve symbolically -
syms r1 t2 t3 t4
e1 = 10*cos(t3) + 10*cos(t2) - r1 == 0;
e2 = 15*cos(t4) + 12*cos(t2) - r1 == 0;
e3 = 10*sin(t3) + 10*sin(t2) == 0;
e4 = 15*sin(t4) + 12*sin(t2) == 0;
y=solve([e1 e2 e3 e4],[r1 t2 t3 t4])
y = struct with fields:
r1: [4×1 sym] t2: [4×1 sym] t3: [4×1 sym] t4: [4×1 sym]
y.r1
ans = 
y.t2
ans = 
Use double() to get numeric values

Kategorien

Mehr zu Symbolic Math Toolbox finden Sie in Hilfe-Center und File Exchange

Gefragt:

am 14 Dez. 2022

Beantwortet:

am 14 Dez. 2022

Community Treasure Hunt

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

Start Hunting!

Translated by