Maple has several useful functions for working with vectors. This lab
provides a brief introduction to the most basic
commands. All of the commands used in this lab come from the
Maple `linalg` and the `CalcP` packages, which must be
loaded before
any of the commands can be used.

Here is a list of the Maple functions we will be using from the
`linalg`
package. Note that these functions form only a small subset of the
package, which is designed primarily for linear algebra. Examples for
some of the commands are given below, more examples can be found in the `help` screens for each command. Several of these commands appeared in
the previous lab, so you might want to refer back to it.

**vector**- Used to define a vector.
**scalarmul**- Multiplies a vector by a scalar or a matrix by a scalar.
**innerprod**- Computes the dot product of two vectors.
**crossprod**- Computes the cross product of two vectors.
**evalm**- Evaluates expressions involving vectors.
**norm**- Computes the norm, or magnitude, of a vector. For reasons explained below, the use of this command is not recommended. A better alternative for our purposes is to use the square root of the inner product of a vector with itself. Examples appear below.

This is a list of the commands from the `CalcP` package that
are appropriate for this lab. Several should be familiar from the
previous lab.

**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.
**unitvect**- Computes the unit vector associated with a vector .
**Curvature**- Computes the curvature, , for a vector-valued function .

The first set of examples below demonstrates how to compute linear combinations of vectors, dot and cross products, magnitudes, and vector components for fixed vectors.

> with(linalg):

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

> a := vector([2,13,-6]);

> b := vector([5,-4,17]);

> evalm(a+b);

> evalm(5*a-2*b);

> innerprod(a,b);

> crossprod(a,b);

> crossprod(b,a);

> innerprod(a,crossprod(a,b));

The next two commands show two different ways to compute the magnitude
of a vector. The first way uses the `norm`
command. Note the `2` as the second argument of the command. This
`2` *has* to be there, or else Maple uses a different norm
than the one we want. The second way, using the fact that
, is probably the
preferred one.

> norm(a,2);

> sqrt(innerprod(a,a));

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 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. Note the use of the `axes`
option in the `VPlot` command. Including axes in a plot is
often helpful in visualizing a curve in three dimensions. Also, recall
that if you click on a plot, controls appear in the context bar that
allow you to modify the plot, including changing the axes style and
rotating the plot. If you have trouble doing this, ask for help.

Note also
that we've used the `linalg` command `vector` to define
the function instead of the simpler list notation we
used in the previous lab. The commands in the `CalcP` package
can handle either notation, but the commands in the `linalg`
package require you to use the `vector` command to define fixed
vectors or vector-valued functions.

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

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

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

> Curvature(h(t),t);

- Use Maple to compute the following, given that
,
, and
.
- .
- .

- As discussed in the text, the curve associated with a function
of the form

where is a positive constant and is an arbitrary constant, is called a circular helix.- Compute the velocity and acceleration for this curve. Using the
`VDiff`command is probably the easiest way. - Show that the speed is constant. That is, show that the speed is independent of .
- Verify that the velocity and the acceleration are perpendicular, and explain why this means that the tangential acceleration is zero. You may need to look in the background section of the previous lab to find the equations that will help you answer this question. If you want, you can either leave space to write your explanation in by hand or put it on a separate sheet of paper.

- Compute the velocity and acceleration for this curve. Using the
- Consider again the circular helix
.
- Compute the curvature of the circular helix.
- Compute the quantity

It should be the same as the curvature. Explain why this is true for the circular helix. If you want, you can either leave space to write your explanation in by hand or put it on a separate sheet of paper.

- Compute values of and that will give you a circular helix with radius of curvature and speed . Include a graph of your helix over the interval .

2001-03-27