How can I find the value of Q1 and Q2 in an equation with two unknowns?

3 views (last 30 days)
I need to find the Q1 and Q2 values in the equation. I tried many things but unfortunately I couldn't find the result. Can you help me?
100*cos(Q1)+40*cos(Q2) = 72.67
100*sin(Q1)+40*sin(Q2) = 10
Q1= ? and Q2 = ?
  1 Comment
Dyuman Joshi
Dyuman Joshi on 10 Jan 2023
How does this question relate to MATLAB? It looks like a simple mathematics problem to me.
However, I'll give a hint to solve the problem - Square both equations, add them and use trignometric identities to simplify the generated equation

Sign in to comment.

Accepted Answer

Walter Roberson
Walter Roberson on 10 Jan 2023
syms Q1 Q2
A = randi([-99 99]); B = randi([-99 99]);
eqn1 = A*cos(Q1)+B*cos(Q2) == randi([1, 100])
eqn1 = 
eqn2 = A*sin(Q1)+B*sin(Q2) == randi([1, 100])
eqn2 = 
sol = solve([eqn1, eqn2])
sol = struct with fields:
Q1: [2×1 sym] Q2: [2×1 sym]
vpa(subs([Q1, Q2], sol), 5)
ans = 

More Answers (0)

Categories

Find more on Symbolic Math Toolbox in Help Center and File Exchange

Products


Release

R2022b

Community Treasure Hunt

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

Start Hunting!