e-Mathematics > Calculus with wxMaxima
for 2110-004 student.

Surface and Contour

First we need the "draw" package.
--> load(draw)
In a 3D plot a function is described in the format

$\displaystyle \texttt{explicit}(f(x,y),x,x_{min},x_{max},y,y_{min},y_{max})
$

with the plotting range $ [x_{min},x_{max}]$ and $ [y_{min},y_{max}]$. In Maxima a function can be defined and works as a macro definition. For example, we can define

$\displaystyle f(x,y) = x y e^{-x^2-y^2}
$

by setting it with the symbol ":="
--> f(x,y) := x*y*exp(-x^2-y^2);

We can draw a surface when "enhanced3d=true" is specified.

--> draw3d(enhanced3d=true,
       explicit(f(x,y),x,-2,2,y,-2,2),
       user_preamble="unset colorbox")
We can obtain contour curves when "contour=map" is specified.
--> draw3d(color=red, contour=map, contour_levels=15,
       explicit(f(x,y),x,-2,2,y,-2,2),
       user_preamble="unset clabel")
We can draw both the surface and the contour curves when "contour=both" is specified.
--> draw3d(surface_hide=true, contour=both, contour_levels=15,
       explicit(f(x,y),x,-2,2,y,-2,2))

The option "contour_levels" can be chosen from the following styles.

The following wxm file include some of graphical demonstrations assigned in the class.


© TTU Mathematics