Services & Resources / Wolfram Forums
MathGroup Archive
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2004

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

Search the Archive

A problem of numerical precision

  • To: mathgroup at
  • Subject: [mg52610] A problem of numerical precision
  • From: Guofeng Zhang <guofengzhang at>
  • Date: Sat, 4 Dec 2004 04:07:49 -0500 (EST)
  • References: <>
  • Reply-to: Guofeng Zhang <guofengzhang at>
  • Sender: owner-wri-mathgroup at


 I met one problem when I do some iteration: By increasing numerical
 precision, the results are so different from the original one!  I
 don't know what went wrong, and hope to get some answers.
 The code is
 delta = 1/100;
 a = 9/10;
 b = -3*1.4142135623730950/10;
 A = { {1,0}, {b,a} };
 B= { {-1,1}, {-b,b} };
 f[v_,x_] := If[ Abs[ (10^20)*v-(10^20)*x]>(10^20)*delta, 1, 0 ];
 M = 3000;
 it = Table[0, {i,M}, {j,2} ];
 it[ [1] ] = { -delta/2, (a+b)*(-delta/2) };
 For[ i=1, i<M, it[ [i+1]]  =[[i]]+f[ it[ [i,1] ], it[ [i,2] ]
 ]*[ [i] ]; i++ ];
 temp = Take[it, -1000];
 ListPlot[ temp ];
 By evaluating this, I got an oscillating orbit. I got the same using
 another system. However, if I increase the numerical precision by using
 b = -3*1.4142135623730950``200/10;
 to substitute the original b, the trajectory would converge to a fixed
 point instead of  wandering around!
 I don't know why. I am hoping for suggestions. Thanks a lot.
Guofeng Zhang
PhD student
Dept. of Mathematical and Statistical Sciences
University of Alberta
Edmonton AB
Canada T6G 2G1

  • Prev by Date: Re: changing parts of a list of lists
  • Next by Date: Re: Re: Re: Finding the Fourier transform of discrete functions
  • Previous by thread: Re: A problem about numerical precision
  • Next by thread: Re: A problem of numerical precision