* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
Download Physics 3730/6720 – Maple 1b – 1 Linear algebra, Eigenvalues and Eigenvectors
Euclidean vector wikipedia , lookup
Linear least squares (mathematics) wikipedia , lookup
Vector space wikipedia , lookup
Symmetric cone wikipedia , lookup
Exterior algebra wikipedia , lookup
Rotation matrix wikipedia , lookup
System of linear equations wikipedia , lookup
Covariance and contravariance of vectors wikipedia , lookup
Determinant wikipedia , lookup
Matrix (mathematics) wikipedia , lookup
Principal component analysis wikipedia , lookup
Non-negative matrix factorization wikipedia , lookup
Jordan normal form wikipedia , lookup
Orthogonal matrix wikipedia , lookup
Four-vector wikipedia , lookup
Cayley–Hamilton theorem wikipedia , lookup
Matrix calculus wikipedia , lookup
Gaussian elimination wikipedia , lookup
Perron–Frobenius theorem wikipedia , lookup
Singular-value decomposition wikipedia , lookup
Physics 3730/6720 – Maple 1b – 1 October 8, 2012 Linear algebra, Eigenvalues and Eigenvectors Maple session > with(linalg): _______________________________ > A := matrix([[1,2,3],[3,2,1],[1,0,-1]]); [1 2 3] [ ] A := [3 2 1] [ ] [1 0 -1] > b := vector([1,2,-1]); b := [1, 2, -1] _________________________________ > evalm(3 * b); [3, 6, -3] _________________________________ > y := evalm(A &* b); y := [2, 6, 2] Comments The linear algebra procedures are defined in the linalg package. The simple way to define a matrix is to list its values, row by row. Note the square brackets. Vectors (column vectors written as row vectors) are defined by listing their elements. To do matrix and vector products and see the result you need evalm. (Maple does it, otherwise, but silently.) Multiplication by scalars works with *, but multiplication of matrices with matrices and matrices with vectors requires the special multiplication operator &*. > eigenvals(A); The linear algebra package 1/2 1/2 computes eigenvalues and 0, 1 + 11 , 1 - 11 eigenvectors. The eigenvec_________________________________ tors are listed in brackets (in > eigenvectors(A); no particular order). The 1/2 [ 1/2 1/2 ] first number in the bracket is [1 + 11 , 1, {[2 + 11 , 4 + 11 , 1]}], the the eigenvalue (compare 1/2 [ 1/2 1/2 ] both results), the second is [1 - 11 , 1, {[2 - 11 , 4 - 11 , 1]}], the number of times that [0, 1, {[1, -2, 1]}] eigenvalue appears (multiplicity), and the third entry gives the eigenvector itself. 1 Maple session > inverse(A); Error, (in inverse) singular matrix _________________________________ > inverse(1 + A); [ 0 0 1] [ ] [-1/7 3/7 -1] [ ] [3/7 -2/7 0] > transpose(A); [1 3 1] [ ] [2 2 0] [ ] [3 1 -1] > linsolve(A,b); _________________________________ > linsolve(1+A,b); [-1, 12/7, -1/7] 2 Comments Since our matrix A has a zero eigenvalue, it has no inverse, but the matrix 1 + A has an inverse, which you get with inverse. The transpose. This is the way to solve Ax = b, but since A is singular, Maple refuses to do it. The matrix 1 + A is not singular, so we can get the answer for a different problem: (1 + A)x = b.