(* Content-type: application/mathematica *) (*** Wolfram Notebook File ***) (* http://www.wolfram.com/nb *) (* CreatedBy='Mathematica 6.0' *) (*CacheID: 234*) (* Internal cache information: NotebookFileLineBreakTest NotebookFileLineBreakTest NotebookDataPosition[ 145, 7] NotebookDataLength[ 13499, 440] NotebookOptionsPosition[ 8041, 288] NotebookOutlinePosition[ 11786, 392] CellTagsIndexPosition[ 11051, 372] WindowTitle->Lecture 09 MIT 3.016 (Fall 2011) \251 W. Craig Carter \ 2003--2011 WindowFrame->Normal*) (* Beginning of Notebook Content *) Notebook[{ Cell["Matrix Eigenvalues and Eigenvectors", "Title"], Cell[CellGroupData[{ Cell["Calculating Eigenvalues and Eigenvectors", "Subtitle"], Cell[CellGroupData[{ Cell["\<\ Initialization Steps: Define a 2\[Times]2 matrix and compute its eigensystem\ \>", "Text", CellDingbat->"\[FilledDownTriangle]"], Cell[BoxData[{ RowBox[{ RowBox[{"mtemp", "=", RowBox[{"DiagonalMatrix", "[", RowBox[{"{", RowBox[{ RowBox[{"2", " ", "Pi"}], ",", "4"}], "}"}], "]"}]}], ";"}], "\[IndentingNewLine]", RowBox[{"mtemp", "//", "MatrixForm"}]}], "Input"], Cell[BoxData[ TagBox[ RowBox[{"msim", "=", RowBox[{ RowBox[{"Transpose", "[", RowBox[{ RowBox[{"RotationTransform", "[", FractionBox["\[Pi]", "4"], "]"}], "[", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"1", ",", "0"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "1"}], "}"}]}], "}"}], "]"}], "]"}], ".", "mtemp", ".", RowBox[{ RowBox[{"RotationTransform", "[", FractionBox["\[Pi]", "4"], "]"}], "[", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"1", ",", "0"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "1"}], "}"}]}], "}"}], "]"}]}]}], Function[BoxForm`e\$, MatrixForm[BoxForm`e\$]]]], "Input"] }, Closed]], Cell[BoxData[{ RowBox[{ RowBox[{"mymatrix", " ", "=", " ", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"2", "+", "Pi"}], ",", RowBox[{ RowBox[{"-", "2"}], "+", "Pi"}]}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{ RowBox[{"-", "2"}], "+", "Pi"}], ",", RowBox[{"2", "+", "Pi"}]}], "}"}]}], "}"}]}], ";"}], "\[IndentingNewLine]", RowBox[{"mymatrix", "//", "MatrixForm"}]}], "Input"], Cell["Solve the characteristic equation for the two eigenvalues:", "Text", CellTags->"mtag:09:characteristic_equation"], Cell[BoxData[ RowBox[{"Solve", "[", RowBox[{ RowBox[{ RowBox[{"Det", "[", RowBox[{"mymatrix", " ", "-", " ", RowBox[{"\[Lambda]", " ", RowBox[{"IdentityMatrix", "[", "2", "]"}]}]}], "]"}], "\[Equal]", " ", "0"}], ",", "\[Lambda]"}], "]"}]], "Input", CellTags->{"mtag:09:IdentifyMatrix[]", "mtag:09:Det[]", "mtag:09:Solve[]"}], Cell["Compute the eigenvectors:", "Text", CellTags->{ "mtag:09:Eigenvectors[]", "mtag:09:eigenvectors__example_of_computation"}], Cell[BoxData[ RowBox[{"Eigenvectors", "[", "mymatrix", "]"}]], "Input"], Cell[BoxData[ RowBox[{ RowBox[{"{", RowBox[{"evec1", ",", " ", "evec2"}], "}"}], " ", "=", " ", RowBox[{"Eigenvectors", "[", "mymatrix", "]"}]}]], "Input", CellTags->"mtag:09:eigenvector_column_matrix__example"], Cell[TextData[{ StyleBox["Eigensystem", FontWeight->"Bold"], " will solve for eigenvalues and corresponding eigenvectors in one step:" }], "Text"], Cell[BoxData[ RowBox[{"Eigensystem", "[", "mymatrix", "]"}]], "Input", CellTags->"mtag:09:Eigensystem[]"], Cell["\<\ Note the output format above: the first item in the list is a list of the two \ eigenvalues; the second item in the list is a list of the two corresponding \ eigenvectors. Thus, the eigenvector corresponding 2 \[Pi] is (1,1).\ \>", "Text"] }, Closed]], Cell[CellGroupData[{ Cell["Coordinate Transformations; The Eigenbasis", "Subtitle"], Cell[BoxData[{ RowBox[{ RowBox[{"simtrans", "=", " ", RowBox[{ RowBox[{"{", RowBox[{"evec2", ",", "evec1"}], "}"}], "//", "Transpose"}]}], ";"}], "\[IndentingNewLine]", RowBox[{"simtrans", "//", "MatrixForm"}]}], "Input", CellTags->{ "mtag:09:Transpose[]", "mtag:09:Inverse[]", "mtag:09:Simplify[]", "mtag:09:MatrixForm[]"}], Cell[BoxData[ RowBox[{ RowBox[{ RowBox[{ RowBox[{"Inverse", "[", "simtrans", "]"}], ".", "mymatrix", ".", "simtrans"}], "//", "Simplify"}], "//", "MatrixForm"}]], "Input", CellTags->"mtag:09:simularity_transformation__example"], Cell[CellGroupData[{ Cell["\<\ Shows that the transformation to the diagonal basis is a rotation of \[Pi]/4 \ \ \>", "Text", CellDingbat->"\[FilledDownTriangle]"], Cell["\<\ Which makes sense considering in initialization steps that mymatrix was \ created with a rotation on \[Pi]/4 of a diagonal matrix\ \>", "Text", CellDingbat->"\[FilledDownTriangle]"] }, Open ]], Cell["\<\ The next command produces an orthonormal basis of the eigenspace (i.e., the \ eigenvectors are of unit magnitude):\ \>", "Text"], Cell[BoxData[ RowBox[{ TagBox[ RowBox[{"Orthogonalize", "[", RowBox[{ RowBox[{"Eigenvectors", "[", "mymatrix", "]"}], ",", RowBox[{"Method", "\[Rule]", "\"\\""}]}], "]"}], Function[BoxForm`e\$, MatrixForm[BoxForm`e\$]]], "//", "MatrixForm"}]], "Input", CellChangeTimes->{{3.398611256626045*^9, 3.398611260002604*^9}}, CellTags->"mtag:09:GramSchmidt[]"], Cell["\<\ The command RotationTransform computes a matrix that will rotate vectors ccw \ about the origin in two dimensions, by a specified angle:\ \>", "Text", CellChangeTimes->{{3.3986109079120007`*^9, 3.398610914494816*^9}}], Cell[BoxData[ RowBox[{ TagBox[ RowBox[{ RowBox[{"RotationTransform", "[", FractionBox["\[Pi]", "4"], "]"}], "[", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"1", ",", "0"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "1"}], "}"}]}], "}"}], "]"}], Function[BoxForm`e\$, MatrixForm[BoxForm`e\$]]], "//", "MatrixForm"}]], "Input", CellChangeTimes->{{3.398611265850281*^9, 3.3986112682316236`*^9}}, CellTags->"mtag:09:RotationMatrix2D[]"], Cell["\<\ This last result shows that the transformation to the eigenvector space \ involves rotation by \[Pi]/4--and that the matrix corresponding to the \ eigenvectors produces this same transformation\ \>", "Text", CellChangeTimes->{{3.398611127704159*^9, 3.398611154254594*^9}}], Cell[TextData[{ StyleBox["Here is a demonstration of the general result", FontWeight->"Plain"], " ", StyleBox["A", FontSlant->"Italic"], " ", Cell[BoxData[ FormBox[ StyleBox[ SubscriptBox[ FormBox[ OverscriptBox["x", "\[RightVector]"], TraditionalForm], "i"], FontWeight->"Plain"], TraditionalForm]]], StyleBox[" = ", FontWeight->"Plain"], Cell[BoxData[ FormBox[ SubscriptBox["\[Lambda]", "i"], TraditionalForm]]], StyleBox[" ", FontWeight->"Plain"], Cell[BoxData[ FormBox[ SubscriptBox[ FormBox[ OverscriptBox["x", "\[RightVector]"], TraditionalForm], "i"], TraditionalForm]], FontWeight->"Plain"], ", ", StyleBox["where ", FontWeight->"Plain"], Cell[BoxData[ FormBox[ OverscriptBox["x", "\[RightVector]"], TraditionalForm]], FontWeight->"Plain"], StyleBox[" is an eigenvector and \[Lambda]", FontWeight->"Plain"], " ", StyleBox["its corresponding eigenvalue: ", FontWeight->"Plain"] }], "Text"], Cell[BoxData[{"evec1", "\[IndentingNewLine]", "evec2"}], "Input"], Cell[BoxData[ RowBox[{"mymatrix", ".", "evec1"}]], "Input"], Cell[BoxData[ RowBox[{"mymatrix", ".", "evec2"}]], "Input"], Cell[TextData[{ "MatrixPower ", StyleBox["multiplies a matrix by itself n times\[Ellipsis]", FontWeight->"Plain"] }], "Text", CellTags->"mtag:09:MatrixPower[]"], Cell[BoxData[ RowBox[{ RowBox[{ RowBox[{"MatrixPower", "[", RowBox[{"mymatrix", ",", "12"}], "]"}], ".", "evec2"}], "//", "Simplify"}]], "Input"] }, Closed]] }, ScreenStyleEnvironment->"Presentation", CellGrouping->Manual, WindowSize->{1025, 616}, WindowMargins->{{314, Automatic}, {Automatic, 106}}, WindowTitle->"Lecture 09 MIT 3.016 (Fall 2011) \[Copyright] W. Craig Carter \ 2003--2011", PrintingCopies->1, PrintingPageRange->{1, Automatic}, CellLabelAutoDelete->True, FrontEndVersion->"7.0 for Mac OS X x86 (32-bit) (November 11, 2008)", StyleDefinitions->FrontEnd`FileName[{"Creative"}, "NaturalColor.nb", CharacterEncoding -> "UTF-8"] ] (* End of Notebook Content *) (* Internal cache information *) (*CellTagsOutline CellTagsIndex->{ "mtag:09:characteristic_equation"->{ Cell[2440, 91, 120, 1, 34, "Text", CellTags->"mtag:09:characteristic_equation"]}, "mtag:09:IdentifyMatrix[]"->{ Cell[2563, 94, 363, 9, 54, "Input", CellTags->{ "mtag:09:IdentifyMatrix[]", "mtag:09:Det[]", "mtag:09:Solve[]"}]}, "mtag:09:Det[]"->{ Cell[2563, 94, 363, 9, 54, "Input", CellTags->{ "mtag:09:IdentifyMatrix[]", "mtag:09:Det[]", "mtag:09:Solve[]"}]}, "mtag:09:Solve[]"->{ Cell[2563, 94, 363, 9, 54, "Input", CellTags->{ "mtag:09:IdentifyMatrix[]", "mtag:09:Det[]", "mtag:09:Solve[]"}]}, "mtag:09:Eigenvectors[]"->{ Cell[2929, 105, 131, 2, 34, "Text", CellTags->{ "mtag:09:Eigenvectors[]", "mtag:09:eigenvectors__example_of_computation"}]}, "mtag:09:eigenvectors__example_of_computation"->{ Cell[2929, 105, 131, 2, 34, "Text", CellTags->{ "mtag:09:Eigenvectors[]", "mtag:09:eigenvectors__example_of_computation"}]}, "mtag:09:eigenvector_column_matrix__example"->{ Cell[3138, 112, 222, 5, 54, "Input", CellTags->"mtag:09:eigenvector_column_matrix__example"]}, "mtag:09:Eigensystem[]"->{ Cell[3516, 125, 107, 2, 54, "Input", CellTags->"mtag:09:Eigensystem[]"]}, "mtag:09:Transpose[]"->{ Cell[3980, 140, 353, 10, 85, "Input", CellTags->{ "mtag:09:Transpose[]", "mtag:09:Inverse[]", "mtag:09:Simplify[]", "mtag:09:MatrixForm[]"}]}, "mtag:09:Inverse[]"->{ Cell[3980, 140, 353, 10, 85, "Input", CellTags->{ "mtag:09:Transpose[]", "mtag:09:Inverse[]", "mtag:09:Simplify[]", "mtag:09:MatrixForm[]"}]}, "mtag:09:Simplify[]"->{ Cell[3980, 140, 353, 10, 85, "Input", CellTags->{ "mtag:09:Transpose[]", "mtag:09:Inverse[]", "mtag:09:Simplify[]", "mtag:09:MatrixForm[]"}]}, "mtag:09:MatrixForm[]"->{ Cell[3980, 140, 353, 10, 85, "Input", CellTags->{ "mtag:09:Transpose[]", "mtag:09:Inverse[]", "mtag:09:Simplify[]", "mtag:09:MatrixForm[]"}]}, "mtag:09:simularity_transformation__example"->{ Cell[4336, 152, 243, 6, 85, "Input", CellTags->"mtag:09:simularity_transformation__example"]}, "mtag:09:GramSchmidt[]"->{ Cell[5097, 180, 396, 10, 85, "Input", CellTags->"mtag:09:GramSchmidt[]"]}, "mtag:09:RotationMatrix2D[]"->{ Cell[5727, 198, 497, 15, 82, "Input", CellTags->"mtag:09:RotationMatrix2D[]"]}, "mtag:09:MatrixPower[]"->{ Cell[7698, 273, 165, 5, 34, "Text", CellTags->"mtag:09:MatrixPower[]"]} } *) (*CellTagsIndex CellTagsIndex->{ {"mtag:09:characteristic_equation", 8665, 306}, {"mtag:09:IdentifyMatrix[]", 8783, 309}, {"mtag:09:Det[]", 8927, 313}, {"mtag:09:Solve[]", 9073, 317}, {"mtag:09:Eigenvectors[]", 9226, 321}, {"mtag:09:eigenvectors__example_of_computation", 9417, 326}, {"mtag:09:eigenvector_column_matrix__example", 9606, 331}, {"mtag:09:Eigensystem[]", 9734, 334}, {"mtag:09:Transpose[]", 9839, 337}, {"mtag:09:Inverse[]", 10021, 342}, {"mtag:09:Simplify[]", 10204, 347}, {"mtag:09:MatrixForm[]", 10389, 352}, {"mtag:09:simularity_transformation__example", 10596, 357}, {"mtag:09:GramSchmidt[]", 10724, 360}, {"mtag:09:RotationMatrix2D[]", 10837, 363}, {"mtag:09:MatrixPower[]", 10950, 366} } *) (*NotebookFileOutline Notebook[{ Cell[628, 22, 52, 0, 183, "Title"], Cell[CellGroupData[{ Cell[705, 26, 60, 0, 39, "Subtitle"], Cell[CellGroupData[{ Cell[790, 30, 139, 3, 34, "Text"], Cell[932, 35, 261, 8, 70, "Input"], Cell[1196, 45, 751, 25, 70, "Input"] }, Closed]], Cell[1962, 73, 475, 16, 85, "Input"], Cell[2440, 91, 120, 1, 34, "Text", CellTags->"mtag:09:characteristic_equation"], Cell[2563, 94, 363, 9, 54, "Input", CellTags->{"mtag:09:IdentifyMatrix[]", "mtag:09:Det[]", "mtag:09:Solve[]"}], Cell[2929, 105, 131, 2, 34, "Text", CellTags->{ "mtag:09:Eigenvectors[]", "mtag:09:eigenvectors__example_of_computation"}], Cell[3063, 109, 72, 1, 54, "Input"], Cell[3138, 112, 222, 5, 54, "Input", CellTags->"mtag:09:eigenvector_column_matrix__example"], Cell[3363, 119, 150, 4, 34, "Text"], Cell[3516, 125, 107, 2, 54, "Input", CellTags->"mtag:09:Eigensystem[]"], Cell[3626, 129, 252, 4, 57, "Text"] }, Closed]], Cell[CellGroupData[{ Cell[3915, 138, 62, 0, 39, "Subtitle"], Cell[3980, 140, 353, 10, 85, "Input", CellTags->{ "mtag:09:Transpose[]", "mtag:09:Inverse[]", "mtag:09:Simplify[]", "mtag:09:MatrixForm[]"}], Cell[4336, 152, 243, 6, 85, "Input", CellTags->"mtag:09:simularity_transformation__example"], Cell[CellGroupData[{ Cell[4604, 162, 142, 4, 34, "Text"], Cell[4749, 168, 192, 4, 57, "Text"] }, Open ]], Cell[4956, 175, 138, 3, 57, "Text"], Cell[5097, 180, 396, 10, 85, "Input", CellTags->"mtag:09:GramSchmidt[]"], Cell[5496, 192, 228, 4, 57, "Text"], Cell[5727, 198, 497, 15, 82, "Input", CellTags->"mtag:09:RotationMatrix2D[]"], Cell[6227, 215, 283, 5, 57, "Text"], Cell[6513, 222, 988, 41, 60, "Text"], Cell[7504, 265, 65, 0, 105, "Input"], Cell[7572, 267, 60, 1, 74, "Input"], Cell[7635, 270, 60, 1, 74, "Input"], Cell[7698, 273, 165, 5, 34, "Text", CellTags->"mtag:09:MatrixPower[]"], Cell[7866, 280, 159, 5, 74, "Input"] }, Closed]] } ] *) (* End of internal cache information *)