Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #14327 > unrolled thread

Wrong Answer

Started bychristopher arthur <chris.arthur1@gmail.com>
First post2013-04-27 03:08 +0000
Last post2013-04-28 04:58 +0000
Articles 2 — 2 participants

Back to article view | Back to comp.soft-sys.math.mathematica


Contents

  Wrong Answer christopher arthur <chris.arthur1@gmail.com> - 2013-04-27 03:08 +0000
    Re: Wrong Answer Clif McInnis <c_mcinnis@hotmail.com> - 2013-04-28 04:58 +0000

#14327 — Wrong Answer

Fromchristopher arthur <chris.arthur1@gmail.com>
Date2013-04-27 03:08 +0000
SubjectWrong Answer
Message-ID<klfff6$jl3$1@smc.vnet.net>
Hello,

I've discovered that Solve[] gives me the wrong answer for some 
polynomial equations.  For example, consider the following equation, 
which should have exactly one positive, real answer for t.  

p:=(px + t vx)^4 + (py + t vy)^4==1
r:={px->0.5,py->0.5,vx->0.5,vy->0.5}
NSolve[p/.r,t]

NSolve gives the right answers if I substitute for px,py,vx and vy 
before solving.  On the other hand, if I use Solve[] this way:

Solve[p,t]/.r

I get a different answer, and it's not correct. 
Does Solve[] just malfunction with quartic polynomials or is there 
something else happening?

Chris

mathematica 5.2

Solve[p]

[toc] | [next] | [standalone]


#14336

FromClif McInnis <c_mcinnis@hotmail.com>
Date2013-04-28 04:58 +0000
Message-ID<klia8t$s8s$1@smc.vnet.net>
In reply to#14327
Not sure if this will be helpful but here is what I get with ver. 9.0.1

In[17]:= p := (px + t vx)^4 + (py + t vy)^4 == 1
r := {px -> 0.5, py -> 0.5, vx -> 0.5, vy -> 0.5}
NSolve[p /. r, t]
Solve[p, t] /. r
Solve[p]


Out[19]= {{t -> -2.68179}, {t -> -1. - 1.68179 I}, {t -> -1. + 
    1.68179 I}, {t -> 0.681793}}

During evaluation of In[17]:= Power::infy: Infinite expression 1/Sqrt[0.] encountered. >>

During evaluation of In[17]:= Infinity::indet: Indeterminate expression 0. ComplexInfinity encountered. >>

During evaluation of In[17]:= Power::infy: Infinite expression 1/Sqrt[0.] encountered. >>

During evaluation of In[17]:= Infinity::indet: Indeterminate expression 0. ComplexInfinity encountered. >>

During evaluation of In[17]:= Power::infy: Infinite expression 1/Sqrt[0.] encountered. >>

During evaluation of In[17]:= General::stop: Further output of Power::infy will be suppressed during this calculation. >>

During evaluation of In[17]:= Infinity::indet: Indeterminate expression 0. ComplexInfinity encountered. >>

During evaluation of In[17]:= General::stop: Further output of Infinity::indet will be suppressed during this calculation. >>

Out[20]= {{t -> Indeterminate}, {t -> Indeterminate}, {t -> 
   Indeterminate}, {t -> Indeterminate}}

Out[21]= {{px -> -t vx - (1 - py^4 - 4 py^3 t vy - 6 py^2 t^2 vy^2 - 
      4 py t^3 vy^3 - t^4 vy^4)^(1/4)}, {px -> -t vx - 
    I (1 - py^4 - 4 py^3 t vy - 6 py^2 t^2 vy^2 - 4 py t^3 vy^3 - 
       t^4 vy^4)^(1/4)}, {px -> -t vx + 
    I (1 - py^4 - 4 py^3 t vy - 6 py^2 t^2 vy^2 - 4 py t^3 vy^3 - 
       t^4 vy^4)^(
     1/4)}, {px -> -t vx + (1 - py^4 - 4 py^3 t vy - 
      6 py^2 t^2 vy^2 - 4 py t^3 vy^3 - t^4 vy^4)^(1/4)}}

[toc] | [prev] | [standalone]


Back to top | Article view | comp.soft-sys.math.mathematica


csiph-web