Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

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?

share|improve this question
2  
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 {}. –  Artes Dec 20 '12 at 11:38
    
Haha not only that, but, in v8, if you apply the replacement rule /. 0.5235987755982988` -> π/6 it DOES produce a solution –  gpap Dec 20 '12 at 11:50
1  
Confirming. Solution in 7 on Linux and no solution in 8.0.4 on Windows. –  Andreas Lauschke Dec 20 '12 at 11:59
    
@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! –  gpap Dec 20 '12 at 12:57
    
To all the commenters, thank you guys –  Fabio Dalla Libera Dec 20 '12 at 13:09
show 1 more comment

1 Answer

up vote 1 down vote accepted

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!?!

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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