2
$\begingroup$

I noticed the following difference, and I wonder if it's a problem of my system or the results difference is actually due to the two different versions

oldsa = {0.29289321881345254` - 
    0.6666666666666666` Sin[0.5235987755982988` + phi] == 
   0.75` Cos[psi1], -0.7071067811865475` + h + 
    0.6666666666666666` Cos[0.5235987755982988` + phi] == 
   0.75` Sin[psi1], -0.5` + 
    0.6666666666666666` Sin[0.5235987755982988` - phi] == 
   0.75` Cos[psi2], -0.4660254037844386` + h + 
    0.6666666666666666` Cos[0.5235987755982988` - phi] == 
   0.75` Sin[psi2]}

NSolve[oldsa, {h, phi, psi1, psi2}]

gives solutions in Mathematica version 7, and no solution in ver. 8 Both run on Ubuntu 12.04 x64 Do you get the same resuts?

$\endgroup$
6
  • 2
    $\begingroup$ Yes, I find the same issue, it works in ver.7 and ver.9 yielding a list of 24 solutions and also this message : NSolve::ifun: Inverse functions are being used by NSolve, so some solutions may not be found; use Reduce for complete solution information. >> but it does not work in ver.8 i.e. it yields {}. $\endgroup$
    – Artes
    Dec 20, 2012 at 11:38
  • $\begingroup$ Haha not only that, but, in v8, if you apply the replacement rule /. 0.5235987755982988` -> π/6 it DOES produce a solution $\endgroup$
    – gpap
    Dec 20, 2012 at 11:50
  • 1
    $\begingroup$ Confirming. Solution in 7 on Linux and no solution in 8.0.4 on Windows. $\endgroup$ Dec 20, 2012 at 11:59
  • $\begingroup$ @Artes Well, in my v8, if you define oldsa2 = oldsa/. 0.5235987755982988` -> π/6 (i.e. copy-paste the numerical value from within the trig functions and replace it with its symbolic equivalent), then NSolve[oldsa, {h, phi, psi1, psi2}] gives {} and NSolve[oldsa2, {h, phi, psi1, psi2}] gives a list of solutions of length 24! $\endgroup$
    – gpap
    Dec 20, 2012 at 12:57
  • $\begingroup$ To all the commenters, thank you guys $\endgroup$ Dec 20, 2012 at 13:09

1 Answer 1

1
$\begingroup$

Just adding to how strange this is in version 8 where the code below has been tested.

First, observe that the numerical value within the trigonometric function (0.523599) is $ \pi/6 $:

0.5235987755982988`== π/6

gives

True

Now, as above, define the equation to solve

oldsa = {0.29289321881345254` - 
0.6666666666666666` Sin[0.5235987755982988` + phi] == 
0.75` Cos[psi1], -0.7071067811865475` + h + 
0.6666666666666666` Cos[0.5235987755982988` + phi] == 
0.75` Sin[psi1], -0.5` + 
0.6666666666666666` Sin[0.5235987755982988` - phi] == 
0.75` Cos[psi2], -0.4660254037844386` + h + 
0.6666666666666666` Cos[0.5235987755982988` - phi] == 
0.75` Sin[psi2]}

and a version of it with the numerical value of $ \pi/6 $ replaced by the symbolic π/6, i.e.

oldsaSymbolic = oldsa/. 0.5235987755982988` -> π/6

Indeed,

NSolve[oldsa, {h, phi, psi1, psi2}] 

gives

{}

But

NSolve[oldsaSymbolic, {h, phi, psi1, psi2}]

gives 24 solutions!?!

$\endgroup$

Your Answer

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

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