Re: Re: Holes when plotting funtions
- To: mathgroup at smc.vnet.net
- Subject: [mg42243] Re: Re: Holes when plotting funtions
- From: "Carl K. Woll" <carlw at u.washington.edu>
- Date: Wed, 25 Jun 2003 01:53:38 -0400 (EDT)
- Organization: University of Washington
- References: <bd8nm2$lmn$1@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
"Wolf, Hartmut" <Hartmut.Wolf at t-systems.com> wrote in message news:bd8nm2$lmn$1 at smc.vnet.net... <snip> > > With respect to the original question, as about the continous plot: That's > not quite true, see: > > In[91]:= > Plot[x (1 - Cos[x])/(x - Sin[x]), {x, -.0001, .0001}] > > In fact it needs quite a macroscopic hole, to cut out the numerical > instabilities! > > Hartmut, What you are seeing in the above plot is just cancellation errors resulting from using machine numbers. Consider the series expansion: In[1]:= x (1 - Cos[x])/(x - Sin[x])+O[x]^5 Out[1]= 2 4 x x 5 3 - -- - ---- + O[x] 10 4200 and we see that the function is well behaved around the origin. When we plot with arbitrary precision numbers, then the noise goes away. Consider: In[2]:= f[y_]:= With[{x=SetPrecision[y,20]}, x(1 - Cos[x])/(x - Sin[x])] and In[3]:= Plot[f[x],{x,-10^-4, 10^-4}] and you will notice that the plot is quite smooth. Carl Woll Physics Dept U of Washington