New package for drawing direction fields with gnuplot



On 11/19/10, Mark H Weaver <mhw at netris.org> wrote:

> drawdf(f, ...) will not work with the current code.
>
> What is the recommended heuristic for deciding whether an expression
> should be interpreted as a function symbol?

Well, plot2d and various other functions (e.g., find_root)
call a Lisp function, COERCE-FLOAT-FUN, to construct
a Lisp function which returns a float. Various special
cases are handled, e.g. Maxima expression, Maxima function
name, lambda expression, Lisp function name, maybe some
others.

> drawdf('(f(x,y)), ...) seems to work, though I confess I did not
> consider that case when writing the code.  However, to plot a field of
> quadratic splines (field_degree=2) will require symbolic derivatives of
> f.  For this you can use gradef.  saddles_at() probably won't work
> unless you specify expressions that can be manipulated symbolically.

To compute derivatives, I don't see anything simpler than enumerating
the special cases you want to handle (e.g. function name, lambda
expression, general expression) and treating each one separately.

For better or worse, Maxima is, for the most part, happier with
general expressions, and functions aren't handled very well.
On some days I believe that integrate, diff, plot, etc should
take only functions as arguments ... not every day though.

best

Robert Dodier