WI08Ma1bPrachelpset7

- x^2 x 1 = 0.0 then you get 1.61803 and-0.618034 In[1:= A = 88 1 2< 8 3 4<< Out[1]= 88 1 2< 8 3 4<< In[2:= B = 88 1 − 1< 8 3

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
Math 1b Practical February 26, 2009 Help with Mathematica for Problem Set 7 Remember that Mathematica works with matrices as a "list" of rows, each row being a "list". So the matrix A = 1 2 3 4 is entered and diplayed as {{1,2},{3,4}}. Use a dot (period) for matrix product, e.g. A.B . Transpose[A] returns the transpose of A . Inverse[A] returns the inverse of A . Eigenvalues[A] returns the list of eigenvalues. Eigenvalues [1.0 A] returns the eigenvalues in decimal form. Eigenvectors[A] returns the list of corresponding eigenvectors. CAUTION: These are the right eigenvectors, or column-eigenvectors. But they seem to be displayed as rows by Mathematica. If you want the matrix whose COLUMNS are the eigenvectors, you want Transpose[Eigenvectors[A]]. MatrixPower[A, n] returns the n-th power of A . IMPORTANT: Mathematica works symbolically unless you tell it otherwise. E.g. it will give the roots of x^2 - x - 1 = 0 as (1 +- Sqrt[5])/2 . If you want MMA to work in floating point, one way to do this is to introduce a decimal point anywhere. If you ask for the roots of
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: x^2 - x - 1 = 0.0 , then you get 1.61803 and -0.618034 . In[1]:= A = 88 1, 2 < , 8 3, 4 << Out[1]= 88 1, 2 < , 8 3, 4 << In[2]:= B = 88 1, − 1 < , 8 3, 2 << Out[2]= 88 1, − 1 < , 8 3, 2 << In[3]:= A.B Out[3]= 88 7, 3 < , 8 15, 5 << In[4]:= Inverse @ A D Out[4]= :8 − 2, 1 < , : 3 2 , − 1 2 >> In[5]:= Transpose @ A D Out[5]= 88 1, 3 < , 8 2, 4 << In[6]:= Eigenvalues @ 1.0 A D Out[6]= 8 5.37228, − 0.372281 < In[7]:= Eigenvectors @ A D Out[7]= :: − 4 3 + 1 6 J 5 + 33 N , 1 > , : − 4 3 + 1 6 J 5 − 33 N , 1 >> In[8]:= Eigenvectors @ 1.0 A D Out[8]= 88 − 0.415974, − 0.909377 < , 8 − 0.824565, 0.565767 << In[23]:= U = Transpose @ Eigenvectors @ 1.0 A D D Out[23]= 88 − 0.415974, − 0.824565 < , 8 − 0.909377, 0.565767 << In[24]:= A.U Out[24]= 88 − 2.23473, 0.30697 < , 8 − 4.88543, − 0.210625 << In[25]:= Inverse @ U D .A.U Out[25]= 98 5.37228, 0. < , 9 − 6.10623 × 10 − 16 , − 0.372281 == In[17]:= MatrixPower @ A, 10 D Out[17]= 88 4783 807, 6972 050 < , 8 10458 075, 15 241 882 <<...
View Full Document

This note was uploaded on 09/25/2010 for the course MATH 1bPRAC taught by Professor Wilson during the Winter '09 term at Caltech.

Page1 / 2

- x^2 x 1 = 0.0 then you get 1.61803 and-0.618034 In[1:= A = 88 1 2< 8 3 4<< Out[1]= 88 1 2< 8 3 4<< In[2:= B = 88 1 − 1< 8 3

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online