next up previous
Next: About this document ... Up: Labs and Projects for Previous: Labs and Projects for

Subsections


MA 1024 Laboratory 2: Maple procedures for curve computations

Purpose

The purpose of this lab is to give you practice using Maple to compute curvature, cross products, and other vector operations .

Background

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 ${\bf v}$..
Curvature
Computes the curvature, $\kappa (t)$, for a vector-valued function ${\bf r}(t)$.

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

\begin{maplelatex}
\begin{displaymath}
{a} := [\,2\,13\,-6\,]\end{displaymath}\end{maplelatex}
  > b := vector([5,-4,17]);

\begin{maplelatex}
\begin{displaymath}
{b} := [\,5\,-4\,17\,]\end{displaymath}\end{maplelatex}
  > matadd(a,b);

\begin{maplelatex}
\begin{displaymath}[\,7\,9\,11\,]\end{displaymath}\end{maplelatex}
  > evalm(5*a-2*b);

\begin{maplelatex}
\begin{displaymath}[\,0\,73\,-64\,]\end{displaymath}\end{maplelatex}
  > innerprod(a,b);

\begin{maplelatex}
\begin{displaymath}
-144\end{displaymath}\end{maplelatex}
  > crossprod(a,b);

\begin{maplelatex}
\begin{displaymath}[\,197\,-64\,-73\,]\end{displaymath}\end{maplelatex}
  > crossprod(b,a);

\begin{maplelatex}
\begin{displaymath}[\,-197\,64\,73\,]\end{displaymath}\end{maplelatex}
  > innerprod(a,crossprod(a,b));

\begin{maplelatex}
\begin{displaymath}
0\end{displaymath}\end{maplelatex}

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 $\parallel
{\bf u} \parallel = \sqrt{{\bf u} \cdot {\bf u}}$, is preferred for reasons given in the examples below dealing with arbitrary vectors.

  > norm(a,2);

\begin{maplelatex}
\begin{displaymath}
\sqrt {209}\end{displaymath}\end{maplelatex}
  > sqrt(innerprod(a,a));

\begin{maplelatex}
\begin{displaymath}
\sqrt {209}\end{displaymath}\end{maplelatex}

As we've seen in class, computing the curvature, $\kappa$, 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]);

\begin{maplelatex}
\begin{displaymath}
{h} := {t} \rightarrow {\rm vector}(\,[\,{\rm cos}(\,{t}\,), 
{\rm sin}(\,{t}\,), {t}\,]\,)\end{displaymath}\end{maplelatex}
  > VPlot(h(t),t=0..4*Pi);
  > ParamPlot3D(h(t),t=0..4*Pi);

  > Curvature(h(t),t);

\begin{maplelatex}
\begin{displaymath}
{\displaystyle \frac {1}{2}}\end{displaymath}\end{maplelatex}

Exercises

1.
Use Maple to compute the following, given that ${\bf a} = (1, 12,
3)$ and ${\bf b} = (11, -1, 4)$.
(a)
$3{\bf a} \cdot {\bf b}-\parallel{\bf a}\parallel \parallel{\bf b}\parallel$.
(b)
${\bf a} \times ({\bf a} + 2{\bf b})$.
(c)
Find a vector that is orthogonal to both ${\bf a}$ and ${\bf
b}$. Show that this vector is actually orthogonal to ${\bf a}$ and ${\bf
b}$ using what you know about the dot product.
(d)
Explain why it is true that

\begin{displaymath}
2 {\bf a} \times {\bf b} = {\bf a} \times ({\bf a} + 2 {\bf b}).\end{displaymath}

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 $\displaystyle {\bf u} = e^t \sin t {\bf i} + e^t \cos t {\bf j} +
5t^2 {\bf k}$ and $\displaystyle {\bf v} = \sqrt{t} {\bf i} -
\frac{1}{t^2+4} {\bf j} + t \ln t {\bf k}$,
(a)
Evaluate $\displaystyle \frac{-{\bf u} + 3{\bf v}}{\parallel
{\bf u} \parallel}, t = 1$
(b)
$-2{\bf u} \times ({\bf u} \times {\bf v})$, $\displaystyle t=\frac{\pi}{2}$ radians

3.
The cornu spiral is given by the equations:

\begin{displaymath}
x(t) = \int_0^t \cos (\frac{u^2}{2})~du \hspace{5ex} y(t) =
\int_0^t \sin (\frac{u^2}{2})~du \end{displaymath}

(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

\begin{displaymath}
{\bf r}(t) = a\cos(t){\bf i} + a\sin(t){\bf j} + b
t{\bf k},\end{displaymath}

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$\pi$ 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$\pi$) and there are about $2.9 \times 10^{8}$ complete turns. Estimate the total length of each helix.


next up previous
Next: About this document ... Up: Labs and Projects for Previous: Labs and Projects for

Christine Marie Bonini
3/31/1999