(*********************************************************************** Mathematica-Compatible Notebook This notebook can be used on any computer system with Mathematica 4.0, MathReader 4.0, or any compatible application. The data for the notebook starts with the line containing stars above. To get the notebook into a Mathematica-compatible application, do one of the following: * Save the data starting with the line of stars above into a file with a name ending in .nb, then open the file inside the application; * Copy the data starting with the line of stars above to the clipboard, then use the Paste menu command inside the application. Data for notebooks contains only printable 7-bit ASCII and can be sent directly in email or through ftp in text mode. Newlines can be CR, LF or CRLF (Unix, Macintosh or MS-DOS style). NOTE: If you modify the data for this notebook not in a Mathematica- compatible application, you must delete the line below containing the word CacheID, otherwise Mathematica-compatible applications may try to use invalid cache data. For more information on notebooks and Mathematica-compatible applications, contact Wolfram Research: web: http://www.wolfram.com email: info@wolfram.com phone: +1-217-398-0700 (U.S.) Notebook reader applications are available free of charge from Wolfram Research. ***********************************************************************) (*CacheID: 232*) (*NotebookFileLineBreakTest NotebookFileLineBreakTest*) (*NotebookOptionsPosition[ 45851, 1343]*) (*NotebookOutlinePosition[ 47195, 1383]*) (* CellTagsIndexPosition[ 47151, 1379]*) (*WindowFrame->Normal*) Notebook[{ Cell["Use of eigenvectors to expand vectors and solve equations", "Title"], Cell[TextData[{ "This notebook has been written in ", StyleBox["Mathematica ", FontSlant->"Italic"], "by \n\n", StyleBox["Mark J. McCready\nProfessor and Chair of Chemical Engineering\n\ University of Notre Dame\nNotre Dame IN 46556\nUSA", FontSize->14], "\n\nMark.J.McCready.1@nd.edu\n", ButtonBox["http://www.nd.edu/~mjm/", ButtonData:>{ URL[ "http://www.nd.edu/~mjm/"], None}, ButtonStyle->"Hyperlink"], "\n\n\nIt is copyrighted to the extent allowed by whatever laws pertain to \ the World Wide Web and the Internet.\n\nI would hope that as a professional \ courtesy, this notice remain visible to other users. \nThere is no charge for \ copying and dissemination \n\nVersion: 11/98\nMore recent versions of this \ notebook should be available at the web site:\n", Cell[BoxData[ FormBox[ ButtonBox[\(\(\(http\)\(:\)\) // \(www . nd . edu/\(\(~\)\(mjm\)\)\)/ vector . expand . nb\), ButtonData:>{ URL[ "http://www.nd.edu/~mjm/vector.expand.nb"], None}, ButtonStyle->"Hyperlink"], TraditionalForm]]] }], "Text"], Cell[CellGroupData[{ Cell["\<\ Expansion of an arbitry vector using the eigenvectors of a matrix\ \ \>", "Subtitle"], Cell[CellGroupData[{ Cell["First we choose a matrix. This one is self adjoint.", "Text"], Cell[BoxData[ \(aa = \ {{1, \(-1\), 3}, {\(-1\), 0, \(-2\)}, {3, \(-2\), 4}}\)], "Input",\ CellLabel->"In[228]:=", AspectRatioFixed->True], Cell[BoxData[ FormBox[ RowBox[{"(", GridBox[{ {"1", \(-1\), "3"}, {\(-1\), "0", \(-2\)}, {"3", \(-2\), "4"} }, ColumnAlignments->{Decimal}], ")"}], TraditionalForm]], "Output", CellLabel->"Out[228]="], Cell[CellGroupData[{ Cell[BoxData[ \(Det[aa]\)], "Input", CellLabel->"In[229]:="], Cell[BoxData[ \(TraditionalForm\`4\)], "Output", CellLabel->"Out[229]="] }, Open ]], Cell["\<\ Here is our arbitrary vector. We wish to expand it in terms of the \ eigenvalues\ \>", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(z = \ {\(-4\), 3, 2}\)], "Input", CellLabel->"In[230]:=", AspectRatioFixed->True], Cell[BoxData[ \(TraditionalForm\`{\(-4\), 3, 2}\)], "Output", CellLabel->"Out[230]="] }, Open ]], Cell["First get the eigenvalues", "Text", Evaluatable->False, AspectRatioFixed->True], Cell[CellGroupData[{ Cell[BoxData[ \(evals = Eigenvalues[aa]\)], "Input", CellLabel->"In[231]:=", AspectRatioFixed->True], Cell[BoxData[ \(TraditionalForm\`{\(-1\), 3 - \@13, 3 + \@13}\)], "Output", CellLabel->"Out[231]="], Cell["Then get the corresponding eigenvectors", "Text", Evaluatable->False, AspectRatioFixed->True], Cell[CellGroupData[{ Cell[BoxData[ \(evecs = Eigenvectors[aa]\)], "Input", CellLabel->"In[232]:=", AspectRatioFixed->True], Cell[BoxData[ FormBox[ RowBox[{"(", GridBox[{ {\(-1\), "1", "1"}, {\(\(2\ \((\(-3\) + \@13)\)\)\/\(\(-11\) + 3\ \@13\)\), \(-\(\(\(-5\) + \@13\)\/\(\(-11\) + 3\ \@13\)\)\), "1"}, {\(\(2\ \((3 + \@13)\)\)\/\(11 + 3\ \@13\)\), \(-\(\(5 + \@13\)\/\(11 + 3\ \@13\)\)\), "1"} }], ")"}], TraditionalForm]], "Output", CellLabel->"Out[232]="] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell["\<\ Now solve the adjoint system for the eigenvalues (not for this \ problem)\ \>", "Text", Evaluatable->False, AspectRatioFixed->True], Cell[CellGroupData[{ Cell[BoxData[ \(evalstrans = Eigenvalues[Transpose[aa]]\)], "Input", CellLabel->"In[233]:=", AspectRatioFixed->True], Cell[BoxData[ \(TraditionalForm\`{\(-1\), 3 - \@13, 3 + \@13}\)], "Output", CellLabel->"Out[233]="], Cell["and the eigenvectors", "Text", Evaluatable->False, AspectRatioFixed->True], Cell[CellGroupData[{ Cell[BoxData[ \(evecstrans = Eigenvectors[Transpose[aa]]\)], "Input", CellLabel->"In[234]:=", AspectRatioFixed->True], Cell[BoxData[ FormBox[ RowBox[{"(", GridBox[{ {\(-1\), "1", "1"}, {\(\(2\ \((\(-3\) + \@13)\)\)\/\(\(-11\) + 3\ \@13\)\), \(-\(\(\(-5\) + \@13\)\/\(\(-11\) + 3\ \@13\)\)\), "1"}, {\(\(2\ \((3 + \@13)\)\)\/\(11 + 3\ \@13\)\), \(-\(\(5 + \@13\)\/\(11 + 3\ \@13\)\)\), "1"} }], ")"}], TraditionalForm]], "Output", CellLabel->"Out[234]="] }, Open ]] }, Open ]] }, Closed]], Cell["Here is how we write the expansion for the z vector,", "Text", Evaluatable->False, AspectRatioFixed->True], Cell[CellGroupData[{ Cell[BoxData[ \(Table[\[Alpha][i], {i, 1, 3}] . {xvec[1], xvec[2], xvec[3]}\)], "Input",\ CellLabel->"In[235]:="], Cell[BoxData[ \(TraditionalForm \`\(xvec(1)\)\ \(\[Alpha](1)\) + \(xvec(2)\)\ \(\[Alpha](2)\) + \(xvec(3)\)\ \(\[Alpha](3)\)\)], "Output", CellLabel->"Out[235]="] }, Open ]], Cell["Now calculate this", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(expand1 = Table[\[Alpha][i], {i, 1, 3}] . evecs\)], "Input", CellLabel->"In[236]:="], Cell[BoxData[ \(TraditionalForm \`{\(-\(\[Alpha](1)\)\) + \(2\ \((\(-3\) + \@13)\)\ \(\[Alpha](2)\)\)\/\(\(-11\) + 3\ \@13\) + \(2\ \((3 + \@13)\)\ \(\[Alpha](3)\)\)\/\(11 + 3\ \@13\), \[Alpha](1) - \(\((\(-5\) + \@13)\)\ \(\[Alpha](2)\)\)\/\(\(-11\) + 3\ \@13\) - \(\((5 + \@13)\)\ \(\[Alpha](3)\)\)\/\(11 + 3\ \@13\), \[Alpha](1) + \[Alpha](2) + \[Alpha](3)}\)], "Output", CellLabel->"Out[236]="] }, Open ]], Cell[TextData[ "Now we have the equation, z =Sum[\[Alpha][i] x[i]] for the expansion. We \ evaluate the \[Alpha][i]'s by forming the inner product of both sides of the \ equation with the adjoint eigenvectors (which are the same as the regular \ eigenvectors). \n\nHere is the right side"], "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(expand2 = evecs . expand1\)], "Input", CellLabel->"In[237]:="], Cell[BoxData[ \(TraditionalForm \`{3\ \(\[Alpha](1)\) - \(2\ \((\(-3\) + \@13)\)\ \(\[Alpha](2)\)\)\/\(\(-11\) + 3\ \@13\) - \(\((\(-5\) + \@13)\)\ \(\[Alpha](2)\)\)\/\(\(-11\) + 3\ \@13\) + \[Alpha](2) - \(\((5 + \@13)\)\ \(\[Alpha](3)\)\)\/\(11 + 3\ \@13\) - \(2\ \((3 + \@13)\)\ \(\[Alpha](3)\)\)\/\(11 + 3\ \@13\) + \[Alpha](3), \[Alpha](1) + \[Alpha](2) + \[Alpha](3) + \(2\ \((\(-3\) + \@13)\)\ \((\(-\(\[Alpha](1)\)\) + \(2\ \((\(-3\) + \@13)\)\ \(\[Alpha](2)\)\)\/\(\(-11\) + 3\ \@13\) + \(2\ \((3 + \@13)\)\ \(\[Alpha](3)\)\)\/\(11 + 3\ \@13\)) \)\)\/\(\(-11\) + 3\ \@13\) - \(\((\(-5\) + \@13)\)\ \((\[Alpha](1) - \(\((\(-5\) + \@13)\)\ \(\[Alpha](2)\)\)\/\(\(-11\) + 3\ \@13\) - \(\((5 + \@13)\)\ \(\[Alpha](3)\)\)\/\(11 + 3\ \@13\)) \)\)\/\(\(-11\) + 3\ \@13\), \[Alpha](1) + \[Alpha](2) + \[Alpha](3) + \(2\ \((3 + \@13)\)\ \((\(-\(\[Alpha](1)\)\) + \(2\ \((\(-3\) + \@13)\)\ \(\[Alpha](2)\)\)\/\(\(-11\) + 3\ \@13\) + \(2\ \((3 + \@13)\)\ \(\[Alpha](3)\)\)\/\(11 + 3\ \@13\)) \)\)\/\(11 + 3\ \@13\) - \(\((5 + \@13)\)\ \((\[Alpha](1) - \(\((\(-5\) + \@13)\)\ \(\[Alpha](2)\)\)\/\(\(-11\) + 3\ \@13\) - \(\((5 + \@13)\)\ \(\[Alpha](3)\)\)\/\(11 + 3\ \@13\)) \)\)\/\(11 + 3\ \@13\)}\)], "Output", CellLabel->"Out[237]="] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(expand3 = Simplify[expand2]\)], "Input", CellLabel->"In[238]:="], Cell[BoxData[ \(TraditionalForm \`{3\ \(\[Alpha](1)\), \(2\ \((\(-13\) + \@13)\)\ \(\[Alpha](2)\)\)\/\(\(-11\) + 3\ \@13\), \(2\ \((13 + \@13)\)\ \(\[Alpha](3)\)\)\/\(11 + 3\ \@13\)}\)], "Output",\ CellLabel->"Out[238]="] }, Open ]], Cell["Here is the left side", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(left1 = evecs . z\)], "Input", CellLabel->"In[239]:="], Cell[BoxData[ \(TraditionalForm \`{9, 2 - \(3\ \((\(-5\) + \@13)\)\)\/\(\(-11\) + 3\ \@13\) - \(8\ \((\(-3\) + \@13)\)\)\/\(\(-11\) + 3\ \@13\), 2 - \(8\ \((3 + \@13)\)\)\/\(11 + 3\ \@13\) - \(3\ \((5 + \@13)\)\)\/\(11 + 3\ \@13\)}\)], "Output", CellLabel->"Out[239]="] }, Open ]], Cell[TextData[ "Now get the \[Alpha][i]'s by equating the two sides and solving"], "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(eq = left1 == expand3\)], "Input", CellLabel->"In[240]:="], Cell[BoxData[ \(TraditionalForm \`{9, 2 - \(3\ \((\(-5\) + \@13)\)\)\/\(\(-11\) + 3\ \@13\) - \(8\ \((\(-3\) + \@13)\)\)\/\(\(-11\) + 3\ \@13\), 2 - \(8\ \((3 + \@13)\)\)\/\(11 + 3\ \@13\) - \(3\ \((5 + \@13)\)\)\/\(11 + 3\ \@13\)} == {3\ \(\[Alpha](1)\), \(2\ \((\(-13\) + \@13)\)\ \(\[Alpha](2)\)\)\/\(\(-11\) + 3\ \@13\), \(2\ \((13 + \@13)\)\ \(\[Alpha](3)\)\)\/\(11 + 3\ \@13\)}\)], "Output", CellLabel->"Out[240]="] }, Open ]], Cell[TextData["Note that each equation contains only 1 \[Alpha][i]."], "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(ans = Solve[eq, Table[\[Alpha][i], {i, 1, 3}]]\)], "Input", CellLabel->"In[241]:="], Cell[BoxData[ \(TraditionalForm \`{{\[Alpha](1) \[Rule] 3, \[Alpha](2) \[Rule] \(-\(\(\(-17\) + 5\ \@13\)\/\(2\ \((\(-13\) + \@13)\)\)\)\), \[Alpha](3) \[Rule] \(-\(\(17 + 5\ \@13\)\/\(2\ \((13 + \@13)\)\)\)\)}}\)], "Output", CellLabel->"Out[241]="] }, Open ]], Cell["Now let's check the result", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(test1 = Table[\[Alpha][i], {i, 1, 3}] . evecs\)], "Input", CellLabel->"In[242]:="], Cell[BoxData[ \(TraditionalForm \`{\(-\(\[Alpha](1)\)\) + \(2\ \((\(-3\) + \@13)\)\ \(\[Alpha](2)\)\)\/\(\(-11\) + 3\ \@13\) + \(2\ \((3 + \@13)\)\ \(\[Alpha](3)\)\)\/\(11 + 3\ \@13\), \[Alpha](1) - \(\((\(-5\) + \@13)\)\ \(\[Alpha](2)\)\)\/\(\(-11\) + 3\ \@13\) - \(\((5 + \@13)\)\ \(\[Alpha](3)\)\)\/\(11 + 3\ \@13\), \[Alpha](1) + \[Alpha](2) + \[Alpha](3)}\)], "Output", CellLabel->"Out[242]="] }, Open ]], Cell["Now substitute", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(test2 = test1 /. ans[\([1]\)]\)], "Input", CellLabel->"In[243]:="], Cell[BoxData[ \(TraditionalForm \`{\(-3\) - \(\((\(-3\) + \@13)\)\ \((\(-17\) + 5\ \@13)\)\)\/\(\((\(-13\) + \@13)\)\ \((\(-11\) + 3\ \@13)\)\) - \(\((3 + \@13)\)\ \((17 + 5\ \@13)\)\)\/\(\((13 + \@13)\)\ \((11 + 3\ \@13)\)\), 3 + \(\((\(-5\) + \@13)\)\ \((\(-17\) + 5\ \@13)\)\)\/\(2\ \((\(-13\) + \@13)\)\ \((\(-11\) + 3\ \@13)\)\) + \(\((5 + \@13)\)\ \((17 + 5\ \@13)\)\)\/\(2\ \((13 + \@13)\)\ \((11 + 3\ \@13)\)\), 3 - \(\(-17\) + 5\ \@13\)\/\(2\ \((\(-13\) + \@13)\)\) - \(17 + 5\ \@13\)\/\(2\ \((13 + \@13)\)\)}\)], "Output", CellLabel->"Out[243]="] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(test3 = FullSimplify[test2]\)], "Input", CellLabel->"In[244]:="], Cell[BoxData[ \(TraditionalForm\`{\(-4\), 3, 2}\)], "Output", CellLabel->"Out[244]="] }, Open ]], Cell["Recall z,", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(z\)], "Input", CellLabel->"In[245]:="], Cell[BoxData[ \(TraditionalForm\`{\(-4\), 3, 2}\)], "Output", CellLabel->"Out[245]="] }, Open ]], Cell["It, of course, matches.", "Text"] }, Closed]], Cell[CellGroupData[{ Cell["We choose another matrix. This one is not self adjoint.", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(aa = \ {{1, \(-1\), 3}, {1, 0, \(-2\)}, {3, 3, 4}}\)], "Input", CellLabel->"In[125]:=", AspectRatioFixed->True], Cell[BoxData[ FormBox[ RowBox[{"(", GridBox[{ {"1", \(-1\), "3"}, {"1", "0", \(-2\)}, {"3", "3", "4"} }, ColumnAlignments->{Decimal}], ")"}], TraditionalForm]], "Output", CellLabel->"Out[125]="], Cell[CellGroupData[{ Cell[BoxData[ \(Det[aa]\)], "Input", CellLabel->"In[126]:="], Cell[BoxData[ \(TraditionalForm\`25\)], "Output", CellLabel->"Out[126]="] }, Open ]], Cell["\<\ Here is our arbitrary vector. We wish to expand it in terms of the \ eigenvalues\ \>", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(z = \ {\(-1\), 3, 5}\)], "Input", CellLabel->"In[127]:=", AspectRatioFixed->True], Cell[BoxData[ \(TraditionalForm\`{\(-1\), 3, 5}\)], "Output", CellLabel->"Out[127]="] }, Open ]], Cell["First get the eigenvalues", "Text", Evaluatable->False, AspectRatioFixed->True], Cell[CellGroupData[{ Cell[BoxData[ \(evals = Eigenvalues[aa]\)], "Input", CellLabel->"In[128]:=", AspectRatioFixed->True], Cell[BoxData[ \(TraditionalForm \`{5\/3 + 1\/3\ \@\(835\/2 - \(9\ \@8269\)\/2\)\%3 + 1\/3\ \@\(1\/2\ \((835 + 9\ \@8269)\)\)\%3, 5\/3 - 1\/6\ \((1 + \[ImaginaryI]\ \@3)\)\ \@\(835\/2 - \(9\ \@8269\)\/2\)\%3 - 1\/6\ \((1 - \[ImaginaryI]\ \@3)\)\ \@\(1\/2\ \((835 + 9\ \@8269)\)\)\%3, 5\/3 - 1\/6\ \((1 - \[ImaginaryI]\ \@3)\)\ \@\(835\/2 - \(9\ \@8269\)\/2\)\%3 - 1\/6\ \((1 + \[ImaginaryI]\ \@3)\)\ \@\(1\/2\ \((835 + 9\ \@8269)\)\)\%3}\)], "Output", CellLabel->"Out[128]="], Cell["Then get the corresponding eigenvectors", "Text", Evaluatable->False, AspectRatioFixed->True], Cell[CellGroupData[{ Cell[BoxData[ \(evecs = Eigenvectors[aa]\)], "Input", CellLabel->"In[129]:=", AspectRatioFixed->True], Cell[BoxData[ FormBox[ RowBox[{"(", GridBox[{ { \(1\/3\ \(( \(-\(7\/3\)\) + 1\/3\ \@\(835\/2 - \(9\ \@8269\)\/2\)\%3 + 1\/3\ \@\(1\/2\ \((835 + 9\ \@8269)\)\)\%3)\) + \(50 - 2\ \@\(835\/2 - \(9\ \@8269\)\/2\)\%3 - 2\^\(2/3\)\ \@\(835 + 9\ \@8269\)\%3\)\/\(3\ \((16 + 2\ \@\(835\/2 - \(9\ \@8269\)\/2\)\%3 + 2\^\(2/3\)\ \@\(835 + 9\ \@8269\)\%3)\)\)\), \(-\(\(50 - 2\ \@\(835\/2 - \(9\ \@8269\)\/2\)\%3 - 2\^\(2/3\)\ \@\(835 + 9\ \@8269\)\%3\)\/\(3\ \((16 + 2\ \@\(835\/2 - \(9\ \@8269\)\/2\)\%3 + 2\^\(2/3\)\ \@\(835 + 9\ \@8269\)\%3)\)\)\)\), "1"}, { \(1\/3\ \(( \(-\(7\/3\)\) - 1\/6\ \((1 + \[ImaginaryI]\ \@3)\)\ \@\(835\/2 - \(9\ \@8269\)\/2\)\%3 - 1\/6\ \((1 - \[ImaginaryI]\ \@3)\)\ \@\(1\/2\ \((835 + 9\ \@8269)\)\)\%3)\) + \(\(-\(25\/3\)\) - 1\/6\ \((1 + \[ImaginaryI]\ \@3)\)\ \@\(835\/2 - \(9\ \@8269\)\/2\)\%3 - 1\/6\ \((1 - \[ImaginaryI]\ \@3)\)\ \@\(1\/2\ \((835 + 9\ \@8269)\)\)\%3\)\/\(\(-3\) + 3\ \((\(-\(5\/3\)\) + 1\/6\ \((1 + \[ImaginaryI]\ \@3)\)\ \@\(835\/2 - \(9\ \@8269\)\/2\)\%3 + 1\/6\ \((1 - \[ImaginaryI]\ \@3)\)\ \@\(1\/2\ \((835 + 9\ \@8269)\)\)\%3)\)\)\), \(-\(\(\(-\(25\/3\)\) - 1\/6\ \((1 + \[ImaginaryI]\ \@3)\)\ \@\(835\/2 - \(9\ \@8269\)\/2\)\%3 - 1\/6\ \((1 - \[ImaginaryI]\ \@3)\)\ \@\(1\/2\ \((835 + 9\ \@8269)\)\)\%3\)\/\(\(-3\) + 3\ \((\(-\(5\/3\)\) + 1\/6\ \((1 + \[ImaginaryI]\ \@3)\)\ \@\(835\/2 - \(9\ \@8269\)\/2\)\%3 + 1\/6\ \((1 - \[ImaginaryI]\ \@3)\)\ \@\(1\/2\ \((835 + 9\ \@8269)\)\)\%3)\)\)\)\), "1"}, { \(1\/3\ \(( \(-\(7\/3\)\) - 1\/6\ \((1 - \[ImaginaryI]\ \@3)\)\ \@\(835\/2 - \(9\ \@8269\)\/2\)\%3 - 1\/6\ \((1 + \[ImaginaryI]\ \@3)\)\ \@\(1\/2\ \((835 + 9\ \@8269)\)\)\%3)\) + \(\(-\(25\/3\)\) - 1\/6\ \((1 - \[ImaginaryI]\ \@3)\)\ \@\(835\/2 - \(9\ \@8269\)\/2\)\%3 - 1\/6\ \((1 + \[ImaginaryI]\ \@3)\)\ \@\(1\/2\ \((835 + 9\ \@8269)\)\)\%3\)\/\(\(-3\) + 3\ \((\(-\(5\/3\)\) + 1\/6\ \((1 - \[ImaginaryI]\ \@3)\)\ \@\(835\/2 - \(9\ \@8269\)\/2\)\%3 + 1\/6\ \((1 + \[ImaginaryI]\ \@3)\)\ \@\(1\/2\ \((835 + 9\ \@8269)\)\)\%3)\)\)\), \(-\(\(\(-\(25\/3\)\) - 1\/6\ \((1 - \[ImaginaryI]\ \@3)\)\ \@\(835\/2 - \(9\ \@8269\)\/2\)\%3 - 1\/6\ \((1 + \[ImaginaryI]\ \@3)\)\ \@\(1\/2\ \((835 + 9\ \@8269)\)\)\%3\)\/\(\(-3\) + 3\ \((\(-\(5\/3\)\) + 1\/6\ \((1 - \[ImaginaryI]\ \@3)\)\ \@\(835\/2 - \(9\ \@8269\)\/2\)\%3 + 1\/6\ \((1 + \[ImaginaryI]\ \@3)\)\ \@\(1\/2\ \((835 + 9\ \@8269)\)\)\%3)\)\)\)\), "1"} }], ")"}], TraditionalForm]], "Output", CellLabel->"Out[129]="] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell["Now solve the adjoint system for the eigenvalues ", "Text", Evaluatable->False, AspectRatioFixed->True], Cell[CellGroupData[{ Cell[BoxData[ \(evalstrans = Eigenvalues[Transpose[aa]]\)], "Input", CellLabel->"In[130]:=", AspectRatioFixed->True], Cell[BoxData[ \(TraditionalForm \`{5\/3 + 1\/3\ \@\(835\/2 - \(9\ \@8269\)\/2\)\%3 + 1\/3\ \@\(1\/2\ \((835 + 9\ \@8269)\)\)\%3, 5\/3 - 1\/6\ \((1 + \[ImaginaryI]\ \@3)\)\ \@\(835\/2 - \(9\ \@8269\)\/2\)\%3 - 1\/6\ \((1 - \[ImaginaryI]\ \@3)\)\ \@\(1\/2\ \((835 + 9\ \@8269)\)\)\%3, 5\/3 - 1\/6\ \((1 - \[ImaginaryI]\ \@3)\)\ \@\(835\/2 - \(9\ \@8269\)\/2\)\%3 - 1\/6\ \((1 + \[ImaginaryI]\ \@3)\)\ \@\(1\/2\ \((835 + 9\ \@8269)\)\)\%3}\)], "Output", CellLabel->"Out[130]="], Cell["and the eigenvectors", "Text", Evaluatable->False, AspectRatioFixed->True], Cell[CellGroupData[{ Cell[BoxData[ \(evecstrans = Eigenvectors[Transpose[aa]]\)], "Input", CellLabel->"In[131]:=", AspectRatioFixed->True], Cell[BoxData[ FormBox[ RowBox[{"(", GridBox[{ { \(1\/3\ \(( \(-\(7\/3\)\) + 1\/3\ \@\(835\/2 - \(9\ \@8269\)\/2\)\%3 + 1\/3\ \@\(1\/2\ \((835 + 9\ \@8269)\)\)\%3)\) - \(2\ \(( \(-68\) + 2\ \@\(835\/2 - \(9\ \@8269\)\/2\)\%3 + 2\^\(2/3\)\ \@\(835 + 9\ \@8269\)\%3)\)\)\/\(9\ \((14 + 2\ \@\(835\/2 - \(9\ \@8269\)\/2\)\%3 + 2\^\(2/3\)\ \@\(835 + 9\ \@8269\)\%3)\)\)\), \(-\(\(\(-68\) + 2\ \@\(835\/2 - \(9\ \@8269\)\/2\)\%3 + 2\^\(2/3\)\ \@\(835 + 9\ \@8269\)\%3\)\/\(3\ \((14 + 2\ \@\(835\/2 - \(9\ \@8269\)\/2\)\%3 + 2\^\(2/3\)\ \@\(835 + 9\ \@8269\)\%3)\)\)\)\), "1"}, { \(1\/3\ \(( \(-\(7\/3\)\) - 1\/6\ \((1 + \[ImaginaryI]\ \@3)\)\ \@\(835\/2 - \(9\ \@8269\)\/2\)\%3 - 1\/6\ \((1 - \[ImaginaryI]\ \@3)\)\ \@\(1\/2\ \((835 + 9\ \@8269)\)\)\%3)\) - \(2\ \(( 34\/3 + 1\/6\ \((1 + \[ImaginaryI]\ \@3)\)\ \@\(835\/2 - \(9\ \@8269\)\/2\)\%3 + 1\/6\ \((1 - \[ImaginaryI]\ \@3)\)\ \@\(1\/2\ \((835 + 9\ \@8269)\)\)\%3)\)\)\/\(3\ \((\(-2\) + 3\ \((\(-\(5\/3\)\) + 1\/6\ \((1 + \[ImaginaryI]\ \@3)\)\ \@\(835\/2 - \(9\ \@8269\)\/2\)\%3 + 1\/6\ \((1 - \[ImaginaryI]\ \@3)\)\ \@\(1\/2\ \((835 + 9\ \@8269)\)\)\%3)\)) \)\)\), \(-\(\(34\/3 + 1\/6\ \((1 + \[ImaginaryI]\ \@3)\)\ \@\(835\/2 - \(9\ \@8269\)\/2\)\%3 + 1\/6\ \((1 - \[ImaginaryI]\ \@3)\)\ \@\(1\/2\ \((835 + 9\ \@8269)\)\)\%3\)\/\(\(-2\) + 3\ \((\(-\(5\/3\)\) + 1\/6\ \((1 + \[ImaginaryI]\ \@3)\)\ \@\(835\/2 - \(9\ \@8269\)\/2\)\%3 + 1\/6\ \((1 - \[ImaginaryI]\ \@3)\)\ \@\(1\/2\ \((835 + 9\ \@8269)\)\)\%3)\)\)\)\), "1"}, { \(1\/3\ \(( \(-\(7\/3\)\) - 1\/6\ \((1 - \[ImaginaryI]\ \@3)\)\ \@\(835\/2 - \(9\ \@8269\)\/2\)\%3 - 1\/6\ \((1 + \[ImaginaryI]\ \@3)\)\ \@\(1\/2\ \((835 + 9\ \@8269)\)\)\%3)\) - \(2\ \(( 34\/3 + 1\/6\ \((1 - \[ImaginaryI]\ \@3)\)\ \@\(835\/2 - \(9\ \@8269\)\/2\)\%3 + 1\/6\ \((1 + \[ImaginaryI]\ \@3)\)\ \@\(1\/2\ \((835 + 9\ \@8269)\)\)\%3)\)\)\/\(3\ \((\(-2\) + 3\ \(( \(-\(5\/3\)\) + 1\/6\ \((1 - \[ImaginaryI]\ \@3)\)\ \@\(835\/2 - \(9\ \@8269\)\/2\)\%3 + 1\/6\ \((1 + \[ImaginaryI]\ \@3)\)\ \@\(1\/2\ \((835 + 9\ \@8269)\)\)\%3)\)) \)\)\), \(-\(\(34\/3 + 1\/6\ \((1 - \[ImaginaryI]\ \@3)\)\ \@\(835\/2 - \(9\ \@8269\)\/2\)\%3 + 1\/6\ \((1 + \[ImaginaryI]\ \@3)\)\ \@\(1\/2\ \((835 + 9\ \@8269)\)\)\%3\)\/\(\(-2\) + 3\ \((\(-\(5\/3\)\) + 1\/6\ \((1 - \[ImaginaryI]\ \@3)\)\ \@\(835\/2 - \(9\ \@8269\)\/2\)\%3 + 1\/6\ \((1 + \[ImaginaryI]\ \@3)\)\ \@\(1\/2\ \((835 + 9\ \@8269)\)\)\%3)\)\)\)\), "1"} }], ")"}], TraditionalForm]], "Output", CellLabel->"Out[131]="] }, Open ]] }, Open ]] }, Open ]], Cell["Here is how we write the expansion for the z vector,", "Text", Evaluatable->False, AspectRatioFixed->True], Cell[CellGroupData[{ Cell[BoxData[ \(Table[\[Alpha][i], {i, 1, 3}] . {xvec[1], xvec[2], xvec[3]}\)], "Input",\ CellLabel->"In[132]:="], Cell[BoxData[ \(TraditionalForm \`\(xvec(1)\)\ \(\[Alpha](1)\) + \(xvec(2)\)\ \(\[Alpha](2)\) + \(xvec(3)\)\ \(\[Alpha](3)\)\)], "Output", CellLabel->"Out[132]="] }, Open ]], Cell["Now calculate this", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(expand1 = Table[\[Alpha][i], {i, 1, 3}] . N[evecs]\)], "Input", CellLabel->"In[133]:="], Cell[BoxData[ \(TraditionalForm \`{0.723366135103227847`\ \(\[Alpha](1)\) - \((\(1.19501640088494687`\[InvisibleSpace]\) + 0.819252685422871351`\ \[ImaginaryI])\)\ \(\[Alpha](2)\) - \((\(1.19501640088494687`\[InvisibleSpace]\) - 0.819252685422871351`\ \[ImaginaryI])\)\ \(\[Alpha](3)\), \(-0.233391525106285202`\)\ \(\[Alpha](1)\) - \((\(0.216637570780191168`\[InvisibleSpace]\) - 1.52755585767870405`\ \[ImaginaryI])\)\ \(\[Alpha](2)\) - \((\(0.216637570780191168`\[InvisibleSpace]\) + 1.52755585767870405`\ \[ImaginaryI])\)\ \(\[Alpha](3)\), 1.`\ \(\[Alpha](1)\) + 1.`\ \(\[Alpha](2)\) + 1.`\ \(\[Alpha](3)\)}\)], "Output", CellLabel->"Out[133]="] }, Open ]], Cell[TextData[ "Now we have the equation, z =Sum[\[Alpha][i] x[i]] for the expansion. We \ evaluate the \[Alpha][i]'s by forming the inner product of both sides of the \ equation with the adjoint eigenvectors.\n\nHere is the right side"], "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(expand2 = Chop[ExpandAll[N[evecstrans]]] . expand1\)], "Input", CellLabel->"In[134]:="], Cell[BoxData[ \(TraditionalForm \`{0.762658645360470011`\ \((0.723366135103227847`\ \(\[Alpha](1)\) - \((\(1.19501640088494687`\[InvisibleSpace]\) + 0.819252685422871351`\ \[ImaginaryI])\)\ \(\[Alpha](2)\) - \((\(1.19501640088494687`\[InvisibleSpace]\) - 0.819252685422871351`\ \[ImaginaryI])\)\ \(\[Alpha](3)\)) \) + 0.409026053045290982`\ \((\(-0.233391525106285202`\)\ \(\[Alpha](1)\) - \((\(0.216637570780191168`\[InvisibleSpace]\) - 1.52755585767870405`\ \[ImaginaryI])\)\ \(\[Alpha](2)\) - \((\(0.216637570780191168`\[InvisibleSpace]\) + 1.52755585767870405`\ \[ImaginaryI])\)\ \(\[Alpha](3)\)) \) + 1.`\ \((1.`\ \(\[Alpha](1)\) + 1.`\ \(\[Alpha](2)\) + 1.`\ \(\[Alpha](3)\))\), \((\(-1.35501353320655049`\) - 0.664296780044430867`\ \[ImaginaryI])\)\ \((0.723366135103227847`\ \(\[Alpha](1)\) - \((\(1.19501640088494687`\[InvisibleSpace]\) + 0.819252685422871351`\ \[ImaginaryI])\)\ \(\[Alpha](2)\) - \((\(1.19501640088494687`\[InvisibleSpace]\) - 0.819252685422871351`\ \[ImaginaryI])\)\ \(\[Alpha](3)\)) \) + \((\(0.0849606576878814756`\[InvisibleSpace]\) - 2.05889992845039504`\ \[ImaginaryI])\)\ \((\(-0.233391525106285202`\)\ \(\[Alpha](1)\) - \((\(0.216637570780191168`\[InvisibleSpace]\) - 1.52755585767870405`\ \[ImaginaryI])\)\ \(\[Alpha](2)\) - \((\(0.216637570780191168`\[InvisibleSpace]\) + 1.52755585767870405`\ \[ImaginaryI])\)\ \(\[Alpha](3)\)) \) + 1.`\ \((1.`\ \(\[Alpha](1)\) + 1.`\ \(\[Alpha](2)\) + 1.`\ \(\[Alpha](3)\))\), \((\(-1.35501353320655049`\) + 0.664296780044430867`\ \[ImaginaryI])\)\ \((0.723366135103227847`\ \(\[Alpha](1)\) - \((\(1.19501640088494687`\[InvisibleSpace]\) + 0.819252685422871351`\ \[ImaginaryI])\)\ \(\[Alpha](2)\) - \((\(1.19501640088494687`\[InvisibleSpace]\) - 0.819252685422871351`\ \[ImaginaryI])\)\ \(\[Alpha](3)\)) \) + \((\(0.0849606576878814756`\[InvisibleSpace]\) + 2.05889992845039504`\ \[ImaginaryI])\)\ \((\(-0.233391525106285202`\)\ \(\[Alpha](1)\) - \((\(0.216637570780191168`\[InvisibleSpace]\) - 1.52755585767870405`\ \[ImaginaryI])\)\ \(\[Alpha](2)\) - \((\(0.216637570780191168`\[InvisibleSpace]\) + 1.52755585767870405`\ \[ImaginaryI])\)\ \(\[Alpha](3)\)) \) + 1.`\ \((1.`\ \(\[Alpha](1)\) + 1.`\ \(\[Alpha](2)\) + 1.`\ \(\[Alpha](3)\))\)}\)], "Output", CellLabel->"Out[134]="] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(expand3 = Chop[Simplify[expand2]]\)], "Input", CellLabel->"In[135]:="], Cell[BoxData[ \(TraditionalForm \`{1.45621822236902165`\ \(\[Alpha](1)\), \((\(5.20171545021899639`\[InvisibleSpace]\) + 2.47976125237431599`\ \[ImaginaryI])\)\ \(\[Alpha](2)\), \((\(5.20171545021899639`\[InvisibleSpace]\) - 2.47976125237431599`\ \[ImaginaryI])\)\ \(\[Alpha](3)\)}\)], "Output", CellLabel->"Out[135]="] }, Open ]], Cell["Here is the left side", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(left1 = N[evecstrans . z]\)], "Input", CellLabel->"In[136]:="], Cell[BoxData[ \(TraditionalForm \`{5.46441951377540302`, \(6.6098955062701945`\[InvisibleSpace]\) - 5.51240300530675497`\ \[ImaginaryI], \(6.6098955062701945`\[InvisibleSpace]\) + 5.51240300530675497`\ \[ImaginaryI]}\)], "Output", CellLabel->"Out[136]="] }, Open ]], Cell[TextData[ "Now get the \[Alpha][i]'s by equating the two sides and solving"], "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(eq = left1 == expand3\)], "Input", CellLabel->"In[137]:="], Cell[BoxData[ \(TraditionalForm \`{5.46441951377540302`, \(6.6098955062701945`\[InvisibleSpace]\) - 5.51240300530675497`\ \[ImaginaryI], \(6.6098955062701945`\[InvisibleSpace]\) + 5.51240300530675497`\ \[ImaginaryI]} == { 1.45621822236902165`\ \(\[Alpha](1)\), \((\(5.20171545021899639`\[InvisibleSpace]\) + 2.47976125237431599`\ \[ImaginaryI])\)\ \(\[Alpha](2)\), \((\(5.20171545021899639`\[InvisibleSpace]\) - 2.47976125237431599`\ \[ImaginaryI])\)\ \(\[Alpha](3)\)}\)], "Output", CellLabel->"Out[137]="] }, Open ]], Cell[TextData["Note that each equation contains only 1 \[Alpha][i]."], "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(ans = Solve[eq, Table[\[Alpha][i], {i, 1, 3}]]\)], "Input", CellLabel->"In[138]:="], Cell[BoxData[ \(TraditionalForm \`{{\[Alpha](1) \[Rule] \(3.75247296719423895`\[InvisibleSpace]\) + 0.`\ \[ImaginaryI], \[Alpha](2) \[Rule] \(0.623763516402880924`\[InvisibleSpace]\) - 1.35708838199332371`\ \[ImaginaryI], \[Alpha](3) \[Rule] \(0.623763516402880924`\[InvisibleSpace]\) + 1.35708838199332371`\ \[ImaginaryI]}}\)], "Output", CellLabel->"Out[138]="] }, Open ]], Cell["Now let's check the result", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(test1 = Table[\[Alpha][i], {i, 1, 3}] . evecs\)], "Input", CellLabel->"In[139]:="], Cell[BoxData[ \(TraditionalForm \`{\((1\/3\ \(( \(-\(7\/3\)\) + 1\/3\ \@\(835\/2 - \(9\ \@8269\)\/2\)\%3 + 1\/3\ \@\(1\/2\ \((835 + 9\ \@8269)\)\)\%3)\) + \(50 - 2\ \@\(835\/2 - \(9\ \@8269\)\/2\)\%3 - 2\^\(2/3\)\ \@\(835 + 9\ \@8269\)\%3\)\/\(3\ \((16 + 2\ \@\(835\/2 - \(9\ \@8269\)\/2\)\%3 + 2\^\(2/3\)\ \@\(835 + 9\ \@8269\)\%3)\)\))\)\ \(\[Alpha](1)\) + \((1\/3\ \(( \(-\(7\/3\)\) - 1\/6\ \((1 + \[ImaginaryI]\ \@3)\)\ \@\(835\/2 - \(9\ \@8269\)\/2\)\%3 - 1\/6\ \((1 - \[ImaginaryI]\ \@3)\)\ \@\(1\/2\ \((835 + 9\ \@8269)\)\)\%3)\) + \((\(-\(25\/3\)\) - 1\/6\ \((1 + \[ImaginaryI]\ \@3)\)\ \@\(835\/2 - \(9\ \@8269\)\/2\)\%3 - 1\/6\ \((1 - \[ImaginaryI]\ \@3)\)\ \@\(1\/2\ \((835 + 9\ \@8269)\)\)\%3)\)/ \((\(-3\) + 3\ \((\(-\(5\/3\)\) + 1\/6\ \((1 + \[ImaginaryI]\ \@3)\)\ \@\(835\/2 - \(9\ \@8269\)\/2\)\%3 + 1\/6\ \((1 - \[ImaginaryI]\ \@3)\)\ \@\(1\/2\ \((835 + 9\ \@8269)\)\)\%3)\))\))\)\ \(\[Alpha](2)\) + \((1\/3\ \(( \(-\(7\/3\)\) - 1\/6\ \((1 - \[ImaginaryI]\ \@3)\)\ \@\(835\/2 - \(9\ \@8269\)\/2\)\%3 - 1\/6\ \((1 + \[ImaginaryI]\ \@3)\)\ \@\(1\/2\ \((835 + 9\ \@8269)\)\)\%3)\) + \((\(-\(25\/3\)\) - 1\/6\ \((1 - \[ImaginaryI]\ \@3)\)\ \@\(835\/2 - \(9\ \@8269\)\/2\)\%3 - 1\/6\ \((1 + \[ImaginaryI]\ \@3)\)\ \@\(1\/2\ \((835 + 9\ \@8269)\)\)\%3)\)/ \((\(-3\) + 3\ \((\(-\(5\/3\)\) + 1\/6\ \((1 - \[ImaginaryI]\ \@3)\)\ \@\(835\/2 - \(9\ \@8269\)\/2\)\%3 + 1\/6\ \((1 + \[ImaginaryI]\ \@3)\)\ \@\(1\/2\ \((835 + 9\ \@8269)\)\)\%3)\))\))\)\ \(\[Alpha](3)\), \(-\(\(\((50 - 2\ \@\(835\/2 - \(9\ \@8269\)\/2\)\%3 - 2\^\(2/3\)\ \@\(835 + 9\ \@8269\)\%3)\)\ \(\[Alpha](1)\)\)\/\(3\ \((16 + 2\ \@\(835\/2 - \(9\ \@8269\)\/2\)\%3 + 2\^\(2/3\)\ \@\(835 + 9\ \@8269\)\%3)\)\)\)\) - \((\((\(-\(25\/3\)\) - 1\/6\ \((1 + \[ImaginaryI]\ \@3)\)\ \@\(835\/2 - \(9\ \@8269\)\/2\)\%3 - 1\/6\ \((1 - \[ImaginaryI]\ \@3)\)\ \@\(1\/2\ \((835 + 9\ \@8269)\)\)\%3)\)\ \(\[Alpha](2)\)) \)/ \((\(-3\) + 3\ \((\(-\(5\/3\)\) + 1\/6\ \((1 + \[ImaginaryI]\ \@3)\)\ \@\(835\/2 - \(9\ \@8269\)\/2\)\%3 + 1\/6\ \((1 - \[ImaginaryI]\ \@3)\)\ \@\(1\/2\ \((835 + 9\ \@8269)\)\)\%3)\))\) - \((\((\(-\(25\/3\)\) - 1\/6\ \((1 - \[ImaginaryI]\ \@3)\)\ \@\(835\/2 - \(9\ \@8269\)\/2\)\%3 - 1\/6\ \((1 + \[ImaginaryI]\ \@3)\)\ \@\(1\/2\ \((835 + 9\ \@8269)\)\)\%3)\)\ \(\[Alpha](3)\)) \)/\((\(-3\) + 3\ \((\(-\(5\/3\)\) + 1\/6\ \((1 - \[ImaginaryI]\ \@3)\)\ \@\(835\/2 - \(9\ \@8269\)\/2\)\%3 + 1\/6\ \((1 + \[ImaginaryI]\ \@3)\)\ \@\(1\/2\ \((835 + 9\ \@8269)\)\)\%3)\))\), \[Alpha](1) + \[Alpha](2) + \[Alpha](3)}\)], "Output", CellLabel->"Out[139]="] }, Open ]], Cell["Now substitute", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(test2 = Chop[test1 /. ans[\([1]\)]]\)], "Input", CellLabel->"In[140]:="], Cell[BoxData[ \(TraditionalForm \`{\(-1.00000000000000044`\), 3.00000000000000177`, 5.00000000000000088`} \)], "Output", CellLabel->"Out[140]="] }, Open ]], Cell["Recall z,", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(z\)], "Input", CellLabel->"In[142]:="], Cell[BoxData[ \(TraditionalForm\`{\(-1\), 3, 5}\)], "Output", CellLabel->"Out[142]="] }, Open ]], Cell["It, of course, matches.", "Text"] }, Open ]] }, Closed]] }, Open ]], Cell[CellGroupData[{ Cell["Solution of a system of equations by eigenvector expansion", "Subtitle", Evaluatable->False, PageBreakAbove->True, AspectRatioFixed->True], Cell[CellGroupData[{ Cell["We choose again a matrix", "Text", Evaluatable->False, AspectRatioFixed->True], Cell[CellGroupData[{ Cell[BoxData[ \(aa = N[{{1, \(-1\), 3, \(-2\)}, {2, 0, \(-3\), 1}, {1, 1, 1, 1}, {0, 2, 3, 1}}]\)], "Input", CellLabel->"In[143]:=", AspectRatioFixed->True], Cell[BoxData[ FormBox[ RowBox[{"(", GridBox[{ {"1.`", \(-1.`\), "3.`", \(-2.`\)}, {"2.`", "0", \(-3.`\), "1.`"}, {"1.`", "1.`", "1.`", "1.`"}, {"0", "2.`", "3.`", "1.`"} }, ColumnAlignments->{Decimal}], ")"}], TraditionalForm]], "Output", CellLabel->"Out[143]="], Cell["\<\ Note that I use the N[ ] command to make every thing more compact \ and faster. \ \>", "Text", Evaluatable->False, AspectRatioFixed->True], Cell[CellGroupData[{ Cell[BoxData[ \(bb = N[{2, \(-1\), 0, 3}]\)], "Input", CellLabel->"In[144]:=", AspectRatioFixed->True], Cell[BoxData[ \(TraditionalForm\`{2.`, \(-1.`\), 0, 3.`}\)], "Output", CellLabel->"Out[144]="] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(Det[aa]\)], "Input", CellLabel->"In[145]:=", AspectRatioFixed->True], Cell[BoxData[ \(TraditionalForm\`\(-8.`\)\)], "Output", CellLabel->"Out[145]="] }, Open ]], Cell["So we are safe as far as getting a solution", "Text", Evaluatable->False, AspectRatioFixed->True], Cell["Let's find the solution, voila!!", "Text", Evaluatable->False, AspectRatioFixed->True], Cell[CellGroupData[{ Cell[BoxData[ \(LinearSolve[aa, bb]\)], "Input", CellLabel->"In[146]:=", AspectRatioFixed->True], Cell[BoxData[ \(TraditionalForm\`{0.5`, 5.5`, \(-1.`\), \(-5.`\)}\)], "Output", CellLabel->"Out[146]="] }, Open ]], Cell["\<\ But this is a graduate course so we have to take an circuitous \ journey\ \>", "Text", Evaluatable->False, AspectRatioFixed->True], Cell["First get the eigenvalues", "Text", Evaluatable->False, AspectRatioFixed->True], Cell[CellGroupData[{ Cell[BoxData[ \(evals = Eigenvalues[aa]\)], "Input", CellLabel->"In[147]:=", AspectRatioFixed->True], Cell[BoxData[ \(TraditionalForm \`{2.34843516415612407`, \(-1.61094324481297963`\), \(1.13125404032842391`\[InvisibleSpace]\) + 0.913716932581515806`\ \[ImaginaryI], \(1.13125404032842391`\[InvisibleSpace]\) - 0.913716932581515806`\ \[ImaginaryI]}\)], "Output", CellLabel->"Out[147]="], Cell["Then get the corresponding eigenvectors", "Text", Evaluatable->False, AspectRatioFixed->True], Cell[CellGroupData[{ Cell[BoxData[ \(evecs = Eigenvectors[aa]\)], "Input", CellLabel->"In[148]:=", AspectRatioFixed->True], Cell[BoxData[ FormBox[ RowBox[{"(", GridBox[{ {\(-0.103587503290893923`\), "0.224444344034277198`", \(-0.517766435015125559`\), \(-0.819031308537536872`\)}, {\(-0.233492151305640893`\), "0.748594839335965911`", "0.039896466444472999`", \(-0.619270097585429901`\)}, { \(\(-0.262965423918985363`\) - 0.000374187253076117087`\ \[ImaginaryI]\), \(\(-0.443895747032998588`\) + 0.302719313492284269`\ \[ImaginaryI]\), \(\(0.327908221410027911`\[InvisibleSpace]\) + 0.0207980797950751572`\ \[ImaginaryI]\), \(\(0.730896892195016789`\[InvisibleSpace]\) + 0.`\ \[ImaginaryI]\)}, { \(\(-0.262965423918985363`\) + 0.000374187253076117087`\ \[ImaginaryI]\), \(\(-0.443895747032998588`\) - 0.302719313492284269`\ \[ImaginaryI]\), \(\(0.327908221410027911`\[InvisibleSpace]\) - 0.0207980797950751572`\ \[ImaginaryI]\), \(\(0.730896892195016789`\[InvisibleSpace]\) + 0.`\ \[ImaginaryI]\)} }, ColumnAlignments->{Decimal}], ")"}], TraditionalForm]], "Output", CellLabel->"Out[148]="] }, Open ]] }, Open ]], Cell["Now solve the adjoint system for the eigenvalues", "Text", Evaluatable->False, AspectRatioFixed->True], Cell[CellGroupData[{ Cell[BoxData[ \(evalstrans = Eigenvalues[Transpose[aa]]\)], "Input", CellLabel->"In[149]:=", AspectRatioFixed->True], Cell[BoxData[ \(TraditionalForm \`{2.34843516415612585`, \(-1.6109432448129759`\), \(1.13125404032842347`\[InvisibleSpace]\) + 0.913716932581517049`\ \[ImaginaryI], \(1.13125404032842347`\[InvisibleSpace]\) - 0.913716932581517049`\ \[ImaginaryI]}\)], "Output", CellLabel->"Out[149]="], Cell["and the eigenvectors", "Text", Evaluatable->False, AspectRatioFixed->True], Cell[CellGroupData[{ Cell[BoxData[ \(evecstrans = Eigenvectors[Transpose[aa]]\)], "Input", CellLabel->"In[150]:=", AspectRatioFixed->True], Cell[BoxData[ FormBox[ RowBox[{"(", GridBox[{ {"0.526337659630267395`", \(-0.0557749017814110548`\), "0.821282012027914731`", \(-0.212964046509233417`\)}, {\(-0.270849119144703109`\), \(-0.0567133211066609987`\), "0.820598320207729692`", \(-0.500042748912373902`\)}, { \(\(0.126938147904940024`\[InvisibleSpace]\) + 0.286499151931582041`\ \[ImaginaryI]\), \(\(-0.441881711264040255`\) + 0.0767948531864843264`\ \[ImaginaryI]\), \(\(0.638645441022280291`\[InvisibleSpace]\) + 0.`\ \[ImaginaryI]\), \(\(-0.540878261011812888`\) - 0.0151905809524149049`\ \[ImaginaryI]\)}, { \(\(0.126938147904940024`\[InvisibleSpace]\) - 0.286499151931582041`\ \[ImaginaryI]\), \(\(-0.441881711264040255`\) - 0.0767948531864843264`\ \[ImaginaryI]\), \(\(0.638645441022280291`\[InvisibleSpace]\) + 0.`\ \[ImaginaryI]\), \(\(-0.540878261011812888`\) + 0.0151905809524149049`\ \[ImaginaryI]\)} }, ColumnAlignments->{Decimal}], ")"}], TraditionalForm]], "Output", CellLabel->"Out[150]="] }, Open ]] }, Open ]], Cell["Now recall the expansion for the b vector", "Text", Evaluatable->False, AspectRatioFixed->True], Cell[CellGroupData[{ Cell[BoxData[ \(Table[ betax[i] = evecstrans\[LeftDoubleBracket]i\[RightDoubleBracket] . bb \/evecstrans\[LeftDoubleBracket]i\[RightDoubleBracket] . evecs\[LeftDoubleBracket]i\[RightDoubleBracket], {i, 1, Length[aa]}]\)], "Input", CellLabel->"In[151]:=", AspectRatioFixed->True], Cell[BoxData[ \(TraditionalForm \`{\(-1.47730199965397446`\), \(-5.46582552613913996`\), \(-1.09097392112958102`\) - 4.05442167545632692`\ \[ImaginaryI], \(-1.09097392112958102`\) + 4.05442167545632692`\ \[ImaginaryI]}\)], "Output", CellLabel->"Out[151]="] }, Open ]], Cell["This then leads to the expansion for x, get the alfa's", "Text", Evaluatable->False, AspectRatioFixed->True], Cell[CellGroupData[{ Cell[BoxData[ \(Table[ alfax[i] = betax[i]\/evals\[LeftDoubleBracket]i\[RightDoubleBracket], { i, 1, Length[aa]}]\)], "Input", CellLabel->"In[152]:=", AspectRatioFixed->True], Cell[BoxData[ \(TraditionalForm \`{\(-0.629058030726950612`\), 3.39293488069077664`, \(-2.33553812024899754`\) - 1.69758593546122105`\ \[ImaginaryI], \(-2.33553812024899754`\) + 1.69758593546122105`\ \[ImaginaryI]}\)], "Output", CellLabel->"Out[152]="] }, Open ]], Cell["Now construct the x vector, which s the solution", "Text", Evaluatable->False, AspectRatioFixed->True], Cell[CellGroupData[{ Cell[BoxData[ \(exes = N[\[Sum]\+\(i = 1\)\%\(Length[aa]\)alfax[i]\ evecs\[LeftDoubleBracket]i\[RightDoubleBracket]]\)], "Input", CellLabel->"In[153]:=", AspectRatioFixed->True], Cell[BoxData[ \(TraditionalForm \`{\(0.500000000000007549`\[InvisibleSpace]\) + 0.`\ \[ImaginaryI], \(5.50000000000000621`\[InvisibleSpace]\) + 0.`\ \[ImaginaryI], \(-1.00000000000000777`\) + 0.`\ \[ImaginaryI], \(-5.00000000000001243`\) + 0.`\ \[ImaginaryI]}\)], "Output", CellLabel->"Out[153]="] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(LinearSolve[aa, bb]\)], "Input", CellLabel->"In[154]:=", AspectRatioFixed->True], Cell[BoxData[ \(TraditionalForm\`{0.5`, 5.5`, \(-1.`\), \(-5.`\)}\)], "Output", CellLabel->"Out[154]="] }, Open ]] }, Open ]] }, Closed]] }, Open ]] }, FrontEndVersion->"4.0 for Macintosh", ScreenRectangle->{{0, 1152}, {0, 850}}, WindowToolbars->{}, CellGrouping->Manual, WindowSize->{684, 690}, WindowMargins->{{91, Automatic}, {63, Automatic}}, PrintingCopies->1, PrintingPageRange->{9, 13}, PrivateNotebookOptions->{"ColorPalette"->{RGBColor, 128}}, ShowCellLabel->True, ShowCellTags->False, RenderingOptions->{"ObjectDithering"->True, "RasterDithering"->False}, CharacterEncoding->"MacintoshAutomaticEncoding", StyleDefinitions -> FrontEnd`FileName[{ParentDirectory[ParentDirectory[]], \ "work files", "mathematica.modules", "mma.finished"}, "mainstyle.nb", \ CharacterEncoding -> "MacintoshRoman"], MacintoshSystemPageSetup->"\<\ 00<0004/0B`000002mT8o?mooh<" ] (*********************************************************************** Cached data follows. If you edit this Notebook file directly, not using Mathematica, you must remove the line containing CacheID at the top of the file. The cache data will then be recreated when you save this file from within Mathematica. ***********************************************************************) (*CellTagsOutline CellTagsIndex->{} *) (*CellTagsIndex CellTagsIndex->{} *) (*NotebookFileOutline Notebook[{ Cell[1717, 49, 74, 0, 114, "Title"], Cell[1794, 51, 1114, 25, 326, "Text"], Cell[CellGroupData[{ Cell[2933, 80, 95, 3, 80, "Subtitle"], Cell[CellGroupData[{ Cell[3053, 87, 68, 0, 40, "Text"], Cell[3124, 89, 147, 4, 28, "Input"], Cell[3274, 95, 270, 8, 73, "Output"], Cell[CellGroupData[{ Cell[3569, 107, 66, 2, 28, "Input"], Cell[3638, 111, 78, 2, 43, "Output"] }, Open ]], Cell[3731, 116, 105, 3, 40, "Text"], Cell[CellGroupData[{ Cell[3861, 123, 105, 3, 28, "Input"], Cell[3969, 128, 91, 2, 43, "Output"] }, Open ]], Cell[4075, 133, 89, 2, 40, "Text", Evaluatable->False], Cell[CellGroupData[{ Cell[4189, 139, 108, 3, 28, "Input"], Cell[4300, 144, 105, 2, 49, "Output"], Cell[4408, 148, 103, 2, 40, "Text", Evaluatable->False], Cell[CellGroupData[{ Cell[4536, 154, 109, 3, 28, "Input"], Cell[4648, 159, 424, 9, 127, "Output"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell[5121, 174, 145, 5, 30, "Text", Evaluatable->False], Cell[CellGroupData[{ Cell[5291, 183, 124, 3, 28, "Input"], Cell[5418, 188, 105, 2, 70, "Output"], Cell[5526, 192, 84, 2, 24, "Text", Evaluatable->False], Cell[CellGroupData[{ Cell[5635, 198, 125, 3, 28, "Input"], Cell[5763, 203, 424, 9, 70, "Output"] }, Open ]] }, Open ]] }, Closed]], Cell[6226, 217, 116, 2, 27, "Text", Evaluatable->False], Cell[CellGroupData[{ Cell[6367, 223, 120, 3, 27, "Input"], Cell[6490, 228, 179, 4, 43, "Output"] }, Open ]], Cell[6684, 235, 34, 0, 40, "Text"], Cell[CellGroupData[{ Cell[6743, 239, 106, 2, 44, "Input"], Cell[6852, 243, 458, 9, 98, "Output"] }, Open ]], Cell[7325, 255, 300, 4, 82, "Text"], Cell[CellGroupData[{ Cell[7650, 263, 84, 2, 44, "Input"], Cell[7737, 267, 1665, 34, 372, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[9439, 306, 86, 2, 44, "Input"], Cell[9528, 310, 246, 6, 71, "Output"] }, Open ]], Cell[9789, 319, 37, 0, 40, "Text"], Cell[CellGroupData[{ Cell[9851, 323, 76, 2, 44, "Input"], Cell[9930, 327, 304, 6, 71, "Output"] }, Open ]], Cell[10249, 336, 90, 1, 40, "Text"], Cell[CellGroupData[{ Cell[10364, 341, 80, 2, 44, "Input"], Cell[10447, 345, 483, 9, 120, "Output"] }, Open ]], Cell[10945, 357, 78, 0, 40, "Text"], Cell[CellGroupData[{ Cell[11048, 361, 105, 2, 44, "Input"], Cell[11156, 365, 299, 7, 72, "Output"] }, Open ]], Cell[11470, 375, 42, 0, 40, "Text"], Cell[CellGroupData[{ Cell[11537, 379, 104, 2, 44, "Input"], Cell[11644, 383, 458, 9, 98, "Output"] }, Open ]], Cell[12117, 395, 30, 0, 40, "Text"], Cell[CellGroupData[{ Cell[12172, 399, 88, 2, 44, "Input"], Cell[12263, 403, 681, 14, 125, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[12981, 422, 86, 2, 44, "Input"], Cell[13070, 426, 91, 2, 43, "Output"] }, Open ]], Cell[13176, 431, 25, 0, 40, "Text"], Cell[CellGroupData[{ Cell[13226, 435, 60, 2, 44, "Input"], Cell[13289, 439, 91, 2, 43, "Output"] }, Open ]], Cell[13395, 444, 39, 0, 40, "Text"] }, Closed]], Cell[CellGroupData[{ Cell[13471, 449, 72, 0, 38, "Text"], Cell[CellGroupData[{ Cell[13568, 453, 135, 3, 28, "Input"], Cell[13706, 458, 264, 8, 73, "Output"], Cell[CellGroupData[{ Cell[13995, 470, 66, 2, 28, "Input"], Cell[14064, 474, 79, 2, 43, "Output"] }, Open ]], Cell[14158, 479, 105, 3, 40, "Text"], Cell[CellGroupData[{ Cell[14288, 486, 105, 3, 28, "Input"], Cell[14396, 491, 91, 2, 43, "Output"] }, Open ]], Cell[14502, 496, 89, 2, 40, "Text", Evaluatable->False], Cell[CellGroupData[{ Cell[14616, 502, 108, 3, 28, "Input"], Cell[14727, 507, 569, 12, 199, "Output"], Cell[15299, 521, 103, 2, 40, "Text", Evaluatable->False], Cell[CellGroupData[{ Cell[15427, 527, 109, 3, 44, "Input"], Cell[15539, 532, 4021, 74, 636, "Output"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell[19609, 612, 113, 2, 40, "Text", Evaluatable->False], Cell[CellGroupData[{ Cell[19747, 618, 124, 3, 44, "Input"], Cell[19874, 623, 569, 12, 199, "Output"], Cell[20446, 637, 84, 2, 40, "Text", Evaluatable->False], Cell[CellGroupData[{ Cell[20555, 643, 125, 3, 44, "Input"], Cell[20683, 648, 4302, 82, 722, "Output"] }, Open ]] }, Open ]] }, Open ]], Cell[25024, 735, 116, 2, 40, "Text", Evaluatable->False], Cell[CellGroupData[{ Cell[25165, 741, 120, 3, 44, "Input"], Cell[25288, 746, 179, 4, 43, "Output"] }, Open ]], Cell[25482, 753, 34, 0, 40, "Text"], Cell[CellGroupData[{ Cell[25541, 757, 109, 2, 44, "Input"], Cell[25653, 761, 772, 14, 58, "Output"] }, Open ]], Cell[26440, 778, 247, 3, 82, "Text"], Cell[CellGroupData[{ Cell[26712, 785, 109, 2, 44, "Input"], Cell[26824, 789, 3005, 52, 163, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[29866, 846, 92, 2, 44, "Input"], Cell[29961, 850, 372, 8, 43, "Output"] }, Open ]], Cell[30348, 861, 37, 0, 40, "Text"], Cell[CellGroupData[{ Cell[30410, 865, 84, 2, 44, "Input"], Cell[30497, 869, 296, 7, 43, "Output"] }, Open ]], Cell[30808, 879, 90, 1, 40, "Text"], Cell[CellGroupData[{ Cell[30923, 884, 80, 2, 44, "Input"], Cell[31006, 888, 615, 13, 58, "Output"] }, Open ]], Cell[31636, 904, 78, 0, 40, "Text"], Cell[CellGroupData[{ Cell[31739, 908, 105, 2, 44, "Input"], Cell[31847, 912, 449, 10, 43, "Output"] }, Open ]], Cell[32311, 925, 42, 0, 40, "Text"], Cell[CellGroupData[{ Cell[32378, 929, 104, 2, 44, "Input"], Cell[32485, 933, 3930, 75, 1109, "Output"] }, Open ]], Cell[36430, 1011, 30, 0, 40, "Text"], Cell[CellGroupData[{ Cell[36485, 1015, 94, 2, 44, "Input"], Cell[36582, 1019, 160, 4, 43, "Output"] }, Open ]], Cell[36757, 1026, 25, 0, 40, "Text"], Cell[CellGroupData[{ Cell[36807, 1030, 60, 2, 44, "Input"], Cell[36870, 1034, 91, 2, 43, "Output"] }, Open ]], Cell[36976, 1039, 39, 0, 40, "Text"] }, Open ]] }, Closed]] }, Open ]], Cell[CellGroupData[{ Cell[37076, 1046, 150, 3, 53, "Subtitle", Evaluatable->False, PageBreakAbove->True], Cell[CellGroupData[{ Cell[37251, 1053, 88, 2, 40, "Text", Evaluatable->False], Cell[CellGroupData[{ Cell[37364, 1059, 184, 5, 28, "Input"], Cell[37551, 1066, 344, 9, 89, "Output"], Cell[37898, 1077, 153, 5, 40, "Text", Evaluatable->False], Cell[CellGroupData[{ Cell[38076, 1086, 110, 3, 28, "Input"], Cell[38189, 1091, 100, 2, 43, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[38326, 1098, 92, 3, 28, "Input"], Cell[38421, 1103, 85, 2, 43, "Output"] }, Open ]], Cell[38521, 1108, 107, 2, 40, "Text", Evaluatable->False], Cell[38631, 1112, 96, 2, 40, "Text", Evaluatable->False], Cell[CellGroupData[{ Cell[38752, 1118, 104, 3, 28, "Input"], Cell[38859, 1123, 109, 2, 43, "Output"] }, Open ]], Cell[38983, 1128, 144, 5, 40, "Text", Evaluatable->False], Cell[39130, 1135, 89, 2, 40, "Text", Evaluatable->False], Cell[CellGroupData[{ Cell[39244, 1141, 108, 3, 44, "Input"], Cell[39355, 1146, 327, 7, 43, "Output"], Cell[39685, 1155, 103, 2, 40, "Text", Evaluatable->False], Cell[CellGroupData[{ Cell[39813, 1161, 109, 3, 44, "Input"], Cell[39925, 1166, 1332, 27, 89, "Output"] }, Open ]] }, Open ]], Cell[41284, 1197, 112, 2, 40, "Text", Evaluatable->False], Cell[CellGroupData[{ Cell[41421, 1203, 124, 3, 44, "Input"], Cell[41548, 1208, 326, 7, 43, "Output"], Cell[41877, 1217, 84, 2, 40, "Text", Evaluatable->False], Cell[CellGroupData[{ Cell[41986, 1223, 125, 3, 44, "Input"], Cell[42114, 1228, 1330, 27, 89, "Output"] }, Open ]] }, Open ]], Cell[43471, 1259, 105, 2, 40, "Text", Evaluatable->False], Cell[CellGroupData[{ Cell[43601, 1265, 335, 8, 61, "Input"], Cell[43939, 1275, 283, 6, 43, "Output"] }, Open ]], Cell[44237, 1284, 118, 2, 40, "Text", Evaluatable->False], Cell[CellGroupData[{ Cell[44380, 1290, 196, 5, 61, "Input"], Cell[44579, 1297, 279, 6, 43, "Output"] }, Open ]], Cell[44873, 1306, 112, 2, 40, "Text", Evaluatable->False], Cell[CellGroupData[{ Cell[45010, 1312, 205, 5, 69, "Input"], Cell[45218, 1319, 328, 6, 43, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[45583, 1330, 104, 3, 44, "Input"], Cell[45690, 1335, 109, 2, 43, "Output"] }, Open ]] }, Open ]] }, Closed]] }, Open ]] } ] *) (*********************************************************************** End of Mathematica Notebook file. ***********************************************************************)