Math 4452 (Peh Ng)

Examples of ContourPlots  and Plot3D

Recall that  to plot z=f(x,y) with specified intervals of x and y,we used the command Plot3D in Multivariate Calculus (calc 3):

Plot3D[x^2 - y^2, {x,-2,2}, {y,-2,2}, Axes->True,AxesLabel->{"x-axis","y-axis","z-axis"}]

The command ContourPlot[f(x,y), {x,min,max},{y,min,max}] gives the contours of z=f(x,y).

ContourPlot[x^2 - y^2, {x,-2,2}, {y,-2,2}]

A contour plot gives you essentially a “topographic map” of a function, z=f(x,y). The contours are the curves, z=f(x,y)=k,so each curve joins points on the surface that have the same height (z-value).T he default is to have contours corresponding to a sequence of equally spaced z-values.Contour plots produced shaded areas in such a way that regions with higher z-values are lighter.

The following command allows you to disregard  the shading, and just show the level curves:

Show[%,ContourShading->False]

Plot3D[(y^(1.5))*(x^(2.5))/(Exp[3x+2y]), {x,0.2,2}, {y,0.2,2}, Axes->True,AxesLabel->{"x-axis","y-axis","z-axis"}]

ContourPlot[(y^(1.5))*(x^(2.5))/(Exp[3x+2y]), {x,0.2,2}, {y,0.2,2}, Axes->True,AxesLabel->{"x-axis","y-axis"}, ContourStyle->{{RGBColor[0,1,0]},{RGBColor[1,0,0]}}]

ContourPlot[(P^(1.5))*(H^(2.5))/(Exp[3H+2P]), {H,0.2,1.5}, {P,0.2,1.5}, Axes->True,AxesLabel->{"H,host-prey","P, parasite-predator"}, ContourStyle->{{RGBColor[0,1,0]},{RGBColor[1,0,0]}}]

ContourPlot[(P^(0.3))*(H^(2.5))/(Exp[3H+2P]), {H,0.02,1.5}, {P,0.02,1.5}, Axes->True,AxesLabel->{"H-host-prey","P-parasite-predator"}, ContourStyle->{{RGBColor[0,1,0]},{RGBColor[1,0,0]}}]

ContourPlot[(P^(1.5))*(H^(2.5))/(Exp[3H+5P]), {H,0.02,1.5}, {P,0.02,1.5}, Axes->True,AxesLabel->{"H-host-prey","P-parasite-predator"}]

a=1.9;
b=5;
m=2.8;
f=3.0

ContourPlot[(P^(a))*(H^(m))/(Exp[f*H+b*P]), {H,0.02,1.5}, {P,0.02,1.5}, Axes->True,AxesLabel->{"H-host-prey","P-parasite-predator"}]