/* [wxMaxima batch file version 1] [ DO NOT EDIT BY HAND! ]*/ /* [ Created by wxMaxima version 0.7.5 ] */ /* [wxMaxima: comment start ] Problem: Plot the saddle shaped surface z=y^2-x^2. The first method is simply to type y^2-x^2 in the INPUT box and then click the Plot 3D button. We modify the x-range and the y-range to be [-3,3]. [wxMaxima: comment end ] */ /* [wxMaxima: input start ] */ wxplot3d(y^2-x^2, [x,-3,3], [y,-3,3])$ /* [wxMaxima: input end ] */ /* [wxMaxima: comment start ] Note that we can plot the surface in an external window that allows us to rotate the surface by repeating the previous command with the wx part removed, i.e. using the plot3d command. Try it by right clicking the above command and using the Edit Input option. After deleting the wx press the keys Ctrl-Enter together. Our next method is to use the draw package. [wxMaxima: comment end ] */ /* [wxMaxima: input start ] */ load(draw); /* [wxMaxima: input end ] */ /* [wxMaxima: input start ] */ wxdraw3d(xaxis = true, yaxis = true, zaxis = true, xlabel = "X", ylabel = "Y", zlabel = "Z", palette = color, enhanced3d = true, surface_hide = true, explicit(y^2-x^2, x,-3,3, y,-3,3) )$ /* [wxMaxima: input end ] */ /* [wxMaxima: comment start ] We can make a contour plot with the levels z=-2,-1,0,1,2 using the following: [wxMaxima: comment end ] */ /* [wxMaxima: input start ] */ wxdraw3d(xaxis = true, yaxis = true, xlabel = "X", ylabel = "Y", explicit(y^2-x^2,x,-3,3,y,-3,3), contour_levels = {-2,-1,0,1,2}, contour = map ) $ /* [wxMaxima: input end ] */ /* [wxMaxima: comment start ] The contour plot reveals that the surface goes down if we walk along the x-axis and goes up if walk along the y-axis. The next 3d-plot shows both the surface and the contours together. Use your mouse to rotated the surface (when draw3d is used) to see that the above observation is indeed the case. [wxMaxima: comment end ] */ /* [wxMaxima: input start ] */ wxdraw3d(xaxis = true, yaxis = true, zaxis = true, xlabel = "X", ylabel = "Y", zlabel = "Z", palette = color, enhanced3d = true, surface_hide = true, explicit(y^2-x^2,x,-3,3,y,-3,3), contour_levels = {-2,-1,0,1,2}, contour = both ) $ /* [wxMaxima: input end ] */ /* [wxMaxima: input start ] */ draw3d(xaxis = true, yaxis = true, zaxis = true, xlabel = "X", ylabel = "Y", zlabel = "Z", palette = color, enhanced3d = true, surface_hide = true, explicit(y^2-x^2,x,-3,3,y,-3,3), contour_levels = {-2,-1,0,1,2}, contour = both ) $ /* [wxMaxima: input end ] */ /* [wxMaxima: comment start ] The last 3d-plot is an animation showing how the contours change from hyperbola opening out in the x-direction to hyperbolas opening out in the y-direction. In the graph below click your mouse in the plot window to select the plot and then use the slider bar on the top tool bar to change the contour. [wxMaxima: comment end ] */ /* [wxMaxima: input start ] */ with_slider_draw3d(t, makelist(.2*i,i,-10,10), xaxis = true, yaxis = true, zaxis = true, xlabel = "X", ylabel = "Y", zlabel = "Z", palette = color, enhanced3d = true, surface_hide = true, explicit(y^2-x^2,x,-3,3,y,-3,3), contour_levels = {t}, contour = both ) $ /* [wxMaxima: input end ] */ /* [wxMaxima: comment start ] [wxMaxima: comment end ] */ /* Maxima can't load/batch files which end with a comment! */ "Created with wxMaxima"$