CHAPTER 3

Maple Arrays and Linear Algebra


The following topics will be covered:

3.1 Discussion
3.2 Array Definition
3.3 Linear Algebra
3.4 Matrix Algebra

3.1 Discussion

Sets and lists of objects can be defined in Maple, but care must be taken to distinguish between them. Sets are unordered, distinct expressions and are defined with braces:

Lists are ordered sequences of expressions and appear enclosed in square brackets:

Since there is an order to sets, we can extract the kth expression in them as shown.

More complex sets and lists can be defined using braces within braces, square brackets inside other square brackets or even mixing sets anf lists:

If we define three sets of lists each containing two elements, we produce something that looks similar to an array:

Indexing to locate individual elements in a1 is accomplished by first extracting a list from the outermost list and then getting an element in that list.

A very general arrangement of information in Maple is called a table. The help file for table gives some idea of the generality of such a structure. A special type of table is an array in which indexing of elements is done with integers. Arrays will be treated in this chapter, but many properties and techniques will be touched on only briefly. You should read the chapter on ``Arrays and Tables" in the Maple Language Reference Manual and use help to see what is stored on-line about:

if you need to make serious use of such structures.

We will be content in this chapter to look at the ways in which we can construct vectors and matrices and use them to solve engineering problems. We already know how to do this in MATLAB for numeric arrays, but we will find that Maple gives us ways to handle symbolic problems. In order to solve many problems of interest to engineers, we will need to be able to manipulate our arrays according to the laws of linear algebra. This will require the functions in the linear algebra package so that package must be loaded before we start such manipulations.


3.2 Array Definition

Use: ?array to understand some of the many ways that arrays may be formed in Maple. A three row by two column numeric array may be formed from the list a1 defined earlier in this chapter by:


3.3 Linear Algebra

To load the linear algebra package; simply type:


3.4 Matrix Algebra

Once we have defined arrays and loaded the linear algebra package, there are many operations that we can perform. Here are a few:


Continue on to Chapter 4
Return to Table of Contents