Next: Exercises Up: MA 1004 Laboratory Previous: Purpose

## Background

As we've seen in class, computing the curvature, , and the unit normal and tangent vectors is a tedious process, even for the simplest of curves. Fortunately, Maple procedures can be written to do these calculations and this lab will introduce you to the ones that we have written here at WPI as part of the CalcP package. As usual, before you can use any of these commands, you must load the package with the following command. Since some of the commands use the linalg package, it is probably a good idea to load it as well.

```  > with(linalg):
```

```Warning: new definition for   norm
Warning: new definition for   trace

```

```  > with(CalcP):
```

The list below gives the names of the procedures we will be using, as well as brief descriptions. Maple help screens are available for all of these procedures, so refer to them for further examples. To refresh your memories, the commands introduced in the previous lab are also listed.

VDiff
Differentiates vector-valued functions.
VPlot
Plots vector-valued functions in two and three dimensions.
VMag
Computes the magnitude of a vector.
ParamPlot
Animates parametric curves in two dimensions.
ParamPlot3D
Animates parametric curves in three dimensions.
Speed
Computes the speed of a particle moving on a path defined by a vector-valued function .
unitvect
Computes the unit vector associated with a vector .
tanvect
Computes the unit tangent vector, , for a vector-valued function .
normalvect
Computes the unit normal vector, , for a vector-valued function .
Curvature
Computes the curvature, , for a vector-valued function .

### Examples

For more examples, see the help screens for the individual procedures. Note that all of the procedures accept either Maple vectors or Maple lists as arguments. Note also that several of the procedures allow you to evaluate the result at a specific value of t by using a second argument of the form `t=a` (to evaluate at t=a). If the second argument is simply t, then the result of the procedure is an expression involving t. This does not apply to the VDiff command, however, where argumets after the first are used to indicate derivatives.

```  > circ := t -> vector([12*sin(t),12*cos(t)]);
```

```  > VDiff(circ(t),t);
```

```  > tanvect(circ(t),t);
```

```  > normalvect(circ(t),t);
```

```  > Curvature(circ(t),t);
```

```  > r := t -> vector([t,t^2]);
```

```  > tanvect(r(t),t);
```

```  > tanvect(r(t),t=0);
```

```  > tanvect(r(t),t=1);
```

Computing the unit normal vector is always more complicated than computing the unit tangent vector . In addition, Maple likes to do computations as generally as possible, which can cause complications. In particular, Maple assumes that all variables can be complex numbers. This isn't a good assumption in calculus, so the tanvect, normalvect, and Curvature procedures had to be written to give results that are real numbers. A side-effect of this is that results of the commands, especially the normalvect command, do not always appear in the simplest form. Consider the following example.

```  > normalvect(r(t),t);
```

The notation appears because Maple had to differentiate the absolute value function to obtain the normal vector. Recall that the deriviative of is 1 if x > 0 and -1 if x < 0. Maple's notation stands for the derivative of , evaluated at . Because Maple assumes that t can be complex, it allows for to be negative. In our calculations, can never be negative so the value of is simply 1.

This may seem like a pain, but it won't affect your ability to compute normal vectors at fixed values of t, as shown in the following examples, or plot normal vectors. Putting the absolute value in several of the CalcP package functions for curve comptations was a necessary evil, because leaving it out produced answers that were just plain wrong. By putting it in, the procedures give the correct answer, but in a form that is more complicated than we would like.

```  > normalvect(r(t),t=0);
```

```  > normalvect(r(t),t=1);
```

```  > Curvature(r(t),t);
```

The absolute value also appears in the output of the Curvature procedure, as shown above. This means that if you differentiate the output of the Curvature function, for example to find extreme values, you may see the Maple abs procedure in the results. You shouldn't be alarmed by this, just remember that the value will always be 1. Fortunately, the Maple solve command usually handles cases involving the abs procedure just fine.

In the following example, plots of a vector-valued function and its curvature are generated. You should compare the two plots and try to understand their relationships.

```  > plot(Curvature(r(t),t),t=-2..2);
```

```  > VPlot(r(t),t=-2..2);
```

The next few commands deal with a simple example of a curve known as a helix. In one of the exercises, you will be investigating a more general version of a helix, so you are encouraged to pay close attention to the following examples.

```  > h := t -> vector([cos(t),sin(t),t]);
```

```  > VPlot(h(t),t=0..4*Pi);
```

```  > ParamPLot3D(h(t),t=0..4*Pi);
```

```  > tanvect(h(t),t);
```

```  > Speed(h(t),t);
```

```  > Curvature(h(t),t);
```

```  > Curvature(h(t),t);
```

```  > normalvect(h(t),t);
```

Next: Exercises Up: MA 1004 Laboratory Previous: Purpose

William W. Farr
Wed Apr 5 15:41:18 EDT 1995