Linear Methods of Applied Mathematics

Linear equations and linear operators

(c) Copyright 1994-1997 by Evans M. Harrell II and James V. Herod. 
     All rights reserved.

Instructions

This notebook uses Mathematica  to perform calculations for Harrell and Herod's hypertext book, Linear Methods of Applied Mathematics.   The student needs only a basic knowledge of Mathematica  to use the notebook, which is designed both to show how to work problems in the text and to provide a template for using Mathematica  to work other problems of the student's own design.  

Calculations will be performed when the reader presses enter in a given calculation cell (bold print).  It is best to activate the cells in order, so that Mathematica  will be able to call on operators and functions defined in earlier cells.  Red color coding is used to warn the reader when a given calculation relies on an earlier one.

In this notebook we review how Mathematica  handles vectors.  In Mathematica's notation, vectors are represented as lists, that is, a string of items within braces: {2,3}. Mathematica manipulates them in a straightforward way.

Examples of basic vector operations

Addition of possibly complex-valued vectors (the square-root of -1 is denoted I):

{2,3} + {4 + I, 2}

The dot product:

{2,3}.{1,2}

Alternative syntax for the dot product:

Dot[{2,3},{1,2}]

Some examples for 4-component vectors, in the space C4.

{1,2,3,4} +{1,0,-1,-2}

{1,2,3,4}.{1,0,-1,-2}

% == 1 * 1 + 2 * 0 + 3 *(-1) + 4 *(-2)

(% refers to the result of the previous calculation in Mathematica, and you need double == to indicate that the entire expression is regarded as a logical variable.)

Matrices in Mathematica

In Mathematica a matrix is a list of lists - after all it consists of a string of row vectors:

In:= m1 := {{1,0,I},{-1,Pi,2+I}}

In:= m2 := {{2,-I,0},{-1,-Pi,2-I}}

In:= m1 + m2

Out= {{3, -I, I}, {-2, 0, 4}}

In:= MatrixForm[%]

Out//MatrixForm= 3    -I   I

                 -2   0    4

(A useful display option particularly for big matrices.)

In:= 5 m1

Out= {{5, 0, 5 I}, {-5, 5 Pi, 10 + 5 I}}