On Sex, 2009-10-02 at 14:17 -0700, Lawvere, John wrote:
> Has anyone tried to use the function "contour_plot()" and increase the
> number of contours created?? The method shown in the HELP file hasn't
> worked for me under XMAXIMA, and I hope to have my Physics students
> use it.
My Physics students also make contour plots using Maxima, but since they
found contour_plot complicated to use, I made another function, ploteq,
which is already in Maxima since 5.18 but I have not documented yet.
It works in a similar way as contour_plot, for instance:
ploteq (x^2 + y^2, [x, -4, 4], [y, -4, 4]);
The difference is that the contours are not chosen according to a given
set of "levels" for the function, but rather you choose a point in the
(x,y) domain and the contour that goes through that point will be
plotted. You choose the points simply by clicking on the plot, or by
opening the Config menu, entering the x y coordinates (separated by
spaces) and pressing the "Enter" key. You can also give a
[trajectory_at, ...,...] option as it is explained in the documentation
for plotdf.
When you use variable names different from x and y, you must specify the
names of the variables names, as in the following case:
F(x, y) := x^3 + y^2;
ploteq (F(u,v), [u,v], [u, -4, 4], [v, -4, 4]);
Notice also that functions cannot be passed just by name as done in
contour_plot (F, [u, -4, 4], [v, -4, 4]);
You can also plot steepest descent lines, together with the contour
curves.
For example, the equipotentials and field lines for an electric dipole
with charges of 1 nC and -1 nC, 2 cm apart from each other shown in
http://fisica.fe.up.pt/dipole.pdf were obtained with the following
commands:
V: 900/((x+1)^2+y^2)^(1/2)-900/((x-1)^2+y^2)^(1/2)$
ploteq(V,[x,-2,2],[y,-2,2], [fieldlines, blue])$
I hope this helps.
Regards,
Jaime Villate