DOC PREVIEW
MSU PHY 102 - worksheet03

This preview shows page 1 out of 3 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 3 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 3 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

Worksheet #3 - PHY102 (Spr. 2008)Matrices and linear algebraLast week we did vector operations with lists. T his we ek we introduceyou to matrices, their representation using lists and to some of the matrixoperations which Mathematica is able to do.Let us first see how to represent matrices in Mathematica as a list. Type“m={{a,b}, {c,d}}”. Now “type MatrixForm[m]”. Note that all of the Math-ematica operations must be applied to the list form of the matrix (not thematrix form). You can see that you get the matrix m with its elementsa, b, c, d in the usual form. You can think of this matrix as consisting of tworow vectors (a,b) and (c,d). Type “m[[1]]” and check you get the first rowvector (a,b). Now type “m[[1,1]]”; this will give you the 1st element of thefirst vector, namely a (notice that “m[[1]][[1]]” also does the same thing).Likewise, to access the element d, type “m[[2,2]]”. As you have done withvectors, you can perform algebraic operations on matrices. You can multiplya matrix with a vector. To see this, type “r={x,y}”. In order to take a dotproduct of the matrix m with this vector r, Type “m.r” (or Dot[m,r]). Nowtype “Dimensions[m]”. The output (2,2) verifies that the matrix m is a 2 ×2matrix.At times, you need to get the transpose of a matrix, which is obtainedby exchanging its off-diagonal elements (in this case the elements c and d).Type “t=Transpose[m]”. Now type “MatrixForm[t]”. You see that the ma-trix has diagonal elements the same but the elements c and d got interchangedwith respect to the original matrix m. Often we require the determinant ofa matrix, which is a scalar quantity constructed from the elements. Type“Det[m]” which will give you the determinant of the matrix m. Now type“Det[t]” and verify that the determinant is the same for the transposed ma-trix. A diagonal matrix has all off-diagonal elements set to zero. Type “Di-agonalMatrix[{e,f}]”. Now type “MatrixForm[DiagonalMatrix[{e,f}]]” (youcan type this by taking the cursor to the end of the output and pushing thereturn key. Mathematica will immediately give you a replica of the output1which you can use as partial input for further operations. This is a conve-nient way of avoiding the usual cut and paste).The “Inverse” of a matrix is the one which when multiplied by the originalmatrix produces a unit diagonal matrix (unit matrix, as it is often called).Type “mi=Inverse[m]”. Now take the product “h=m.mi” and check that his indeed a unit matrix ( you may have to perform “Simplify” on h). Ingeneral any n × n matrix has n eigenvalues and n eigenvectors. Type “Eigen-values[m]” followed by “Eigenvectors[m]” to see what they are for the matrixm.Assignment 3. - Hand in by 6pm Friday Feb. 1stProblem 1. A 2 × 2 matrix A is constructed from the following rows: (5,3)and (2,1).(i) Write it in matrix form.(ii) Find its determinant.(iii) Find its transpose.(iv) Find its inverse A−1.(v) Check A·A−1is a unit matrix.(vi) Find its eigenvalues and eigenvectors.Problem 2.(i) Find the solution to the following set of equations:2x − y + 2z = 2−x + 5y + z = 12x + y + 6z = 1(Hint: Write it as a matrix equation Ax=b, which has solution x = A−1b).Check that you have the solution by evaluating Ax − b.(ii) Try to find the solution to the following set of equations:1x + 2y − z = −0.41.3x − 3.2y + 1.3z = 12−2.5x − 5y + 2.5z = 1What does mathematica tell you? What does this mean? From a math-ematical point of view, explain why this set of equations does not have aunique solution. Write your answers in a text


View Full Document

MSU PHY 102 - worksheet03

Download worksheet03
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view worksheet03 and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view worksheet03 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?