>>>>> "Jaime" == Jaime Villate <villate at fe.up.pt> writes:
Jaime> On 11/05/2012 05:31 PM, Raymond Toy wrote:
Rupert> Raymond Toy <toy.raymond at gmail.com> writes:
>> >> This shouldn't be a problem with the current plot2d. It uses an
>> >> adaptive plotting algorithm to use more points where the curve is
>> >> changing too fast. If, by chance, plot2d tries to evaluate f(1),
>> >> maxima catches that error and pretends (I think) that there is a
>> >> discontinuity at that point and tries to add more points in the
>> >> neighborhood to get a better plot.
>> >>
>> >> Of course, if the discontinuity is very narrow and the number of
>> >> initial sample points is too sparse, plot2d will never see it and hence
>> >> never plot it. No surprise there.
>> >>
>> >> The adaptive plotter isn't used for any other kind of plot such as
>> >> parametric plots, unfortunately.
>>
Rupert> Well, at least on my machine,
>>
Rupert> f(x) := signum(x) * abs(x)^(-1/n)$
Rupert> plot2d(f(x), [x, -1, 1.1]), n=10;
>>
Rupert> displayed the expected behaviour. Maybe I've misunderstood what's going
Rupert> on.
>>
>> Ok, I'm not sure what you expect the behavior to be. With our
>> example, I see a curve drawn on the y-axis from about y=-2.25 to
>> y=2.25. If I change the plot limits to [x, -1,1], I see the same
>> curve, except there is no line drawn on the y-axis.
>>
>> Which of these is your expected behavior? Or were you expecting
>> something else?
>>
Jaime> In my opinion, the result when the error is caught (domain [x, -1,
Jaime> 1]) is better than the result when it is not detected (domain [x, -1,
Jaime> 1.1]). It would be nice if overflows in the slope were also caught, so
Jaime> the plot:
Jaime> plot2d (0.7*signum(x), [x,-1,1]);
Jaime> would also show a discontinuity in x=0, rather than the current
Jaime> behavior where a vertical line is shown at x=0.
Yes, these would all be nice to have. I think the problem is what can
you actually do numerically? How do I tell (numerically) there's a
discontinuity? What is an overflow in slope?
The adaptive plotter doesn't subdivide regions for ever; it eventually
just gives up and returns its best guess.
Perhaps Richard's honest plotting using interval arithmetic is the
answer or at least part of the answer?
Ray