New package for drawing direction fields with gnuplot
Subject: New package for drawing direction fields with gnuplot
From: Mark H Weaver
Date: Fri, 19 Nov 2010 20:07:36 -0500
Adam Majewski <adammaj1 at o2.pl> wrote:
> drawdf(f(x,y), [x,-2,2], [y,-2,2]);
>
> Unable to evaluate predicate y^2+x^2<4
Robert Dodier <robert.dodier at gmail.com> wrote:
> Evaluating f(x, y) with symbolic arguments triggers the error.
> Try postponing evaluation of f, e.g. drawdf(f, ...) (not sure if that works)
> or drawdf('(f(x, y)), ...).
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?
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.
Note that a system of two equations (for dx/dt and dy/dt) must be
specified as a list of two expressions. Passing a function call that
evaluates to a list of two values will not work.
Mark