Page 817 - Advanced_Engineering_Mathematics o'neil
P. 817

APPENDIX A A MAPLE Primer     797


                                           Multiply matrices A and B by

                                                                            A.B;

                                           Elementary row operations can be carried out very efficiently. Let A be an n × m matrix that
                                        has been entered. To interchange rows k and j and A to form a new matrix B, use

                                                                   B:=swaprow(A,k,j);
                                           To form S from A by multiplying row r of B by x, use

                                                                    S:=mulrow(A,r,x);

                                           And to form T from A by adding x times row r 1 to row r 2 ,use
                                                                 T:= addrow(A,r1,r2,x);

                                           Finally, suppose we select an element a k, j of A, and we want to proceed by elementary row
                                        operations to a new matrix W having zeros above and below this element. This is called pivoting
                                        about a k, j , and is done using the pivot command. Enter

                                                                     W:=pivot(A,k,j);
                                           W will be the matrix with zeros above and below a k, j , which could have been obtained by
                                        systematically applying row operations as needed to each of the rows above and below row k of
                                        the matrix.
                                           Using the pivot command, it is easy to find the reduced row echelon form of a matrix.
                                        Starting in the upper left corner of the matrix, pivot about the leading element of each row. The
                                        resulting matrix is nearly reduced. The only problem is that leading entries of nonzero rows may
                                        not equal 1. Just divide each nonzero row by its leading entry (using mulrow) to obtain leading
                                        entries of 1, resulting in a reduced row echelon matrix.
                                           The corresponding column operations can be achieved by replacing row with col in these
                                        commands. Such column operations may be useful, for example, in manipulating determinants.
                                           The elementary row and column operations of adding a scalar multiple of one row (column)
                                        to another are also useful in carrying out an LU factorization of matrix. The algorithms for
                                        forming the two matrices in such a factorization depend on these operations.
                                           The characteristic polynomial of a square matrix A is obtained using
                                                                      charpoly(A,x);

                                        in which the variable in which the polynomial will be written (here x) must be specified. The
                                        command

                                                                      eigenvals(A);

                                        lists the eigenvalues of A (real or complex), giving each eigenvalue according to its multiplicity.
                                        Note that the imaginary unit i is denoted I in the program. The command

                                                                      eigenvects(A);

                                        lists each eigenvalue, along with its multiplicity and for each eigenvalue, as many linearly
                                        independent eigenvectors as can be found for that eigenvalue. To illustrate, let

                                                    A:=Matrix(3,3,[[1,-1,0],[0,1,1],[0,0,-1]]);





                      Copyright 2010 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
                      Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.

                                   October 14, 2010  15:43  THM/NEIL   Page-797        27410_24_appA_p789-800
   812   813   814   815   816   817   818   819   820   821   822