0
$\begingroup$

Both Solve[] and NSolve[] seem to be unable to solve this simple system of two equations: $$ \sin(\phi_1) + 0.6 \sin(\phi_1 + \phi_2) ==0,$$ $$ 0.1\sin(\phi_2) + 0.6 \sin(\phi_1 + \phi_2) ==0,$$ with $\phi_1,\phi_2 \in (-\pi,\pi )$.

NSolve[{Sin[ϕ1] + 0.6` Sin[ϕ1 + ϕ2] == 
0 && ϕ1 > -π && ϕ1 <= π, 
0.1` Sin[ϕ2] + 0.6` Sin[ϕ1 + ϕ2] == 
0 && ϕ2 > -π && ϕ2 <= π}, {ϕ1, ϕ2}]

The output simply prints the input. Am I doing something wrong? I know from graphs that there are indeed solutions

$\endgroup$
6
  • 1
    $\begingroup$ Try: Reduce[{Sin[\[Phi]1] + 6/10*Sin[\[Phi]1 + \[Phi]2] == 0 && 1/10*Sin[\[Phi]2] + 6/10*Sin[\[Phi]1 + \[Phi]2] == 0 && -Pi < \[Phi]1 < Pi && -Pi < \[Phi]2 < Pi}, {\[Phi]1, \[Phi]2}]? Solve and NSolve deals primarily with linear and polynomial equations.One solution: ContourPlot[{Sin[\[Phi]1] + 6/10*Sin[\[Phi]1 + \[Phi]2] == 0, 1/10*Sin[\[Phi]2] + 6/10*Sin[\[Phi]1 + \[Phi]2] == 0}, {\[Phi]1, -Pi, Pi}, {\[Phi]2, -Pi, Pi}] $\endgroup$ Jan 20, 2020 at 17:08
  • $\begingroup$ Thanks. Unfortunately, Reduce only gives one solution (0,0) whereas I need to access all solutions, moreover in an automatised way as I'm looping over different values for the coefficients of the Sine functions. $\endgroup$
    – Rudyard
    Jan 20, 2020 at 17:26
  • 1
    $\begingroup$ All solution: Reduce[{Sin[\[Phi]1] + 6/10*Sin[\[Phi]1 + \[Phi]2] == 0 && 1/10*Sin[\[Phi]2] + 6/10*Sin[\[Phi]1 + \[Phi]2] == 0 && -Pi < \[Phi]1 <= Pi && -Pi < \[Phi]2 <= Pi}, {\[Phi]1, \[Phi]2}]? $\endgroup$ Jan 20, 2020 at 17:33
  • $\begingroup$ ah, of course.. $\endgroup$
    – Rudyard
    Jan 20, 2020 at 17:41
  • 1
    $\begingroup$ Yes try: Solve[%] $\endgroup$ Jan 20, 2020 at 17:54

1 Answer 1

2
$\begingroup$

In addition to Marius' comment, you can use Solve with Method -> Reduce:

Solve[
    {
    Sin[ϕ1] + 0.6 Sin[ϕ1 + ϕ2] == 0 && ϕ1 > -π && ϕ1 <= π, 
    0.1 Sin[ϕ2] + 0.6 Sin[ϕ1 + ϕ2] == 0 && ϕ2 > -π && ϕ2 <= π
    },
    {ϕ1, ϕ2},
    Method->Reduce
]

Solve::ratnz: Solve was unable to solve the system with inexact coefficients. The answer was obtained by solving a corresponding exact system and numericizing the result.

{{ϕ1 -> 0, ϕ2 -> 0}, {ϕ1 -> 0, ϕ2 -> 3.14159}, {ϕ1 -> 3.14159, ϕ2 -> 0}, {ϕ1 -> 3.14159, ϕ2 -> 3.14159}}

$\endgroup$
1
  • 2
    $\begingroup$ Why not use $\dfrac{1}{10}$ and $\dfrac{6}{10}$ instead to remove the error message? $\endgroup$
    – Moo
    Jan 20, 2020 at 17:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.