Examples of different kinds of plots: Parametric, VectorField, 3D, Contour

Parametric plots

One of the homework problems asks about plotting a parametric curve along ith velocity and acceleration vectors. Here is a hopefully useful example.
We start by defining a list of how the coordinates depend on the parameter:

disp={r*Sin[ω*t]+ω*r*t,
r*Cos[ω*t]+r} /. {r->1,ω->1}

Note that values must be plugged in for r and ω to obtain numerical quantities suitable for plotting.
Differentiating once with respect to the parameter provides the velocity (or use the chain rule if your parameter is something other that time):

v = D[disp,t]

The parametric curve can now be plotted directly using parametric plot:

cycloid = ParametricPlot[{r*Sin[ω*t]+ω*r*t,
r*Cos[ω*t]+r} /. {r->1,ω->1},{t,0,2Pi}]

We can also plot the components of the velocity as functions of time:

Plot[v, {t,0,2Pi}]

However, it might be more enlightening to display velocity vectors based at the corresponding point on the curve, so let's construct a list of arrows that start at the point on the curve and end at the vector sum of displacement plus velocity.

vList = Table[Arrow[{disp,disp+v}], {t,0, 2Pi, Pi/4}]

Now use Show to display the list of Graphics elements (with a specified color):

arrowPlot =Show[Graphics[{Red,vList}]]

Now show the Graphics together to see velocity "superposed" on displacement.

Show[cycloid, arrowPlot]

Do likewise with the acceleration. As discussed briefly in class, the direction of the acceleration at the bottom of the path is significant, so make sure you include that acceleration vector.

Vector Fields, Contours, and 3D

When we deal with scalar functions of 2 variables, the function can be plotted using Plot3D. The example we discussed in class was f[x,y]=(x^2)+(y^2) :

f[x_,y_] := x^2+y^2

Plot3D[f[x,y], {x,-2,2},{y,-2,2} , PlotRange -> {0,4},
ClippingStyle -> None]

Since we re more interested in contours, we might change the mesh functions to show equal height contours:

Plot3D[f[x,y], {x,-2,2},{y,-2,2} , PlotRange -> {0,4},
ClippingStyle -> None, MeshFunctions -> {#3&},
AxesLabel -> {x,y,f[x,y]}]

Yes, you are probably going to have to look at the help documentation to figure out the syntax on that one...

Sometimes, we would be happy just to get these contours projected down onto the xy-plane which involved a ContourPlot:

contours = ContourPlot[f[x,y], {x,-2,2},{y,-2,2}, Contours -> 12]

Note that the behavior of these contours is related to the behavior of the gradient:

gradf = {D[f[x,y],x], D[f[x,y],y]}

Needs["VectorFieldPlots`"]

vfPlot = VectorFieldPlot[gradf, {x, -2,2}, {y, -2,2}]

Show[contours, vfPlot]

Questions to consider: How does the direction of the gradient relate to the constant value contours?
How does the magnitude of the gradient relate to the spacing between the contours? What happens to the gradient at an extremum of the function?