Contour Plots\302\2512006, Russell Blyth, email: blythrd@slu.eduIn this worksheet we explore contour plots and their relationship to the shape of the graph of a function.restart;
with(plots):The contourplot and contourplot3d commands allow us to view level curves of functions. We start with a nice example.contourplot(x^2+y^2, x = -3..3, y = -3..3);Note that the darker (red) contours are at lower levels and the lighter (yellow) contours are at higher levels.Based on the contour plot, describe the shape before moving on to the next command:To see the surface at the same time, use contourplot3d:contourplot3d(x^2+y^2, x = -3..3, y = -3..3, axes = normal, filled = true, transparency = .2);Rotate the view of the 3d graph so you are looking down the z-axis (set both LUklbXJvd0c2Iy9JK21vZHVsZW5hbWVHNiJJLFR5cGVzZXR0aW5nR0koX3N5c2xpYkdGJzYjLUkjbWlHRiQ2JVEpJnZhcnBoaTtGJy8lJ2l0YWxpY0dRJmZhbHNlRicvJSxtYXRodmFyaWFudEdRJ25vcm1hbEYn and LUklbXJvd0c2Iy9JK21vZHVsZW5hbWVHNiJJLFR5cGVzZXR0aW5nR0koX3N5c2xpYkdGJzYjLUkjbWlHRiQ2JVEoJnRoZXRhO0YnLyUnaXRhbGljR1EmZmFsc2VGJy8lLG1hdGh2YXJpYW50R1Enbm9ybWFsRic= to 0); also set filled=false to remove the surface.You can specify the heights at which level curves should be drawn using the contours option, and you can specify the color gradient to be used using the coloring option:contourplot3d(x^2+y^2, x = -3 .. 3, y = -3 .. 3, contours = [0, 1, 2, 4, 5], axes = normal, filled = true, transparency = .2, coloring = [blue, green]);Exercises1) Examine the contours of the function LUklbXJvd0c2Iy9JK21vZHVsZW5hbWVHNiJJLFR5cGVzZXR0aW5nR0koX3N5c2xpYkdGJzYlLUkjbWlHRiQ2I1EhRictRiM2Ji1GLDYlUSJ6RicvJSdpdGFsaWNHUSV0cnVlRicvJSxtYXRodmFyaWFudEdRJ2l0YWxpY0YnLUkjbW9HRiQ2LVEiPUYnL0Y4USdub3JtYWxGJy8lJmZlbmNlR1EmZmFsc2VGJy8lKnNlcGFyYXRvckdGQi8lKXN0cmV0Y2h5R0ZCLyUqc3ltbWV0cmljR0ZCLyUobGFyZ2VvcEdGQi8lLm1vdmFibGVsaW1pdHNHRkIvJSdhY2NlbnRHRkIvJSdsc3BhY2VHUSwwLjI3Nzc3NzhlbUYnLyUncnNwYWNlR0ZRLUYjNilGKy1GIzYjLUklbXN1cEdGJDYlLUYsNiVRInhGJ0Y0RjctSSNtbkdGJDYkUSIyRidGPi8lMXN1cGVyc2NyaXB0c2hpZnRHUSIwRictRjs2LVEiK0YnRj5GQEZDRkVGR0ZJRktGTS9GUFEsMC4yMjIyMjIyZW1GJy9GU0Zjby1GIzYjLUZZNiUtRiw2JVEieUYnRjRGN0ZobkZcby1GOzYtUSgmbWludXM7RidGPkZARkNGRUZHRklGS0ZNRmJvRmRvLUYjNiVGWC1GOzYtUTEmSW52aXNpYmxlVGltZXM7RidGPkZARkNGRUZHRklGS0ZNL0ZQUSYwLjBlbUYnL0ZTRmVwRmdvRitGK0Yr for the domain x = -4..4 and y = -4..4.contourplot(x^2+y^2-x^2*y^2, x = -4 .. 4, y = -4 .. 4, contours = [-4, -3, -2, -1, 0, .25, .5, .75, 1, 2, 3, 4], grid = [50, 50]);Write a sentence or to describing the surface before executing the next command:contourplot3d(x^2+y^2-x^2*y^2, x = -4 .. 4, y = -4 .. 4, view = -5 .. 5, contours = [-4, -3, -2, -1, 0, .25, .5, .75, 1, 2, 3, 4], grid = [50, 50], axes = normal);If the new plot gives you additional insight, modify your description of the surface. Do this before executing the next command.contourplot3d(x^2+y^2-x^2*y^2, x = -4 .. 4, y = -4 .. 4, view = -5 .. 5, contours = [-4, -3, -2, -1, 0, .25, .5, .75, 1, 2, 3, 4], grid = [50, 50], filled = true, axes = normal);How well does the surface match your description based on the contour plots?2) Examine the contours of the function LUklbXJvd0c2Iy9JK21vZHVsZW5hbWVHNiJJLFR5cGVzZXR0aW5nR0koX3N5c2xpYkdGJzYlLUkjbWlHRiQ2I1EhRictRiM2Ji1GLDYlUSJ6RicvJSdpdGFsaWNHUSV0cnVlRicvJSxtYXRodmFyaWFudEdRJ2l0YWxpY0YnLUkjbW9HRiQ2LVEiPUYnL0Y4USdub3JtYWxGJy8lJmZlbmNlR1EmZmFsc2VGJy8lKnNlcGFyYXRvckdGQi8lKXN0cmV0Y2h5R0ZCLyUqc3ltbWV0cmljR0ZCLyUobGFyZ2VvcEdGQi8lLm1vdmFibGVsaW1pdHNHRkIvJSdhY2NlbnRHRkIvJSdsc3BhY2VHUSwwLjI3Nzc3NzhlbUYnLyUncnNwYWNlR0ZRLUYjNidGKy1GIzYjLUklbXN1cEdGJDYlLUYsNiVRInhGJ0Y0RjctSSNtbkdGJDYkUSIzRidGPi8lMXN1cGVyc2NyaXB0c2hpZnRHUSIwRictRjs2LVEoJm1pbnVzO0YnRj5GQEZDRkVGR0ZJRktGTS9GUFEsMC4yMjIyMjIyZW1GJy9GU0Zjby1GIzYmRmVuLUY7Ni1RMSZJbnZpc2libGVUaW1lcztGJ0Y+RkBGQ0ZFRkdGSUZLRk0vRlBRJjAuMGVtRicvRlNGW3AtRiM2Iy1GWTYlLUYsNiVRInlGJ0Y0RjctRmluNiRRIjJGJ0Y+RlxvRitGK0YrRis= for the domain x=-3..3 and y=-4..4 in the same way. (Use the same sequence of plots and answer the same questions as for Exercise 1.)JSFHThe option style=patchcontour in a standard plot3d command shows contours, but you lose the ability to control the contour levels:plot3d(x^3-x*y^2, x = -3 .. 3, y = -4 .. 4, axes = normal, style = patchcontour, transparency = .2);