JustEnoughMapleLinAlg.mws

Linear Algebra Powertool

Just Enough Maple

Worksheet by Michael K. May, S.J. - revised by Russell Blyth

This worksheet is intended to give you just enough Maple to let you run the Maple worksheets for Linear Algebra.

>

Starting and Saving:

When you start a prepared worksheet, you should get a warning message that the worksheet is locked and changes cannot be saved. Instead you should choose "save as" from the file menu, pick a new name for the worksheet (a name that identifies the worksheet as yours), and save your work. (Do this now.)

Executing sections:

A Maple worksheet contains executable lines where Maple does mathematics. These lines begin with an input prompt (a ">") and are in red. To execute those sections, place the cursor anywhere in the command section and hit the "enter" or "return" key. Maple will execute the code and move the cursor down to the next input section.

Execute the code section below now.

> answer := 1 + 1;
answer;

answer := 2

2

Notice that in Maple commands end with a semicolon and values are assigned to a variable with the ":=" symbol.

Typing in commands:

Since this is a math course, the worksheets you do will have exercises embedded in them. You need to be able to type in your own commands. At the input prompt below, enter the command

myanswer := 1 + 2;

to assign the value of 3 to the variable myanswer. (Notice that there is no space in myanswer.)

>

For some of the exercises you need to use a series of commands. This raises the two practical questions:

Answers:

You continue an input section to a second line by typing a shift-return.

You insert a new input prompt by either going to the insert menu, select execution group, after paragraph, or by typing flower-J, where "flower" is the mac command key.

Enter the command sequence:

answer1 := 1 +3;

answer1;

on two lines at the single cursor below. Then insert two execution groups below it and reenter the commands in separate execution groups.

>

Adding text

When doing mathematics exercises, it is important to answer the question asked, rather than simply showing some uninterpreted computations. Thus you need to be able to add explanatory comments to your computations, even if it is simply, "The answer is ..."

To add a text section, either insert an execution group and convert it to text with flower-t, or use the insert menu to insert a paragraph.

Annotate your work in the previous section with the comment that "Maple shows us that 1 + 3 = 4".

An obvious annotation you want on all worksheets is your name. On all worksheets after this one, the first thing you should do after opening it is to add a line under the title that gives the name of everyone in the group that is working on the worksheet, along with your group name. (Add your name to this worksheet now,)

>

Cutting and Pasting

Some of the exercises involve several lines of code that follow an example with only minor modifications. Obviously you could retype everything, but that is too much work. The easier method is to

Copy the two command line section that assigns a value to answer1 above. Paste it in below and modify it to assign a value to answer2.

>

Loading extra packages:

Much of the work we we do uses special commands that are in a number of special add-on packages of commands. In particular, we will want to load packages with commands for linear algebra, and for plotting. Thus the first execution group of our worksheets will generally be:

> with(linalg): with(plottools): with(plots):

Warning, the protected names norm and trace have been redefined and unprotected

Warning, the names arrow and changecoords have been redefined

Reloading a worksheet:

Some of the worksheets will be done in class, but they are generally designed to be long enough that you will have to come back after class to finish them. When you reopen a worksheet, you should be aware that Maple will only remember what you have done during that Maple session instead of what you did earlier on the worksheet. Thus you will need to re-execute sections that define quantities and terms you are using. In particular, you should start by re-executing the line that loads in extra packages.

>

Saving and printing:

It is generally a good idea to save your work at least every 10 minutes. (Machines crash at the most inconvenient times. People who work with computers learn that "Murphy was an optimist".) The last thing you want to do with a worksheet is to save it to disk and then to print a copy so that you can turn it in. (Do this now.)

>

>