Plotting singular functions



>>>>> "Vadim" == Vadim V Zhytnikov <vvzhy@mail.ru> writes:

    Vadim> Hi!

    Vadim> Presently Maxima wraps all plotted expression using
    Vadim> "coerce-float-fun' (plot.lisp).  The wrapper catches lisp
    Vadim> errors and returns either floating point value or T
    Vadim> if expression is singular or not well defined.
    Vadim> This is more or less OK with 2D plotting.  It seems that
    Vadim> plot2d is smart enough to ignore this non numerical values.
    Vadim> The only not quite well handled situation is the case
    Vadim> when plotted expression cannot be evaluated numerically,
    Vadim> e.g. contains unknown function or variable. In this
    Vadim> situation plot2d tries hard for quite long time
    Vadim> to build the plot and finally produces gnuplot error.

I think this issue could be solved if we could have more fine-grained
control with conditions and error-handlers.  I think every system we
support has conditions now, even gcl.

Then when we get a division by zero or an overflow, we know that the
problem was and can do the right thing.  Right now, every error is
treated as if it were an arithmetic error.  Not good, as you've seen.

    Vadim> Situation with 3D plots isn't so good.

Not sure what to do here.  I was hoping someone else would do an
adaptive 3D plotter.  But errors are still a problem.

    Vadim> Other quick and dirty solution is to make "coerce-float-fun"
    Vadim> return 0.0 instead of T for singular points.

The T is needed for the 2D adaptive plotting to work.  A non-number
signals a singularity, so the adaptive plotter can try more points.

Ray