Re: Plot[] of smooth function results in wildly fluctuating graph?
- To: mathgroup at smc.vnet.net
- Subject: [mg64814] Re: Plot[] of smooth function results in wildly fluctuating graph?
- From: Peter Pein <petsie at dordos.net>
- Date: Sat, 4 Mar 2006 02:35:27 -0500 (EST)
- References: <du8495$t4g$1@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
KvS schrieb:
> Hi everybody,
>
> I have a problem with Plot[]. In my code I generate a sequence (in k)
> of functions s -> v[k,s] where each of them is piecewise defined on
> [a,Infinity) (a>>0) using v[k,s_]=Evaluate[Boole[a<=s<=x1]*(<formula1>)
> + Boole[x1<s<=x2]*(<formula2>) + ... ]. Each of the formulas on a
> subinterval is of the form
>
> s^b * \sum_{m=0}^n c[k,m]*(Log[s])^m + linear function
>
> where b is typically something like 50 or -50 and the n (different for
> the different subintervals) lies somewhere between 0 and k.
>
> The problem is that after some runs, say when k=20, making a plot of
> this function simply by Plot[v[k,s], {s,a,10}] shows wild fluctuations
> and absurd values in those subintervals where n is big, while directly
> evaluating the function at some points in those subintervals using
> N[..] shows that this function (as expected) is actually smooth and has
> much smaller values than the plot indicates.
>
> I could of course do soemthing like ListPlot[Table[...]] but that is
> unsatisfactory and just not smooth enough. Is there a way to get Plot[]
> to use a different way of evaluating the function (I guess the error
> must be in there) in order to get a good result?
>
Hi Kees,
Ted Ersek's PrecisionPlot (http://library.wolfram.com/infocenter/MathSource/715/) might help.
I sometimes use Plot[f[x]/.x->SetPrecision[xx,50],{xx,0,10}].
Hope that helps,
Peter