** Next:** About this document ...
**Up:** Labs and Projects for
** Previous:** Labs and Projects for

Maple has several useful functions for working with vectors. This lab
provides a brief introduction to the most basic
such 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 this
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.
**matadd**- Adds two vectors or two matrices together.
**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.

**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]);

> matadd(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 preferred for
reasons given in the examples below dealing with arbitrary vectors.

> 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.

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

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

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

> Curvature(h(t),t);

- 1.
- Use Maple to compute the following, given that and .
- (a)
- .
- (b)
- .
- (c)
- Find a vector that is orthogonal to both and . Show that this vector is actually orthogonal to and using what you know about the dot product.
- (d)
- Explain why it is true that Note - just computing both sides of the equation and comparing is not a sufficient explanation. Your explanation must include references to properties of the cross product.

- 2.
- Use Maple to compute the following, given the vector functions
and ,
- (a)
- Evaluate
- (b)
- , radians

- 3.
- The cornu spiral is given by the equations:
- (a)
- Plot the spiral parametrically for
*t*= -5..5. - (b)
- Find the arc length of the curve from
*t*= 0 to*t*=*a*for*a*>0. If you have forgotten the arc length formula, look in the book. - (c)
- Find the curvature of the graph when t = a.
- (d)
- What is the relationship between the arc length of the curve and its curvature. Use the MAPLE help section to define signum.

- 4.
- Consider the helix
where
*a*and*b*are constants.- (a)
- Plot the helix parametrically for differing values of a (
*a*>0) and b (*b*>0) over t = 0..4 and explain how the values of a and b affect the final shape of the curve. To more easily see the changes, it will help to include a set of axes with each of your graphs since they will all have the same shape. (Read (b) now, it will save you time in the end.) - (b)
- Compute the curvature for a general helix (as given above). Alter the values of a and b in your answer and relate the results to your findings from part (a).
- (c)
- The shape of a helix occurs naturally in the model of DNA (the genetic
material found in all living cells). In 1953, James Watson and Francis Crick
showed that the structure of the DNA Molecule is that of two intertwined
helices linked with cross bars.
The radius of each helix is about 10 angstroms (1

*angstrom*= 10^{-8}). Each helix rises about 34 angstroms during each complete turn (a turn being from 0 to 2) and there are about complete turns. Estimate the total length of each helix.

3/31/1999