MathGroup Archive 2007

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Coaxing N[] to work

  • To: mathgroup at smc.vnet.net
  • Subject: [mg73379] Re: Coaxing N[] to work
  • From: Jens-Peer Kuska <kuska at informatik.uni-leipzig.de>
  • Date: Thu, 15 Feb 2007 04:53:30 -0500 (EST)
  • Organization: Uni Leipzig
  • References: <equo6r$in0$1@smc.vnet.net>
  • Reply-to: kuska at informatik.uni-leipzig.de

Hi,

where should the 30 digits come from. You give
x = {2.0, 3.0, 5.0};
that have 16 digits like a machine precision number
The error propagation will not *increase* the precision
and Mathematica has not enough	imagination to add the
missing digits.
But
x = SetPrecision[{2.0, 3.0, 5.0}, 30];
A = SetPrecision[{{6.0, 2.0, 1.0}, {2.0, 3.0, 1.0}, {1.0, 1.0, 1.0}}, 30];
For[k = 0, k < 15, ++k, lambda = x.A.x/(x.x);
   y = LinearSolve[A, x];
   x = y/Norm[y, Infinity];]
N[lambda, 30]

may work.

Regards
   Jens

p at dirac.org wrote:
> Sometimes N[,] doesn't appear to work.  Like here:
> 
> 
> x = {2.0, 3.0, 5.0};
> A = { {6.0, 2.0, 1.0}, {2.0, 3.0, 1.0}, {1.0, 1.0, 1.0} };
> For[ k=0, k<15, ++k,
>    lambda = x.A.x/(x.x);
>    y = LinearSolve[A,x];
>    x = y / Norm[y,Infinity];
> ]
> N[lambda, 30]
> 
> 
> The output is:
> 
>    Out[5]= 0.578933
> 
> I was expecting 30 digits.  Why did N[] ignore my request for 30 digits?
> 


  • Prev by Date: Re: Coaxing N[] to work
  • Next by Date: Re: Coaxing N[] to work
  • Previous by thread: Re: Coaxing N[] to work
  • Next by thread: Re: Coaxing N[] to work