Message Boards Message Boards

[?] Solve systems of equations with trigonometric expressions?

Posted 6 years ago

I am fairly new to Mathematica, so this may be a simplistic question, but I want to learn. I know how to use the Solve function to solve a single equation like this:

Solve[Cot[c Degree] == 5.792, c]

and I know how to use Solve to solve a system of multiple equations like this:

Solve[{5*j + 2*r == 5, 6*j - 3*r == 9}, {j, r}]

However, when I try to solve a system of multiple equations that involves trigonometric expressions like this (some variables previously defined):

Solve[{Fr == Cos[phi Degree]*Fb + Sin[theta Degree]*Fa, 
   0 == Cos[theta Degree]*Fa - Sin[phi Degree]*Fb}, {Fa, theta}] // N

I get only a partially correct answer along with some results that are difficult to understand:

{{Fa -> -883.103, 
  theta -> ConditionalExpression[57.2958 (-2.10618 + 6.28319 C[1]), 
    C[1] \[Element] Integers]}, {Fa -> 883.103, 
  theta -> ConditionalExpression[57.2958 (1.03541 + 6.28319 C[1]), 
    C[1] \[Element] Integers]}}

What do I need to do to get Mathematica to give me a value of theta in degrees? I am sure there is a straightforward solution, but I just can't seem to find it. Thank you!

POSTED BY: Brett Stone
3 Replies
POSTED BY: Hans Dolhaine
Posted 6 years ago

Thank you, Gianluca. I appreciate you taking the time to respond. I am not able to get that work for me. It makes sense to me that theta would be valid over a certain given range. The problem these equations I am trying to solve represent is a basic statics/physics problem, so the angels are definitely between 0 and 360 degrees. Does your statement that I can get single solutions by giving integer numerical values to C[1] somehow tell Mathematica to only consider values of theta (and phi for that matter) that are between 0 and 360? I apologize for my novice understanding of Mathematica and its terminology.

POSTED BY: Brett Stone

A ConditionalExpression is valid only if the given condition is satisfied. In this case, C[1] must be an integer coefficient. The solution don't seem problematic to me:

eqs = {Fr == Cos[phi Degree] Fb + Sin[theta Degree] Fa, 
   0 == Cos[theta Degree] Fa - Sin[phi Degree] Fb};
sol = Simplify@Solve[eqs, {Fa, theta}];
Simplify[eqs /. sol, Element[C[1], Integers]]

You get single solutions by giving integer numerical values to C[1]:

Simplify[sol /. C[1] -> 3]
POSTED BY: Gianluca Gorni
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract