Plot[] of smooth function results in wildly fluctuating graph?
- To: mathgroup at smc.vnet.net
- Subject: [mg64794] Plot[] of smooth function results in wildly fluctuating graph?
- From: "KvS" <keesvanschaik at gmail.com>
- Date: Thu, 2 Mar 2006 19:28:37 -0500 (EST)
- Sender: owner-wri-mathgroup at wolfram.com
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?