I am using Maxima 5.9.3 on a Debian system. The following odd situation
arose in trying to get a plot of a piecewise function.
(%i1) f(x):='(if x<=2 then x-3 else x^2);
2
(%o1) f(x) := '(if x <= 2 then x - 3 else x )
(%i2) plot2d([[parametric,t,f(t),[t,-1,2]],[parametric,t,f(t),[t,2
+0.000001,5]]],[x,-1,5]);
Maxima was unable to evaluate the predicate:
x <= 2
-- an error. Quitting. To debug this try debugmode(true);
(%i3)plot2d([[parametric,x,f(x),[x,-1,2]],[parametric,x,f(x),[x,2
+0.000001,5]]],[x,-1,5]);
(%o3)
(%i4) plot2d([[parametric,t,f(t),[t,-1,2]],[parametric,t,f(t),[t,2
+0.000001,5]]],[t,-1,5]);
Maxima was unable to evaluate the predicate:
x <= 2
-- an error. Quitting. To debug this try debugmode(true);
(%o4)
So, when f(x) is plotted with parameter t in a plot with domain variable
x the plot does not work. Plotting with parameter x in a plot with
domain variable x works just fine. Plotting with parameter t in a plot
with domain variable t does not work.
If the function f(x) had been defined as f(x):=x^2 all three of the
plots work just fine.
Why the different behaviours?
Bob
--
Dr. Robert J. Jerrard, Professor of Mathematics,
Concordia University College of Alberta,
7128 Ada Blvd., Edmonton, Alberta, T5B 4E4, Canada.
Phone: (780) 479-9291, Fax: (780) 474-1933.