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.

 ์ฑ„ํƒ๋œ ๋‹ต๋ณ€

Torsten
Torsten 2022๋…„ 12์›” 14์ผ

1 ๊ฐœ ์ถ”์ฒœ

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

์ถ”๊ฐ€ ๋‹ต๋ณ€ (1๊ฐœ)

Dyuman Joshi
Dyuman Joshi 2022๋…„ 12์›” 14์ผ

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

์นดํ…Œ๊ณ ๋ฆฌ

๋„์›€๋ง ์„ผํ„ฐ ๋ฐ File Exchange์—์„œ Symbolic Math Toolbox์— ๋Œ€ํ•ด ์ž์„ธํžˆ ์•Œ์•„๋ณด๊ธฐ

์ œํ’ˆ

๋ฆด๋ฆฌ์Šค

R2022b

์งˆ๋ฌธ:

2022๋…„ 12์›” 14์ผ

๋‹ต๋ณ€:

2022๋…„ 12์›” 14์ผ

Community Treasure Hunt

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

Start Hunting!

Translated by