Chapter 3: Functions of Several Variables
Section 3.1: Functions and Their Graphs
Example 3.1.3
Graph the surface determined by z=fx,y=10−3 x2−7 y2, z∈−10,10, and on this surface, display the level curves. Under the surface, show the level curves projected onto the plane z=−15.
Solution
Figure 3.1.3(a) exhibits the requisite graph.
The Maple code that generates this graph is hidden behind the table cell in which the graph appears. A set of commands that will generate this graph appears in Table 3.1.3(a).
Via the plot3d command, the surface is drawn in such a way that its bottom edge lies in the plane z=−10.
The contour map appearing in green is a projection of the level curves into the plane z=−15, the gap being inserted so that these projections would be visible.
use plots, plottools in module() local p1,p2,p3,f,F,C; f:=10-3*x^2-7*y^2; C:=[-9,-7,-5,-3,-1,1,3,5,7,9]; F:=transform((x,y)->[x,y,-15]); p1:=plot3d(f,x=-sqrt(140/21)..sqrt(140/21),y=-(1/7)*sqrt(-21*x^2+140)..(1/7)*sqrt(-21*x^2+140),style=surfacecontour,contours=C): p2:=contourplot(f,x=-sqrt(140/21)..sqrt(140/21),y=-sqrt(140)/7..sqrt(140)/7,color=green,contours=C): p3:=display([F(p2),p1],view=-15..10,labels=[x,y,z],tickmarks=[5,3,5],axes=frame,orientation=[-60,75,0]); print(p3); end module: end use:
Figure 3.1.3(a) Surface and contour map
A graph such as shown in Figure 3.1.3(a) has to be constructed from several components; there isn't a single Maple command that will accomplish this task.
f≔10−3 x2−7 y2:F≔plottools:-transformx,y→x,y,−15:Y≔solvef=−10,y:C≔−9,−7,−5,−3,−1,1,3,5,7,9:X≔140/21:p1≔plot3df,x=−X..X,y=Y2..Y1,style=surfacecontour,contours=C:p2≔plots:-contourplotf,x=−X..X,y=−140/7..140/7,color=green,contours=C:plots:-displayFp2,p1,view=−15..10,labels=x,y,z,tickmarks=5,3,5,axes=frame,orientation=−60,75,0
Table 3.1.3(a) Maple commands for constructing Figure 3.1.3(a)
Because the contourplot command returns a 2D plot-structure; and plot3d, a 3D plot-structure, without intervention these two graphs could not be merged. Hence, the transform command is used to change each two-dimensional point in the 2D plot-structure to a three-dimensional point, with the third coordinate being z=−15. This action is embedded in the function F, and F is applied to the plot-structure for the contour map of f. To get the bottom of the surface to lie in the plane z=−10, it is graphed with the plot3d command using the domain y∈−Y,Y, where Y=140−21 x2/7, an expression obtained by solving f=−10 for yx. Assigning the list of contour values to the name C is just a device for uncluttering the argument lists for the plotting commands.
<< Previous Example Section 3.1 Next Example >>
© Maplesoft, a division of Waterloo Maple Inc., 2024. All rights reserved. This product is protected by copyright and distributed under licenses restricting its use, copying, distribution, and decompilation.
For more information on Maplesoft products and services, visit www.maplesoft.com
Download Help Document