Re: numerics

*To*: mathgroup at smc.vnet.net*Subject*: [mg27270] Re: numerics*From*: Jens-Peer Kuska <kuska at informatik.uni-leipzig.de>*Date*: Sat, 17 Feb 2001 03:30:42 -0500 (EST)*Organization*: Universitaet Leipzig*References*: <96iqph$d9j@smc.vnet.net>*Sender*: owner-wri-mathgroup at wolfram.com

Hi, don't mix symbolic algorithms with floating point numbers. The following will help Reduce[Thread[newmat.{x1, x2, x3} == {0, 0, 0}] /. x_Real :> Rationalize[x], {x1, x2, x3}] // N How ever, the behaviour is a feature of Mathematica ;-) Regards Jens Matt.Johnson at autolivasp.com wrote: > > mathematica gurus-- > > Here's a frustrating problem, which seems to be simple. I can calculate a > matrix by hand and enter it into Solve or Reduce and get the correct > relationships: > > In[108]:= > mat = Partition[{-0.2, 0.1, 0, 0.1, -0.3, 0.1, 0.1, 0.2, -0.1}, 3]; > Reduce[mat.{x1, x2, x3} == {0, 0, 0}, {x1, x2, x3}] > Out[109]= > x1 == 0.5 x2 && x3 == 2.5 x2 > > However, if I try to manipulate the matrix in Mathematica then solve, it doesn't work: > > In[110]:= > mat1 = Partition[{0.8, 0.1, 0.1, 0.1, 0.7, 0.2, 0, 0.1, 0.9}, 3]; > imat = IdentityMatrix[Length[mat1]]; > newmat = Transpose[mat1] - imat; > In[113]:= > newmat == mat > Out[113]= > True > In[114]:= > newmat === mat > Out[114]= > False > In[115]:= > Reduce[newmat.{x1, x2, x3} == {0, 0, 0}, {x1, x2, x3}] > Out[115]= > x1 == 0. && x2 == 0. && x3 == 0. > > any input? > > -matt