(*********************************************************************** 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[ 123192, 4404]*) (*NotebookOutlinePosition[ 138280, 4951]*) (* CellTagsIndexPosition[ 138236, 4947]*) (*WindowFrame->Normal*) Notebook[{ Cell["Basic Linear Algebra", "Title"], Cell[TextData[{ "This notebook has been written in ", StyleBox["Mathematica ", FontSlant->"Italic"], "by \n\nMark J. McCready\nProfessor and Chair of Chemical Engineering\n\ University of Notre Dame\nNotre Dame IN 46556\nUSA\n\n\ Mark.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, that if you use it, that this notice remain visible to other users. \ \nThere is no charge for copying and dissemination \n\nVersion: 8/31/98" }], "Text"], Cell[TextData[{ StyleBox[ "This notebook is intended as a companion for the first part of Chapter 1 \ of:\n\n", FontSize->10], StyleBox["A. Varma and M. Morbidelli (1997) ", "SmallText", FontSize->10], StyleBox["Mathematical Methods in Chemical Engineering", "SmallText", FontSize->10, FontWeight->"Plain", FontSlant->"Italic"], StyleBox[", Oxford Press", "SmallText", FontSize->10, FontWeight->"Plain"], StyleBox[".", "SmallText", FontSize->10] }], "Section", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ "The notebook shows many of the specific manipulations that we consider as \ basic linear algebra. It also shows many different techniques for using ", StyleBox["Mathematica", FontSlant->"Italic"], ". " }], "Text"], Cell[CellGroupData[{ Cell[TextData[ "Chapter 1\nMatrices, manipulations and applications"], "Section", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[ "We can first start with a definition of a matrix as a rectangular array of \ numbers. The horizontal entries are rows and the vertical enties are \ columns. When we refer to elements of a matrix typically indices such as \ i,j, k will be used. By convention, the first index is the row and the \ second index is the column."], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[CellGroupData[{ Cell[TextData[{ "Some definitions and elementary operations in ", StyleBox["Mathematica", FontSlant->"Italic"] }], "Subsection", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ "We would like to make a matrix that ", StyleBox["Mathematica", FontSlant->"Italic"], " can understand. Use an opening {{ then close each row with } and then \ open the next with { ....... after the last row you obviously need a closing \ }. The one that is defined here has the name \"a\"" }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[CellGroupData[{ Cell[BoxData[ \(a = {{1, 2, 3}, {7, 5, 6}, {1, 6, 9}}\)], "Input", CellLabel->"In[31]:=", AspectRatioFixed->True], Cell[BoxData[ FormBox[ RowBox[{"(", GridBox[{ {"1", "2", "3"}, {"7", "5", "6"}, {"1", "6", "9"} }, ColumnAlignments->{Decimal}], ")"}], TraditionalForm]], "Output", CellLabel->"Out[31]="] }, Open ]], Cell[TextData[{ "The matrix ", StyleBox["a", FontSlant->"Italic"], " is a 3 by 3 square matrix. We could think of non square matrixes and may \ encounter them in certain numerical problems. However, let us save these \ until they become essential.\n\nA matrix could correspond to many different \ physical entities. For example a 3 by 3 could be the elements in a second \ order tensor which corresponds to the stresses in a fluid at a point and some \ time. Of course, if this were the case, the matrix would be symmetric for \ all simple fluids.\n\nHow can we get a symmetric matrix from ", StyleBox["a", FontSlant->"Italic"], " and what is \"symmetric\". \n\nFirst define transpose, which is a \ switching of a[i,j] --> a[j,i]" }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[CellGroupData[{ Cell[BoxData[ \(Transpose[a]\)], "Input", CellLabel->"In[2]:=", AspectRatioFixed->True], Cell[BoxData[ FormBox[ RowBox[{"(", GridBox[{ {"1", "7", "1"}, {"2", "5", "6"}, {"3", "6", "9"} }, ColumnAlignments->{Decimal}], ")"}], TraditionalForm]], "Output", CellLabel->"Out[2]="] }, Open ]], Cell[TextData[ "You see that we left the diagonal elements unchanged and \"reflected\" the \ off diagonal elements across the diagonal. For example elements a[i,j] , \ where i is row and j is column were transformed to a[ j,i]"], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[CellGroupData[{ Cell[BoxData[ \(a\[LeftDoubleBracket]1, 2\[RightDoubleBracket]\)], "Input", CellLabel->"In[3]:=", AspectRatioFixed->True], Cell[BoxData[ \(TraditionalForm\`2\)], "Output", CellLabel->"Out[3]="] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(a\[LeftDoubleBracket]2, 1\[RightDoubleBracket]\)], "Input", CellLabel->"In[4]:=", AspectRatioFixed->True], Cell[BoxData[ \(TraditionalForm\`7\)], "Output", CellLabel->"Out[4]="] }, Open ]], Cell[TextData[{ "Now we can easily get the symmetric part of ", StyleBox["a", FontSlant->"Italic"], " (such that a[i,j]=a[j,i] and (of course) its antisymmetric piece." }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[CellGroupData[{ Cell[BoxData[ \(asymm = 1\/2\ \((a + Transpose[a])\)\)], "Input", CellLabel->"In[5]:=", AspectRatioFixed->True], Cell[BoxData[ FormBox[ RowBox[{"(", GridBox[{ {"1", \(9\/2\), "2"}, {\(9\/2\), "5", "6"}, {"2", "6", "9"} }, ColumnAlignments->{Decimal}], ")"}], TraditionalForm]], "Output", CellLabel->"Out[5]="] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(aanti = 1\/2\ \((a - Transpose[a])\)\)], "Input", CellLabel->"In[6]:=", AspectRatioFixed->True], Cell[BoxData[ FormBox[ RowBox[{"(", GridBox[{ {"0", \(-\(5\/2\)\), "1"}, {\(5\/2\), "0", "0"}, {\(-1\), "0", "0"} }, ColumnAlignments->{Decimal}], ")"}], TraditionalForm]], "Output", CellLabel->"Out[6]="] }, Open ]], Cell["\<\ We see that the antisymmetric part does not have any diagonal \ elements because a[i,i] cannot be equal to -a[i,i]. Thus our definition of \ an anti symmetric matrix is that a[i,j]=-a[j,i]. \ \>", "Text", Evaluatable->False, AspectRatioFixed->True], Cell["\<\ Symmetric and antisymetric matrixes are useful, for example, in \ defining the basic elements of fluid motion in a study of \"kinematics\". It \ is convenient that\ \>", "Text", Evaluatable->False, AspectRatioFixed->True], Cell[CellGroupData[{ Cell[BoxData[ \(asymm + aanti\)], "Input", CellLabel->"In[7]:="], Cell[BoxData[ FormBox[ RowBox[{"(", GridBox[{ {"1", "2", "3"}, {"7", "5", "6"}, {"1", "6", "9"} }, ColumnAlignments->{Decimal}], ")"}], TraditionalForm]], "Output", CellLabel->"Out[7]="] }, Open ]], Cell[TextData[{ "thus we have recovered", StyleBox[" a", FontSlant->"Italic"], " again." }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[ "From these operations we see that addition and subtraction of matrices is \ done by simple addition and subtraction of corresponding elements. "], "Text",\ Evaluatable->False, AspectRatioFixed->True], Cell[BoxData[ \(matrixad[r1_, r2_] := \(za = Table[ r1\[LeftDoubleBracket]i, j\[RightDoubleBracket] + r2\[LeftDoubleBracket]i, j\[RightDoubleBracket], {i, 1, Length[r1]}, {j, 1, Length[r2]}]\)\)], "Input", CellLabel->"In[8]:=", AspectRatioFixed->True], Cell[CellGroupData[{ Cell[BoxData[ \(a + a^2\)], "Input", CellLabel->"In[9]:="], Cell[BoxData[ FormBox[ RowBox[{"(", GridBox[{ {"2", "6", "12"}, {"56", "30", "42"}, {"2", "42", "90"} }, ColumnAlignments->{Decimal}], ")"}], TraditionalForm]], "Output", CellLabel->"Out[9]="] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(matrixad[a, a^2]\)], "Input", CellLabel->"In[10]:="], Cell[BoxData[ FormBox[ RowBox[{"(", GridBox[{ {"2", "6", "12"}, {"56", "30", "42"}, {"2", "42", "90"} }, ColumnAlignments->{Decimal}], ")"}], TraditionalForm]], "Output", CellLabel->"Out[10]="] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(za\)], "Input", CellLabel->"In[11]:="], Cell[BoxData[ FormBox[ RowBox[{"(", GridBox[{ {"2", "6", "12"}, {"56", "30", "42"}, {"2", "42", "90"} }, ColumnAlignments->{Decimal}], ")"}], TraditionalForm]], "Output", CellLabel->"Out[11]="] }, Open ]], Cell["\<\ To do addition or subtraction, of course, the matrices need to be \ the same shape.\ \>", "Text", Evaluatable->False, AspectRatioFixed->True], Cell[CellGroupData[{ Cell[BoxData[ \(az = {{1, 4}, {4, 5}, {2, 9}}\)], "Input", CellLabel->"In[12]:="], Cell[BoxData[ FormBox[ RowBox[{"(", GridBox[{ {"1", "4"}, {"4", "5"}, {"2", "9"} }, ColumnAlignments->{Decimal}], ")"}], TraditionalForm]], "Output", CellLabel->"Out[12]="] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(a + {{1, 4}, {4, 5}, {2, 9}}\)], "Input", CellLabel->"In[13]:=", AspectRatioFixed->True], Cell[BoxData[ FormBox[ RowBox[{ \(Thread::"tdlen"\), \( : \ \), "\<\"Objects of unequal length in \\!\\(TraditionalForm\\`\\(\\({1, \ 4}\\) + \\({1, 2, 3}\\)\\)\\) cannot be combined.\"\>"}], TraditionalForm]], "Message"], Cell[BoxData[ FormBox[ RowBox[{ \(Thread::"tdlen"\), \( : \ \), "\<\"Objects of unequal length in \\!\\(TraditionalForm\\`\\(\\({4, \ 5}\\) + \\({7, 5, 6}\\)\\)\\) cannot be combined.\"\>"}], TraditionalForm]], "Message"], Cell[BoxData[ FormBox[ RowBox[{ \(Thread::"tdlen"\), \( : \ \), "\<\"Objects of unequal length in \\!\\(TraditionalForm\\`\\(\\({2, \ 9}\\) + \\({1, 6, 9}\\)\\)\\) cannot be combined.\"\>"}], TraditionalForm]], "Message"], Cell[BoxData[ FormBox[ RowBox[{ \(General::"stop"\), \( : \ \), "\<\"Further output of \\!\\(TraditionalForm\\`\\(Thread :: \\\"tdlen\ \\\"\\)\\) will be suppressed during this calculation.\"\>"}], TraditionalForm]], "Message"], Cell[BoxData[ \(TraditionalForm \`{{1, 4} + {1, 2, 3}, {4, 5} + {7, 5, 6}, {2, 9} + {1, 6, 9}}\)], "Output", CellLabel->"Out[13]="] }, Open ]], Cell[TextData[{ "Even ", StyleBox["Mathematica", FontSlant->"Italic"], " recognizes the problem." }], "Text", Evaluatable->False, AspectRatioFixed->True] }, Open ]], Cell[CellGroupData[{ Cell["Index notation", "Subsection"], Cell[TextData[{ "In mechanics, many physical quantities are represented by rectangular \ arrays of numbers. For example, mass or speed are scalars ====> m, s\n\n\ velocity or acceleration are normally vectors ", Cell[BoxData[ \(TraditionalForm\`a\)]], "= (", Cell[BoxData[ \(TraditionalForm\`a\_1\)]], ",", Cell[BoxData[ \(TraditionalForm\`a\_2\)]], ",", Cell[BoxData[ \(TraditionalForm\`a\_3\)]], ")\n\nIf you wanted to describe the velocity gradients in a fluid, at a \ point, at some instant in time, you would write the tensor", StyleBox[" grad u", FontSlant->"Italic"], ", where ", StyleBox["grad", FontSlant->"Italic"], " and ", StyleBox["u", FontSlant->"Italic"], " are both vectors, the result (a ", StyleBox["dyad", FontSlant->"Italic"], " product) is a 3 by 3 array which is a second order tensor.\n\nOther \ entities lead to higher order tensors.\n\nIn all of these, there are only \ three space directions. Thus we can use \"1, 2, 3\" as the indices, instead \ of say, x, y, z. If this is done we can think of representing scalars, \ vectors and tensors with the same notation as\n\nscalar ===> s, zero order \ tensor\nvector ===> v", StyleBox["i", FontVariations->{"CompatibilityType"->"Subscript"}], " , first order tensor\n\"tensor\"===> T", StyleBox["ij", FontVariations->{"CompatibilityType"->"Subscript"}], ", second order tensor\nthird order tensor , Q", StyleBox["ijk", FontVariations->{"CompatibilityType"->"Subscript"}], ", \n\netc. \n\nWe use the convention that each subscript takes on all \ values of 1, 2, 3, ", Cell[BoxData[ \(v\_i\)]], " = (", Cell[BoxData[ \(v\_1\)]], ", ", Cell[BoxData[ \(v\_2\)]], ",", Cell[BoxData[ \(v\_3\)]], ")\n\nFor vector operations, we use the convention that repeated indexes \ are summed over\n\n", Cell[BoxData[ \(v\_i\)]], " ", Cell[BoxData[ \(u\_i\)]], " = ", Cell[BoxData[ \(v\_1\)]], " ", Cell[BoxData[ \(u\_1\)]], " +", Cell[BoxData[ \(v\_2\)]], Cell[BoxData[ \(u\_2\)]], " + ", Cell[BoxData[ \(v\_3\)]], Cell[BoxData[ RowBox[{\(u\_3\), " ", "=", " ", RowBox[{ StyleBox["v", FontWeight->"Bold"], " ", "\[CenterDot]", " ", StyleBox["u", FontWeight->"Bold"]}]}]]] }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[CellGroupData[{ Cell[TextData[{ "How do we do a calculation, and how do we do it in ", StyleBox["Mathematica?", FontSlant->"Italic"], " \n" }], "Subsubsection"], Cell[CellGroupData[{ Cell["Cross Product", "Subsubsection"], Cell[TextData[{ "Let's consider a cross product in index notation. We have the definition, \ ", Cell[BoxData[ \(TraditionalForm\`\[Epsilon]\_ijk\)]], Cell[BoxData[ \(TraditionalForm\`u\_j\)]], Cell[BoxData[ \(TraditionalForm\`v\_k\)]], ".\n\nHere is how we do this calculation" }], "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(cross1 = Table[Sum[Sum[\[Epsilon][i, j, k]\ u[j] v[k], {k, 1, 3}], {j, 1, 3}], { i, 1, 3}]\)], "Input", CellLabel->"In[14]:="], Cell[BoxData[ \(TraditionalForm \`{\(u(1)\)\ \(v(1)\)\ \(\[Epsilon](1, 1, 1)\) + \(u(1)\)\ \(v(2)\)\ \(\[Epsilon](1, 1, 2)\) + \(u(1)\)\ \(v(3)\)\ \(\[Epsilon](1, 1, 3)\) + \(u(2)\)\ \(v(1)\)\ \(\[Epsilon](1, 2, 1)\) + \(u(2)\)\ \(v(2)\)\ \(\[Epsilon](1, 2, 2)\) + \(u(2)\)\ \(v(3)\)\ \(\[Epsilon](1, 2, 3)\) + \(u(3)\)\ \(v(1)\)\ \(\[Epsilon](1, 3, 1)\) + \(u(3)\)\ \(v(2)\)\ \(\[Epsilon](1, 3, 2)\) + \(u(3)\)\ \(v(3)\)\ \(\[Epsilon](1, 3, 3)\), \(u(1)\)\ \(v(1)\)\ \(\[Epsilon](2, 1, 1)\) + \(u(1)\)\ \(v(2)\)\ \(\[Epsilon](2, 1, 2)\) + \(u(1)\)\ \(v(3)\)\ \(\[Epsilon](2, 1, 3)\) + \(u(2)\)\ \(v(1)\)\ \(\[Epsilon](2, 2, 1)\) + \(u(2)\)\ \(v(2)\)\ \(\[Epsilon](2, 2, 2)\) + \(u(2)\)\ \(v(3)\)\ \(\[Epsilon](2, 2, 3)\) + \(u(3)\)\ \(v(1)\)\ \(\[Epsilon](2, 3, 1)\) + \(u(3)\)\ \(v(2)\)\ \(\[Epsilon](2, 3, 2)\) + \(u(3)\)\ \(v(3)\)\ \(\[Epsilon](2, 3, 3)\), \(u(1)\)\ \(v(1)\)\ \(\[Epsilon](3, 1, 1)\) + \(u(1)\)\ \(v(2)\)\ \(\[Epsilon](3, 1, 2)\) + \(u(1)\)\ \(v(3)\)\ \(\[Epsilon](3, 1, 3)\) + \(u(2)\)\ \(v(1)\)\ \(\[Epsilon](3, 2, 1)\) + \(u(2)\)\ \(v(2)\)\ \(\[Epsilon](3, 2, 2)\) + \(u(2)\)\ \(v(3)\)\ \(\[Epsilon](3, 2, 3)\) + \(u(3)\)\ \(v(1)\)\ \(\[Epsilon](3, 3, 1)\) + \(u(3)\)\ \(v(2)\)\ \(\[Epsilon](3, 3, 2)\) + \(u(3)\)\ \(v(3)\)\ \(\[Epsilon](3, 3, 3)\)}\)], "Output", CellLabel->"Out[14]="] }, Open ]], Cell["\<\ We know that we sum over repreated indices and let single ones take \ any value. Sum[ #, {j,1,3}] takes care of the repeated index j. A Table[ \ #,{i,1,3}] takes care of a free index. \ \>", "Text"], Cell["\<\ Let's do the calculation one step at a time. I think that it is \ easiest to start with the \"rightmost\" repeated index. This is k. We first \ sum over k. \ \>", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(tempk = Sum[\[Epsilon][i, j, k]\ u[j] v[k], {k, 1, 3}]\)], "Input", CellLabel->"In[15]:="], Cell[BoxData[ \(TraditionalForm \`\(u(j)\)\ \(v(1)\)\ \(\[Epsilon](i, j, 1)\) + \(u(j)\)\ \(v(2)\)\ \(\[Epsilon](i, j, 2)\) + \(u(j)\)\ \(v(3)\)\ \(\[Epsilon](i, j, 3)\)\)], "Output", CellLabel->"Out[15]="] }, Open ]], Cell["\<\ We see how the sum works. You leave i and j alone and then let k \ take values of 1,2,3 -- and sum these. There are now 3 terms. You still \ have 2 free indices.\ \>", "Text"], Cell["Now we need to sum over j", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(tempj = Sum[tempk, {j, 1, 3}]\)], "Input", CellLabel->"In[16]:="], Cell[BoxData[ FormBox[ RowBox[{ \(General::"spell1"\), \( : \ \), "\<\"Possible spelling error: new symbol name \ \\\"\\!\\(TraditionalForm\\`tempj\\)\\\" is similar to existing symbol \ \\\"\\!\\(TraditionalForm\\`tempk\\)\\\".\"\>"}], TraditionalForm]], "Message"], Cell[BoxData[ \(TraditionalForm \`\(u(1)\)\ \(v(1)\)\ \(\[Epsilon](i, 1, 1)\) + \(u(1)\)\ \(v(2)\)\ \(\[Epsilon](i, 1, 2)\) + \(u(1)\)\ \(v(3)\)\ \(\[Epsilon](i, 1, 3)\) + \(u(2)\)\ \(v(1)\)\ \(\[Epsilon](i, 2, 1)\) + \(u(2)\)\ \(v(2)\)\ \(\[Epsilon](i, 2, 2)\) + \(u(2)\)\ \(v(3)\)\ \(\[Epsilon](i, 2, 3)\) + \(u(3)\)\ \(v(1)\)\ \(\[Epsilon](i, 3, 1)\) + \(u(3)\)\ \(v(2)\)\ \(\[Epsilon](i, 3, 2)\) + \(u(3)\)\ \(v(3)\)\ \(\[Epsilon](i, 3, 3)\)\)], "Output", CellLabel->"Out[16]="] }, Open ]], Cell["\<\ We have created a single sum with 9 terms now. If you summed over \ i, (which is wrong) you would have a scalar with 27 terms. What we do is use \ the Table command to create a vector with three elements. Note the commas \ that separate the elements. \ \>", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(tempi = Table[tempj, \ {i, 1, 3}]\)], "Input", CellLabel->"In[17]:="], Cell[BoxData[ FormBox[ RowBox[{ \(General::"spell"\), \( : \ \), "\<\"Possible spelling error: new symbol name \ \\\"\\!\\(TraditionalForm\\`tempi\\)\\\" is similar to existing symbols \ \\!\\(TraditionalForm\\`\\({tempj, tempk}\\)\\).\"\>"}], TraditionalForm]], "Message"], Cell[BoxData[ \(TraditionalForm \`{\(u(1)\)\ \(v(1)\)\ \(\[Epsilon](1, 1, 1)\) + \(u(1)\)\ \(v(2)\)\ \(\[Epsilon](1, 1, 2)\) + \(u(1)\)\ \(v(3)\)\ \(\[Epsilon](1, 1, 3)\) + \(u(2)\)\ \(v(1)\)\ \(\[Epsilon](1, 2, 1)\) + \(u(2)\)\ \(v(2)\)\ \(\[Epsilon](1, 2, 2)\) + \(u(2)\)\ \(v(3)\)\ \(\[Epsilon](1, 2, 3)\) + \(u(3)\)\ \(v(1)\)\ \(\[Epsilon](1, 3, 1)\) + \(u(3)\)\ \(v(2)\)\ \(\[Epsilon](1, 3, 2)\) + \(u(3)\)\ \(v(3)\)\ \(\[Epsilon](1, 3, 3)\), \(u(1)\)\ \(v(1)\)\ \(\[Epsilon](2, 1, 1)\) + \(u(1)\)\ \(v(2)\)\ \(\[Epsilon](2, 1, 2)\) + \(u(1)\)\ \(v(3)\)\ \(\[Epsilon](2, 1, 3)\) + \(u(2)\)\ \(v(1)\)\ \(\[Epsilon](2, 2, 1)\) + \(u(2)\)\ \(v(2)\)\ \(\[Epsilon](2, 2, 2)\) + \(u(2)\)\ \(v(3)\)\ \(\[Epsilon](2, 2, 3)\) + \(u(3)\)\ \(v(1)\)\ \(\[Epsilon](2, 3, 1)\) + \(u(3)\)\ \(v(2)\)\ \(\[Epsilon](2, 3, 2)\) + \(u(3)\)\ \(v(3)\)\ \(\[Epsilon](2, 3, 3)\), \(u(1)\)\ \(v(1)\)\ \(\[Epsilon](3, 1, 1)\) + \(u(1)\)\ \(v(2)\)\ \(\[Epsilon](3, 1, 2)\) + \(u(1)\)\ \(v(3)\)\ \(\[Epsilon](3, 1, 3)\) + \(u(2)\)\ \(v(1)\)\ \(\[Epsilon](3, 2, 1)\) + \(u(2)\)\ \(v(2)\)\ \(\[Epsilon](3, 2, 2)\) + \(u(2)\)\ \(v(3)\)\ \(\[Epsilon](3, 2, 3)\) + \(u(3)\)\ \(v(1)\)\ \(\[Epsilon](3, 3, 1)\) + \(u(3)\)\ \(v(2)\)\ \(\[Epsilon](3, 3, 2)\) + \(u(3)\)\ \(v(3)\)\ \(\[Epsilon](3, 3, 3)\)}\)], "Output", CellLabel->"Out[17]="] }, Open ]], Cell[TextData[ "We know the values of the \[Epsilon][i,j,k]'s. Let's first define all of \ these (using brute force) and then use a substitution command to apply them \ to \"tempi\". "], "Text"], Cell[CellGroupData[{ Cell["\<\ Here we can define the alternating unit tensor, eps[i,j,k]. (Note \ that the semicolon suppresses the output.\ \>", "Text"], Cell[BoxData[ \(eps[1, 2, 3] = 1; \neps[2, 3, 1] = 1; \neps[3, 1, 2] = 1; \n eps[3, 2, 1] = \(-1\); \neps[2, 1, 3] = \(-1\); \neps[1, 3, 2] = \(-1\); \neps[1, 1, 1] = 0; \neps[2, 2, 2] = 0; \neps[3, 3, 3] = 0; \n eps[1, 1, 2] = 0; \neps[1, 1, 3] = 0; \neps[2, 1, 2] = 0; \n eps[2, 1, 1] = 0; \neps[2, 2, 1] = 0; \neps[1, 2, 2] = 0; \n eps[1, 3, 3] = 0; \neps[3, 1, 1] = 0; \neps[3, 3, 1] = 0; \n eps[3, 3, 2] = 0; \neps[3, 2, 2] = 0; \neps[2, 3, 3] = 0; \n eps[1, 2, 1] = 0; \neps[1, 3, 1] = 0; \neps[2, 3, 2] = 0; \n eps[3, 2, 3] = 0; \neps[3, 1, 3] = 0; \neps[2, 2, 3] = 0; \)], "Input", CellLabel->"In[18]:="] }, Open ]], Cell["\<\ To do the substitution, we make a list with one level of braces \"{\ \". It takes a couple of Flatten commands which each reduce the number of \ braces around an object.\ \>", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(sublist = Flatten[Flatten[ Table[\[Epsilon][i, j, k] -> eps[i, j, k], {i, 1, 3}, {j, 1, 3}, { k, 1, 3}]]]\)], "Input", CellLabel->"In[19]:="], Cell[BoxData[ \(TraditionalForm \`{\[Epsilon](1, 1, 1) \[Rule] 0, \[Epsilon](1, 1, 2) \[Rule] 0, \[Epsilon](1, 1, 3) \[Rule] 0, \[Epsilon](1, 2, 1) \[Rule] 0, \[Epsilon](1, 2, 2) \[Rule] 0, \[Epsilon](1, 2, 3) \[Rule] 1, \[Epsilon](1, 3, 1) \[Rule] 0, \[Epsilon](1, 3, 2) \[Rule] \(-1\), \[Epsilon](1, 3, 3) \[Rule] 0, \[Epsilon](2, 1, 1) \[Rule] 0, \[Epsilon](2, 1, 2) \[Rule] 0, \[Epsilon](2, 1, 3) \[Rule] \(-1\), \[Epsilon](2, 2, 1) \[Rule] 0, \[Epsilon](2, 2, 2) \[Rule] 0, \[Epsilon](2, 2, 3) \[Rule] 0, \[Epsilon](2, 3, 1) \[Rule] 1, \[Epsilon](2, 3, 2) \[Rule] 0, \[Epsilon](2, 3, 3) \[Rule] 0, \[Epsilon](3, 1, 1) \[Rule] 0, \[Epsilon](3, 1, 2) \[Rule] 1, \[Epsilon](3, 1, 3) \[Rule] 0, \[Epsilon](3, 2, 1) \[Rule] \(-1\), \[Epsilon](3, 2, 2) \[Rule] 0, \[Epsilon](3, 2, 3) \[Rule] 0, \[Epsilon](3, 3, 1) \[Rule] 0, \[Epsilon](3, 3, 2) \[Rule] 0, \[Epsilon](3, 3, 3) \[Rule] 0}\)], "Output", CellLabel->"Out[19]="] }, Open ]], Cell["\<\ Now we use it on tempi with the \"/.\" (this substitution coomand \ must be a secret code from Steve Wolfram's first computer algebra \ package.\ \>", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(crossproduct = tempi /. sublist\)], "Input", CellLabel->"In[20]:="], Cell[BoxData[ \(TraditionalForm \`{\(u(2)\)\ \(v(3)\) - \(u(3)\)\ \(v(2)\), \(u(3)\)\ \(v(1)\) - \(u(1)\)\ \(v(3)\), \(u(1)\)\ \(v(2)\) - \(u(2)\)\ \(v(1)\)}\)], "Output", CellLabel->"Out[20]="] }, Open ]], Cell["We can check this against the canned function,", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(check = Cross[{u[1], u[2], u[3]}, {v[1], v[2], v[3]}]\)], "Input", CellLabel->"In[21]:="], Cell[BoxData[ FormBox[ RowBox[{ \(General::"spell1"\), \( : \ \), "\<\"Possible spelling error: new symbol name \ \\\"\\!\\(TraditionalForm\\`check\\)\\\" is similar to existing symbol \ \\\"\\!\\(TraditionalForm\\`Check\\)\\\".\"\>"}], TraditionalForm]], "Message"], Cell[BoxData[ \(TraditionalForm \`{\(u(2)\)\ \(v(3)\) - \(u(3)\)\ \(v(2)\), \(u(3)\)\ \(v(1)\) - \(u(1)\)\ \(v(3)\), \(u(1)\)\ \(v(2)\) - \(u(2)\)\ \(v(1)\)}\)], "Output", CellLabel->"Out[21]="] }, Open ]], Cell["It works!!", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(crossproduct - check\)], "Input", CellLabel->"In[22]:="], Cell[BoxData[ \(TraditionalForm\`{0, 0, 0}\)], "Output", CellLabel->"Out[22]="] }, Open ]], Cell["\<\ We might also look at the definition of the Cross Product using the \ Determinant.\ \>", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(det1 = {{e[1], e[2], e[3]}, {u[1], u[2], u[3]}, {v[1], v[2], v[3]}}\)], "Input", CellLabel->"In[23]:="], Cell[BoxData[ FormBox[ RowBox[{"(", GridBox[{ {\(e(1)\), \(e(2)\), \(e(3)\)}, {\(u(1)\), \(u(2)\), \(u(3)\)}, {\(v(1)\), \(v(2)\), \(v(3)\)} }], ")"}], TraditionalForm]], "Output", CellLabel->"Out[23]="] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(det2 = Det[det1]\)], "Input", CellLabel->"In[24]:="], Cell[BoxData[ \(TraditionalForm \`\(-\(e(3)\)\)\ \(u(2)\)\ \(v(1)\) + \(e(2)\)\ \(u(3)\)\ \(v(1)\) + \(e(3)\)\ \(u(1)\)\ \(v(2)\) - \(e(1)\)\ \(u(3)\)\ \(v(2)\) - \(e(2)\)\ \(u(1)\)\ \(v(3)\) + \(e(1)\)\ \(u(2)\)\ \(v(3)\)\)], "Output",\ CellLabel->"Out[24]="] }, Open ]], Cell["\<\ We get this in the normal form by finding the coeffients of the \ terms multiplying each of the e[i] unit vectors, \ \>", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(det3 = Table[Coefficient[det2, e[i]], {i, 1, 3}]\)], "Input", CellLabel->"In[25]:="], Cell[BoxData[ \(TraditionalForm \`{\(u(2)\)\ \(v(3)\) - \(u(3)\)\ \(v(2)\), \(u(3)\)\ \(v(1)\) - \(u(1)\)\ \(v(3)\), \(u(1)\)\ \(v(2)\) - \(u(2)\)\ \(v(1)\)}\)], "Output", CellLabel->"Out[25]="] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(det3 - check\)], "Input", CellLabel->"In[26]:="], Cell[BoxData[ \(TraditionalForm\`{0, 0, 0}\)], "Output", CellLabel->"Out[26]="] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell[TextData[{ "Dot product of two vectors, ", Cell[BoxData[ FormBox[ StyleBox[\(v\_i\ u\_i\), "Text"], TextForm]]], ". " }], "Subsubsection"], Cell["Just sum over i.", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(Sum[v[i]\ u[i], {i, 1, 3}]\)], "Input", CellLabel->"In[27]:="], Cell[BoxData[ \(TraditionalForm \`\(u(1)\)\ \(v(1)\) + \(u(2)\)\ \(v(2)\) + \(u(3)\)\ \(v(3)\)\)], "Output", CellLabel->"Out[27]="] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(Dot[{v[1], v[2], v[3]}, {u[1], u[2], u[3]}]\)], "Input", CellLabel->"In[28]:="], Cell[BoxData[ \(TraditionalForm \`\(u(1)\)\ \(v(1)\) + \(u(2)\)\ \(v(2)\) + \(u(3)\)\ \(v(3)\)\)], "Output", CellLabel->"Out[28]="] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell[TextData[{ "Here is a dot product of a vector with a tensor, ", Cell[BoxData[ \(TraditionalForm\`u\_i\)]], " ", Cell[BoxData[ \(TraditionalForm\`T\_ij\)]] }], "Subsubsection"], Cell["Sum over i and let j take all three values, ", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(Table[Sum[u[i]\ T[i, j], {i, 1, 3}], {j, 1, 3}]\)], "Input", CellLabel->"In[29]:="], Cell[BoxData[ \(TraditionalForm \`{\(T(1, 1)\)\ \(u(1)\) + \(T(2, 1)\)\ \(u(2)\) + \(T(3, 1)\)\ \(u(3)\), \(T(1, 2)\)\ \(u(1)\) + \(T(2, 2)\)\ \(u(2)\) + \(T(3, 2)\)\ \(u(3)\), \(T(1, 3)\)\ \(u(1)\) + \(T(2, 3)\)\ \(u(2)\) + \(T(3, 3)\)\ \(u(3)\)} \)], "Output", CellLabel->"Out[29]="] }, Open ]], Cell["\<\ We can make this look better as a column vector using the \ command,\ \>", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(MatrixForm[%]\)], "Input", CellLabel->"In[30]:="], Cell[BoxData[ FormBox[ InterpretationBox[ RowBox[{"(", GridBox[{ { \(\(T(1, 1)\)\ \(u(1)\) + \(T(2, 1)\)\ \(u(2)\) + \(T(3, 1)\)\ \(u(3)\)\)}, { \(\(T(1, 2)\)\ \(u(1)\) + \(T(2, 2)\)\ \(u(2)\) + \(T(3, 2)\)\ \(u(3)\)\)}, { \(\(T(1, 3)\)\ \(u(1)\) + \(T(2, 3)\)\ \(u(2)\) + \(T(3, 3)\)\ \(u(3)\)\)} }], ")"}], MatrixForm[ { Plus[ Times[ T[ 1, 1], u[ 1]], Times[ T[ 2, 1], u[ 2]], Times[ T[ 3, 1], u[ 3]]], Plus[ Times[ T[ 1, 2], u[ 1]], Times[ T[ 2, 2], u[ 2]], Times[ T[ 3, 2], u[ 3]]], Plus[ Times[ T[ 1, 3], u[ 1]], Times[ T[ 2, 3], u[ 2]], Times[ T[ 3, 3], u[ 3]]]}]], TraditionalForm]], "Output", CellLabel->"Out[30]//MatrixForm="] }, Open ]], Cell["\<\ Again it might be useful to see the intermediate step, so we redo \ it:\ \>", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(q1 = Sum[u[i]\ T[i, j], {i, 1, 3}]\)], "Input", CellLabel->"In[31]:="], Cell[BoxData[ \(TraditionalForm \`\(T(1, j)\)\ \(u(1)\) + \(T(2, j)\)\ \(u(2)\) + \(T(3, j)\)\ \(u(3)\)\)], "Output", CellLabel->"Out[31]="] }, Open ]], Cell["Then do the Table to get the answer", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(q2 = Table[q1, {j, 1, 3}]\)], "Input", CellLabel->"In[32]:="], Cell[BoxData[ \(TraditionalForm \`{\(T(1, 1)\)\ \(u(1)\) + \(T(2, 1)\)\ \(u(2)\) + \(T(3, 1)\)\ \(u(3)\), \(T(1, 2)\)\ \(u(1)\) + \(T(2, 2)\)\ \(u(2)\) + \(T(3, 2)\)\ \(u(3)\), \(T(1, 3)\)\ \(u(1)\) + \(T(2, 3)\)\ \(u(2)\) + \(T(3, 3)\)\ \(u(3)\)} \)], "Output", CellLabel->"Out[32]="] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell[TextData[{ "Here is the \"double dot\" product of two tensors, ", Cell[BoxData[ \(TraditionalForm\`T\_ij\)]], " ", Cell[BoxData[ \(TraditionalForm\`S\_ji\)]], " = T : S" }], "Subsubsection"], Cell["We just need a double sum", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(Sum[Sum[T[i, j]\ S[j, i], {i, 1, 3}], {j, 1, 3}]\)], "Input", CellLabel->"In[33]:="], Cell[BoxData[ \(TraditionalForm \`\(S(1, 1)\)\ \(T(1, 1)\) + \(S(2, 1)\)\ \(T(1, 2)\) + \(S(3, 1)\)\ \(T(1, 3)\) + \(S(1, 2)\)\ \(T(2, 1)\) + \(S(2, 2)\)\ \(T(2, 2)\) + \(S(3, 2)\)\ \(T(2, 3)\) + \(S(1, 3)\)\ \(T(3, 1)\) + \(S(2, 3)\)\ \(T(3, 2)\) + \(S(3, 3)\)\ \(T(3, 3)\)\)], "Output", CellLabel->"Out[33]="] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(temps = Sum[\ T[i, j]\ S[j, i], {i, 1, 3}]\)], "Input", CellLabel->"In[34]:="], Cell[BoxData[ FormBox[ RowBox[{ \(General::"spell"\), \( : \ \), "\<\"Possible spelling error: new symbol name \ \\\"\\!\\(TraditionalForm\\`temps\\)\\\" is similar to existing symbols \ \\!\\(TraditionalForm\\`\\({tempi, tempj, tempk}\\)\\).\"\>"}], TraditionalForm]], "Message"], Cell[BoxData[ \(TraditionalForm \`\(S(j, 1)\)\ \(T(1, j)\) + \(S(j, 2)\)\ \(T(2, j)\) + \(S(j, 3)\)\ \(T(3, j)\)\)], "Output", CellLabel->"Out[34]="] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(Sum[temps, {j, 1, 3}]\)], "Input", CellLabel->"In[35]:="], Cell[BoxData[ \(TraditionalForm \`\(S(1, 1)\)\ \(T(1, 1)\) + \(S(2, 1)\)\ \(T(1, 2)\) + \(S(3, 1)\)\ \(T(1, 3)\) + \(S(1, 2)\)\ \(T(2, 1)\) + \(S(2, 2)\)\ \(T(2, 2)\) + \(S(3, 2)\)\ \(T(2, 3)\) + \(S(1, 3)\)\ \(T(3, 1)\) + \(S(2, 3)\)\ \(T(3, 2)\) + \(S(3, 3)\)\ \(T(3, 3)\)\)], "Output", CellLabel->"Out[35]="] }, Open ]] }, Open ]] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell["Multiplication", "Subsection", Evaluatable->False, AspectRatioFixed->True], Cell["\<\ Any matrix can be multiplied by a single scalar constant. Define a new matrix rr, note that the semicolon suppresses display\ \>", "Text", Evaluatable->False, AspectRatioFixed->True], Cell[BoxData[ \(\(rr = {{r\_11, r\_12, r\_13}, {r\_21, r\_22, r\_23}, {r\_31, r\_32, r\_33}}; \)\)], "Input", CellLabel->"In[24]:=", AspectRatioFixed->True], Cell[TextData["To multiply we have equivalently:"], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[CellGroupData[{ Cell[BoxData[ \(\[Alpha]\ rr\)], "Input", CellLabel->"In[37]:=", AspectRatioFixed->True], Cell[BoxData[ FormBox[ RowBox[{"(", GridBox[{ {\(\[Alpha]\ r\_11\), \(\[Alpha]\ r\_12\), \(\[Alpha]\ r\_13\)}, {\(\[Alpha]\ r\_21\), \(\[Alpha]\ r\_22\), \(\[Alpha]\ r\_23\)}, {\(\[Alpha]\ r\_31\), \(\[Alpha]\ r\_32\), \(\[Alpha]\ r\_33\)} }], ")"}], TraditionalForm]], "Output", CellLabel->"Out[37]="] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(rr\ \[Alpha]\)], "Input", CellLabel->"In[38]:=", AspectRatioFixed->True], Cell[BoxData[ FormBox[ RowBox[{"(", GridBox[{ {\(\[Alpha]\ r\_11\), \(\[Alpha]\ r\_12\), \(\[Alpha]\ r\_13\)}, {\(\[Alpha]\ r\_21\), \(\[Alpha]\ r\_22\), \(\[Alpha]\ r\_23\)}, {\(\[Alpha]\ r\_31\), \(\[Alpha]\ r\_32\), \(\[Alpha]\ r\_33\)} }], ")"}], TraditionalForm]], "Output", CellLabel->"Out[38]="] }, Open ]], Cell[TextData[ "If we want to multiply matries, we need to be careful of the definition. "], "Text", Evaluatable->False, AspectRatioFixed->True], Cell["\<\ Consider a degenerate matrix, a vector, that is also a first order \ tensor (assuming a physical orgin)\ \>", "Text", Evaluatable->False, AspectRatioFixed->True], Cell[BoxData[ \(ss = {s\_1, s\_2, s\_3}; \ntt = {t\_1, t\_2, t\_3}; \)], "Input", CellLabel->"In[39]:=", AspectRatioFixed->True], Cell[TextData[{ "A dot product yields: (s", StyleBox["i", FontVariations->{"CompatibilityType"->"Subscript"}], " t", StyleBox["i", FontVariations->{"CompatibilityType"->"Subscript"}], ")" }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[CellGroupData[{ Cell[BoxData[ \(ss . tt\)], "Input", CellLabel->"In[40]:=", AspectRatioFixed->True], Cell[BoxData[ \(TraditionalForm\`s\_1\ t\_1 + s\_2\ t\_2 + s\_3\ t\_3\)], "Output", CellLabel->"Out[40]="] }, Open ]], Cell[TextData[{ "which is the same as: (t", StyleBox["i", FontVariations->{"CompatibilityType"->"Subscript"}], " s", StyleBox["i", FontVariations->{"CompatibilityType"->"Subscript"}], ")" }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[CellGroupData[{ Cell[BoxData[ \(tt . ss\)], "Input", CellLabel->"In[41]:=", AspectRatioFixed->True], Cell[BoxData[ \(TraditionalForm\`s\_1\ t\_1 + s\_2\ t\_2 + s\_3\ t\_3\)], "Output", CellLabel->"Out[41]="] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(Dot[ss, tt]\)], "Input", CellLabel->"In[42]:="], Cell[BoxData[ \(TraditionalForm\`s\_1\ t\_1 + s\_2\ t\_2 + s\_3\ t\_3\)], "Output", CellLabel->"Out[42]="] }, Open ]], Cell[TextData[{ "However ", StyleBox["if", FontVariations->{"Underline"->True}], " we are tempted to use a * for multiplication, we get a vector back but \ this is not a normal operation. (note it is not (s", StyleBox["i", FontVariations->{"CompatibilityType"->"Subscript"}], " t", StyleBox["j", FontVariations->{"CompatibilityType"->"Subscript"}], ") which is a second order tensor." }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[CellGroupData[{ Cell[BoxData[ \(ss\ *\ tt\)], "Input", CellLabel->"In[43]:="], Cell[BoxData[ \(TraditionalForm\`{s\_1\ t\_1, s\_2\ t\_2, s\_3\ t\_3}\)], "Output", CellLabel->"Out[43]="] }, Open ]], Cell["This is intepretted the same as ss tt", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(ss\ tt\)], "Input", CellLabel->"In[44]:=", AspectRatioFixed->True], Cell[BoxData[ \(TraditionalForm\`{s\_1\ t\_1, s\_2\ t\_2, s\_3\ t\_3}\)], "Output", CellLabel->"Out[44]="] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(tt\ ss\)], "Input", CellLabel->"In[45]:=", AspectRatioFixed->True], Cell[BoxData[ \(TraditionalForm\`{s\_1\ t\_1, s\_2\ t\_2, s\_3\ t\_3}\)], "Output", CellLabel->"Out[45]="] }, Open ]], Cell["\<\ Please note that Dot is distict from, *, which gives a product that \ usually does not arise in physical problems.\ \>", "Text", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ "There is also a Cross Product but we will save this for later.\n\nYou may \ recognize that the \"dot\" is giving the standard type of multiplication that \ we define for matrices (rr", StyleBox["ij", FontVariations->{"CompatibilityType"->"Subscript"}], " qq", StyleBox["jk", FontVariations->{"CompatibilityType"->"Subscript"}], ")" }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[BoxData[ \(\(qq = {{q\_11, q\_12, q\_13}, {q\_21, q\_22, q\_23}, {q\_31, q\_32, q\_33}}; \)\)], "Input", CellLabel->"In[46]:=", AspectRatioFixed->True], Cell[CellGroupData[{ Cell[BoxData[ \(rr . qq\)], "Input", CellLabel->"In[47]:=", AspectRatioFixed->True], Cell[BoxData[ FormBox[ RowBox[{"(", GridBox[{ {\(q\_11\ r\_11 + q\_21\ r\_12 + q\_31\ r\_13\), \(q\_12\ r\_11 + q\_22\ r\_12 + q\_32\ r\_13\), \(q\_13\ r\_11 + q\_23\ r\_12 + q\_33\ r\_13\)}, {\(q\_11\ r\_21 + q\_21\ r\_22 + q\_31\ r\_23\), \(q\_12\ r\_21 + q\_22\ r\_22 + q\_32\ r\_23\), \(q\_13\ r\_21 + q\_23\ r\_22 + q\_33\ r\_23\)}, {\(q\_11\ r\_31 + q\_21\ r\_32 + q\_31\ r\_33\), \(q\_12\ r\_31 + q\_22\ r\_32 + q\_32\ r\_33\), \(q\_13\ r\_31 + q\_23\ r\_32 + q\_33\ r\_33\)} }], ")"}], TraditionalForm]], "Output", CellLabel->"Out[47]="] }, Open ]], Cell[TextData[{ "This could be quite different from (qq", StyleBox["ij", FontVariations->{"CompatibilityType"->"Subscript"}], " rr", StyleBox["jk", FontVariations->{"CompatibilityType"->"Subscript"}], ")" }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[CellGroupData[{ Cell[BoxData[ \(qq . rr\)], "Input", CellLabel->"In[48]:=", AspectRatioFixed->True], Cell[BoxData[ FormBox[ RowBox[{"(", GridBox[{ {\(q\_11\ r\_11 + q\_12\ r\_21 + q\_13\ r\_31\), \(q\_11\ r\_12 + q\_12\ r\_22 + q\_13\ r\_32\), \(q\_11\ r\_13 + q\_12\ r\_23 + q\_13\ r\_33\)}, {\(q\_21\ r\_11 + q\_22\ r\_21 + q\_23\ r\_31\), \(q\_21\ r\_12 + q\_22\ r\_22 + q\_23\ r\_32\), \(q\_21\ r\_13 + q\_22\ r\_23 + q\_23\ r\_33\)}, {\(q\_31\ r\_11 + q\_32\ r\_21 + q\_33\ r\_31\), \(q\_31\ r\_12 + q\_32\ r\_22 + q\_33\ r\_32\), \(q\_31\ r\_13 + q\_32\ r\_23 + q\_33\ r\_33\)} }], ")"}], TraditionalForm]], "Output", CellLabel->"Out[48]="] }, Open ]], Cell["Note that if we forget the . then the result is", "Text", Evaluatable->False, AspectRatioFixed->True], Cell[CellGroupData[{ Cell[BoxData[ \(rr\ qq\)], "Input", CellLabel->"In[49]:=", AspectRatioFixed->True], Cell[BoxData[ FormBox[ RowBox[{"(", GridBox[{ {\(q\_11\ r\_11\), \(q\_12\ r\_12\), \(q\_13\ r\_13\)}, {\(q\_21\ r\_21\), \(q\_22\ r\_22\), \(q\_23\ r\_23\)}, {\(q\_31\ r\_31\), \(q\_32\ r\_32\), \(q\_33\ r\_33\)} }], ")"}], TraditionalForm]], "Output", CellLabel->"Out[49]="] }, Open ]], Cell["\<\ Note also that matices do not have to be square to be multiplied, \ but it has to work\ \>", "Text", Evaluatable->False, AspectRatioFixed->True], Cell[CellGroupData[{ Cell[BoxData[ \(rr . tt\)], "Input", CellLabel->"In[50]:=", AspectRatioFixed->True], Cell[BoxData[ \(TraditionalForm \`{r\_11\ t\_1 + r\_12\ t\_2 + r\_13\ t\_3, r\_21\ t\_1 + r\_22\ t\_2 + r\_23\ t\_3, r\_31\ t\_1 + r\_32\ t\_2 + r\_33\ t\_3}\)], "Output", CellLabel->"Out[50]="] }, Open ]], Cell[TextData[{ "If we interpret t as a column vector, then this ", StyleBox["should not work", FontVariations->{"Underline"->True}], ". ", StyleBox[" ", FontWeight->"Bold"], StyleBox["Mathematica", FontWeight->"Bold", FontSlant->"Italic"], StyleBox[" does not care!!!", FontWeight->"Bold"], " " }], "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(tt . rr\)], "Input", CellLabel->"In[51]:="], Cell[BoxData[ \(TraditionalForm \`{r\_11\ t\_1 + r\_21\ t\_2 + r\_31\ t\_3, r\_12\ t\_1 + r\_22\ t\_2 + r\_32\ t\_3, r\_13\ t\_1 + r\_23\ t\_2 + r\_33\ t\_3}\)], "Output", CellLabel->"Out[51]="] }, Open ]], Cell["\<\ The associative and distributive laws also work for matrices, (just \ not the commutative)\ \>", "Text", Evaluatable->False, AspectRatioFixed->True] }, Open ]], Cell[CellGroupData[{ Cell["Identity matix", "Subsection", Evaluatable->False, AspectRatioFixed->True], Cell["\<\ In scalar space, we can't comfortably talk about multiplication \ until we know what \"entity\" gives leaves a number unchanged in \ multiplication (i.e., 1). For a matrix we need:\ \>", "Text", Evaluatable->False, AspectRatioFixed->True], Cell[CellGroupData[{ Cell[BoxData[ \(ii = {{1, 0, 0}, {0, 1, 0}, {0, 0, 1}}\)], "Input", CellLabel->"In[52]:=", AspectRatioFixed->True], Cell[BoxData[ FormBox[ RowBox[{"(", GridBox[{ {"1", "0", "0"}, {"0", "1", "0"}, {"0", "0", "1"} }, ColumnAlignments->{Decimal}], ")"}], TraditionalForm]], "Output", CellLabel->"Out[52]="] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(rr . ii\)], "Input", CellLabel->"In[53]:=", AspectRatioFixed->True], Cell[BoxData[ FormBox[ RowBox[{"(", GridBox[{ {\(r\_11\), \(r\_12\), \(r\_13\)}, {\(r\_21\), \(r\_22\), \(r\_23\)}, {\(r\_31\), \(r\_32\), \(r\_33\)} }], ")"}], TraditionalForm]], "Output", CellLabel->"Out[53]="] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(ii . rr\)], "Input", CellLabel->"In[54]:=", AspectRatioFixed->True], Cell[BoxData[ FormBox[ RowBox[{"(", GridBox[{ {\(r\_11\), \(r\_12\), \(r\_13\)}, {\(r\_21\), \(r\_22\), \(r\_23\)}, {\(r\_31\), \(r\_32\), \(r\_33\)} }], ")"}], TraditionalForm]], "Output", CellLabel->"Out[54]="] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell["determinants and cofactors", "Subsection", Evaluatable->False, AspectRatioFixed->True], Cell["\<\ Perhaps your favorite operation on an matrix is the determinant, \ (which incidentally does not change value if a matix has its coordinate \ system rotated). The determinant is a scalar and can be easily calculated \ from the matrix elements. If the \"matrix\" has only one element then \ \>", "Text", Evaluatable->False, AspectRatioFixed->True], Cell[BoxData[ \(\(ss = {{ss1}}; \)\)], "Input", CellLabel->"In[2]:=", AspectRatioFixed->True], Cell[CellGroupData[{ Cell[BoxData[ \(Det[ss]\)], "Input", CellLabel->"In[3]:=", AspectRatioFixed->True], Cell[BoxData[ \(TraditionalForm\`ss1\)], "Output", CellLabel->"Out[3]="] }, Open ]], Cell[TextData["for a 2 by 2 we have:"], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[BoxData[ \(\(ww = {{w\_11, w\_12}, {w\_21, w\_22}}; \)\)], "Input", CellLabel->"In[4]:=", AspectRatioFixed->True], Cell[CellGroupData[{ Cell[BoxData[ \(Det[ww]\)], "Input", CellLabel->"In[5]:=", AspectRatioFixed->True], Cell[BoxData[ \(TraditionalForm\`w\_11\ w\_22 - w\_12\ w\_21\)], "Output", CellLabel->"Out[5]="] }, Open ]], Cell[TextData["For a 3 by 3 we have"], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[CellGroupData[{ Cell[BoxData[ \(Det[rr]\)], "Input", CellLabel->"In[65]:=", AspectRatioFixed->True], Cell[BoxData[ \(TraditionalForm \`\(-r\_13\)\ r\_22\ r\_31 + r\_12\ r\_23\ r\_31 + r\_13\ r\_21\ r\_32 - r\_11\ r\_23\ r\_32 - r\_12\ r\_21\ r\_33 + r\_11\ r\_22\ r\_33\)], "Output", CellLabel->"Out[65]="] }, Open ]], Cell[TextData["This looks like a mess but there is a system"], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ "To get a general definition of the determinant, it is convenient to define \ minors and cofactors. \n\nWe do this following Varma and Morbidelli. ", StyleBox["Mathematica", FontSlant->"Italic"], " has a different idea of a cofactor. Thus I need to make my own \ definition. \n\ndet[a_] := Sum[a[[1,i]] cofactor[a] [[1,i]],{i,1,Length[a]}]\n\ \nminors = m[[i,j]] are the determinants that remain when the row and column \ that contains an element is crossed out.\ncofactors are (-1)^(i+j) m[[i,j]]\n\ \nYou can see how we can define a determinant of arbitrary size using this \ definition.\n\nLet's try some definitions" }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ "First let us see what ", StyleBox["Mathematica", FontSlant->"Italic"], " does for us, Recall ww" }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[CellGroupData[{ Cell[BoxData[ \(ww\)], "Input", CellLabel->"In[7]:=", AspectRatioFixed->True], Cell[BoxData[ FormBox[ RowBox[{"(", GridBox[{ {\(w\_11\), \(w\_12\)}, {\(w\_21\), \(w\_22\)} }], ")"}], TraditionalForm]], "Output", CellLabel->"Out[7]="] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(Minors[ww, 1]\)], "Input", CellLabel->"In[8]:=", AspectRatioFixed->True], Cell[BoxData[ FormBox[ RowBox[{"(", GridBox[{ {\(w\_11\), \(w\_12\)}, {\(w\_21\), \(w\_22\)} }], ")"}], TraditionalForm]], "Output", CellLabel->"Out[8]="] }, Open ]], Cell[TextData[{ "As I mention above this is not the normal definition of Minors. We want \ the answer with the element that is crossed out, not vice versa. Thus we can \ define our own function to ", StyleBox["flip", FontSlant->"Italic"], " the elements. This is not hard but looks complicated." }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[BoxData[ \(flip[a_] := Table[zzx[i, j] = a\[LeftDoubleBracket]Length[a] - i + 1, Length[a] - j + 1\[RightDoubleBracket], {i, 1, Length[a]}, {j, 1, Length[a]}]\)], "Input", CellLabel->"In[9]:=", AspectRatioFixed->True], Cell[TextData["We want and get the correct minors from"], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[CellGroupData[{ Cell[BoxData[ \(flip[Minors[ww, 1]]\)], "Input", CellLabel->"In[10]:=", AspectRatioFixed->True], Cell[BoxData[ FormBox[ RowBox[{"(", GridBox[{ {\(w\_22\), \(w\_21\)}, {\(w\_12\), \(w\_11\)} }], ")"}], TraditionalForm]], "Output", CellLabel->"Out[10]="] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(flip[Minors[rr, 2]]\)], "Input", CellLabel->"In[28]:=", AspectRatioFixed->True], Cell[BoxData[ FormBox[ RowBox[{"(", GridBox[{ {\(r\_22\ r\_33 - r\_23\ r\_32\), \(r\_21\ r\_33 - r\_23\ r\_31\), \(r\_21\ r\_32 - r\_22\ r\_31\)}, {\(r\_12\ r\_33 - r\_13\ r\_32\), \(r\_11\ r\_33 - r\_13\ r\_31\), \(r\_11\ r\_32 - r\_12\ r\_31\)}, {\(r\_12\ r\_23 - r\_13\ r\_22\), \(r\_11\ r\_23 - r\_13\ r\_21\), \(r\_11\ r\_22 - r\_12\ r\_21\)} }], ")"}], TraditionalForm]], "Output", CellLabel->"Out[28]="] }, Open ]], Cell[TextData["If we want the cofactors we could define"], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[BoxData[ \(cofactor[a_] := Table[\(flip[Minors[a, Length[a] - 1]]\)\[LeftDoubleBracket]i, j \[RightDoubleBracket]\ \((\(-1\))\)\^\(i + j\), {i, 1, Length[a]}, {j, 1, Length[a]}]\)], "Input", CellLabel->"In[11]:=", AspectRatioFixed->True], Cell[CellGroupData[{ Cell[BoxData[ \(cofactor[ww]\)], "Input", CellLabel->"In[12]:=", AspectRatioFixed->True], Cell[BoxData[ FormBox[ RowBox[{"(", GridBox[{ {\(w\_22\), \(-w\_21\)}, {\(-w\_12\), \(w\_11\)} }], ")"}], TraditionalForm]], "Output", CellLabel->"Out[12]="] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(cofactor[rr]\)], "Input", CellLabel->"In[25]:=", AspectRatioFixed->True], Cell[BoxData[ FormBox[ RowBox[{"(", GridBox[{ {\(r\_22\ r\_33 - r\_23\ r\_32\), \(r\_23\ r\_31 - r\_21\ r\_33\), \(r\_21\ r\_32 - r\_22\ r\_31\)}, {\(r\_13\ r\_32 - r\_12\ r\_33\), \(r\_11\ r\_33 - r\_13\ r\_31\), \(r\_12\ r\_31 - r\_11\ r\_32\)}, {\(r\_12\ r\_23 - r\_13\ r\_22\), \(r\_13\ r\_21 - r\_11\ r\_23\), \(r\_11\ r\_22 - r\_12\ r\_21\)} }], ")"}], TraditionalForm]], "Output", CellLabel->"Out[25]="] }, Open ]], Cell["\<\ This looks OK, let us check it with the determinant calculated by \ the LaPlace expansion (p. 6 in V&M)\ \>", "Text", Evaluatable->False, AspectRatioFixed->True], Cell[CellGroupData[{ Cell[BoxData[ \(det[a_] := \[Sum]\+\(i = 1\)\%\(Length[a]\)a\[LeftDoubleBracket]1, i \[RightDoubleBracket]\ \(cofactor[a]\)\[LeftDoubleBracket]1, i\[RightDoubleBracket]\)], "Input", CellLabel->"In[14]:=", AspectRatioFixed->True], Cell[BoxData[ FormBox[ RowBox[{ \(General::"spell1"\), \( : \ \), "\<\"Possible spelling error: new symbol name \ \\\"\\!\\(TraditionalForm\\`det\\)\\\" is similar to existing symbol \ \\\"\\!\\(TraditionalForm\\`Det\\)\\\".\"\>"}], TraditionalForm]], "Message"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(det[rr]\)], "Input", CellLabel->"In[29]:=", AspectRatioFixed->True], Cell[BoxData[ \(TraditionalForm \`r\_13\ \((r\_21\ r\_32 - r\_22\ r\_31)\) + r\_12\ \((r\_23\ r\_31 - r\_21\ r\_33)\) + r\_11\ \((r\_22\ r\_33 - r\_23\ r\_32)\)\)], "Output", CellLabel->"Out[29]="] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(\[Sum]\+\(i = 1\)\%\(Length[a]\)rr\[LeftDoubleBracket]2, i \[RightDoubleBracket]\ \(cofactor[rr]\)\[LeftDoubleBracket]2, i\[RightDoubleBracket]\)], "Input", CellLabel->"In[38]:=", AspectRatioFixed->True], Cell[BoxData[ \(TraditionalForm \`r\_23\ \((r\_12\ r\_31 - r\_11\ r\_32)\) + r\_22\ \((r\_11\ r\_33 - r\_13\ r\_31)\) + r\_21\ \((r\_13\ r\_32 - r\_12\ r\_33)\)\)], "Output", CellLabel->"Out[38]="] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(Simplify[% - %29]\)], "Input", CellLabel->"In[39]:="], Cell[BoxData[ \(TraditionalForm\`0\)], "Output", CellLabel->"Out[39]="] }, Open ]], Cell[TextData["We can check it against the real function"], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[CellGroupData[{ Cell[BoxData[ \(Expand[det[rr] - Det[rr]]\)], "Input", CellLabel->"In[30]:=", AspectRatioFixed->True], Cell[BoxData[ \(TraditionalForm\`0\)], "Output", CellLabel->"Out[30]="] }, Open ]], Cell[TextData["Perhaps we should check it with a bigger Matrix"], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[CellGroupData[{ Cell[BoxData[ \(z4 = {{1, 3, 5, 7}, {6, 6, 5, 4}, {1, 1, 26, 4}, {1, 8, 0, 3}}\)], "Input", CellLabel->"In[17]:=", AspectRatioFixed->True], Cell[BoxData[ FormBox[ RowBox[{"(", GridBox[{ {"1", "3", "5", "7"}, {"6", "6", "5", "4"}, {"1", "1", "26", "4"}, {"1", "8", "0", "3"} }, ColumnAlignments->{Decimal}], ")"}], TraditionalForm]], "Output", CellLabel->"Out[17]="] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(Det[z4]\)], "Input", CellLabel->"In[18]:=", AspectRatioFixed->True], Cell[BoxData[ \(TraditionalForm\`5373\)], "Output", CellLabel->"Out[18]="] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(det[z4]\)], "Input", CellLabel->"In[19]:=", AspectRatioFixed->True], Cell[BoxData[ \(TraditionalForm\`5373\)], "Output", CellLabel->"Out[19]="] }, Open ]], Cell[TextData[ "OK, now we see how this can give the determinant of an arbitrary size square \ matrix. \n\nWe also note that the formula for calculating the determinant is \ known as the LaPlace expansion. We could calculate the determinant from any \ row of the matrix because:"], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[CellGroupData[{ Cell[BoxData[ \(Det[a]\)], "Input", CellLabel->"In[32]:=", AspectRatioFixed->True], Cell[BoxData[ \(TraditionalForm\`6\)], "Output", CellLabel->"Out[32]="] }, Open ]], Cell[TextData["Use first row:"], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[CellGroupData[{ Cell[BoxData[ \(\[Sum]\+\(i = 1\)\%\(Length[a]\)a\[LeftDoubleBracket]1, i \[RightDoubleBracket]\ \(cofactor[a]\)\[LeftDoubleBracket]1, i\[RightDoubleBracket]\)], "Input", CellLabel->"In[33]:=", AspectRatioFixed->True], Cell[BoxData[ \(TraditionalForm\`6\)], "Output", CellLabel->"Out[33]="] }, Open ]], Cell[TextData["Use second row:"], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[CellGroupData[{ Cell[BoxData[ \(\[Sum]\+\(i = 1\)\%\(Length[a]\)a\[LeftDoubleBracket]2, i \[RightDoubleBracket]\ \(cofactor[a]\)\[LeftDoubleBracket]2, i\[RightDoubleBracket]\)], "Input", CellLabel->"In[34]:=", AspectRatioFixed->True], Cell[BoxData[ \(TraditionalForm\`6\)], "Output", CellLabel->"Out[34]="] }, Open ]], Cell[TextData["Use third row:"], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[CellGroupData[{ Cell[BoxData[ \(\[Sum]\+\(i = 1\)\%\(Length[a]\)a\[LeftDoubleBracket]3, i \[RightDoubleBracket]\ \(cofactor[a]\)\[LeftDoubleBracket]3, i\[RightDoubleBracket]\)], "Input", CellLabel->"In[35]:=", AspectRatioFixed->True], Cell[BoxData[ \(TraditionalForm\`6\)], "Output", CellLabel->"Out[35]="] }, Open ]], Cell[TextData["The answer is the same. "], "Text", Evaluatable->False, AspectRatioFixed->True] }, Open ]], Cell[CellGroupData[{ Cell["Rank", "Subsection", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[ "The rank of a matrix is the size of the largest non-zero determinant that \ can be obtained from it. The rank has important implications when one wants \ to solve systems of linear equations. \n\nSpecifically, see page 16 of V&M. \ "], "Text", Evaluatable->False, AspectRatioFixed->True] }, Open ]], Cell[CellGroupData[{ Cell["Systems of equations", "Subsection", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ "A big application area of matices for us will be systems of linear \ equations. Suppose we have the system:\n", Cell[BoxData[ \(TraditionalForm\`R\)]], " ", Cell[BoxData[ \(TraditionalForm\`x\)]], " == ", Cell[BoxData[ \(TraditionalForm\`y\)]], ", where ", Cell[BoxData[ \(TraditionalForm\`R\)]], " is a square matix and ", Cell[BoxData[ \(TraditionalForm\`x\)]], " and ", Cell[BoxData[ \(TraditionalForm\`y\)]], " are vectors. We could write;\n\n", Cell[BoxData[ \(TraditionalForm\`R\)]], " ", Cell[BoxData[ \(TraditionalForm\`x\)]], " - ", Cell[BoxData[ \(TraditionalForm\`y\)]], " == 0 \n\nDefine" }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[BoxData[ \(xx = {x\_1, x\_2, x\_3}; \nyy = {y\_1, y\_2, y\_3}; \)], "Input", CellLabel->"In[77]:=", AspectRatioFixed->True], Cell[TextData["In our convenient shorthand we have"], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[CellGroupData[{ Cell[BoxData[ \(rr . xx - yy\)], "Input", CellLabel->"In[78]:=", AspectRatioFixed->True], Cell[BoxData[ \(TraditionalForm \`{r\_11\ x\_1 + r\_12\ x\_2 + r\_13\ x\_3 - y\_1, r\_21\ x\_1 + r\_22\ x\_2 + r\_23\ x\_3 - y\_2, r\_31\ x\_1 + r\_32\ x\_2 + r\_33\ x\_3 - y\_3}\)], "Output", CellLabel->"Out[78]="] }, Open ]], Cell[TextData["Which is a list of three equations that equal 0."], "Text", Evaluatable->False, AspectRatioFixed->True] }, Open ]], Cell[CellGroupData[{ Cell["Inverse matrix", "Subsection", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ "Now that we have dared to write the matrix form of a system of equations, \ we cannot rest until we have a solution.\n\nFor ", Cell[BoxData[ \(TraditionalForm\`R\)]], " ", Cell[BoxData[ \(TraditionalForm\`x\)]], " == ", Cell[BoxData[ \(TraditionalForm\`y\)]], ", we want Inverse[R] also written R", StyleBox["-1", FontVariations->{"CompatibilityType"->"Superscript"}], ", that allows\nus to get ", Cell[BoxData[ \(TraditionalForm\`x\)]], " from\nInverse", Cell[BoxData[ \(TraditionalForm\`\([R]\)\ R\ x\)]], " = Inverse[", Cell[BoxData[ \(TraditionalForm\`R\)]], "] ", Cell[BoxData[ \(TraditionalForm\`y\)]], " =", Cell[BoxData[ \(TraditionalForm\`x\)]] }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[CellGroupData[{ Cell[BoxData[ \(Inverse[rr] . rr\)], "Input", CellLabel->"In[48]:=", AspectRatioFixed->True], Cell[BoxData[ FormBox[ RowBox[{"(", GridBox[{ { \(\(\((r\_12\ r\_23 - r\_13\ r\_22)\)\ r\_31\)\/\(\(-r\_13\)\ r\_22\ r\_31 + r\_12\ r\_23\ r\_31 + r\_13\ r\_21\ r\_32 - r\_11\ r\_23\ r\_32 - r\_12\ r\_21\ r\_33 + r\_11\ r\_22\ r\_33\) + \(r\_21\ \((r\_13\ r\_32 - r\_12\ r\_33)\)\)\/\(\(-r\_13\)\ r\_22\ r\_31 + r\_12\ r\_23\ r\_31 + r\_13\ r\_21\ r\_32 - r\_11\ r\_23\ r\_32 - r\_12\ r\_21\ r\_33 + r\_11\ r\_22\ r\_33\) + \(r\_11\ \((r\_22\ r\_33 - r\_23\ r\_32)\)\)\/\(\(-r\_13\)\ r\_22\ r\_31 + r\_12\ r\_23\ r\_31 + r\_13\ r\_21\ r\_32 - r\_11\ r\_23\ r\_32 - r\_12\ r\_21\ r\_33 + r\_11\ r\_22\ r\_33\)\), \(\(\((r\_12\ r\_23 - r\_13\ r\_22)\)\ r\_32\)\/\(\(-r\_13\)\ r\_22\ r\_31 + r\_12\ r\_23\ r\_31 + r\_13\ r\_21\ r\_32 - r\_11\ r\_23\ r\_32 - r\_12\ r\_21\ r\_33 + r\_11\ r\_22\ r\_33\) + \(r\_22\ \((r\_13\ r\_32 - r\_12\ r\_33)\)\)\/\(\(-r\_13\)\ r\_22\ r\_31 + r\_12\ r\_23\ r\_31 + r\_13\ r\_21\ r\_32 - r\_11\ r\_23\ r\_32 - r\_12\ r\_21\ r\_33 + r\_11\ r\_22\ r\_33\) + \(r\_12\ \((r\_22\ r\_33 - r\_23\ r\_32)\)\)\/\(\(-r\_13\)\ r\_22\ r\_31 + r\_12\ r\_23\ r\_31 + r\_13\ r\_21\ r\_32 - r\_11\ r\_23\ r\_32 - r\_12\ r\_21\ r\_33 + r\_11\ r\_22\ r\_33\)\), \(\(\((r\_12\ r\_23 - r\_13\ r\_22)\)\ r\_33\)\/\(\(-r\_13\)\ r\_22\ r\_31 + r\_12\ r\_23\ r\_31 + r\_13\ r\_21\ r\_32 - r\_11\ r\_23\ r\_32 - r\_12\ r\_21\ r\_33 + r\_11\ r\_22\ r\_33\) + \(r\_23\ \((r\_13\ r\_32 - r\_12\ r\_33)\)\)\/\(\(-r\_13\)\ r\_22\ r\_31 + r\_12\ r\_23\ r\_31 + r\_13\ r\_21\ r\_32 - r\_11\ r\_23\ r\_32 - r\_12\ r\_21\ r\_33 + r\_11\ r\_22\ r\_33\) + \(r\_13\ \((r\_22\ r\_33 - r\_23\ r\_32)\)\)\/\(\(-r\_13\)\ r\_22\ r\_31 + r\_12\ r\_23\ r\_31 + r\_13\ r\_21\ r\_32 - r\_11\ r\_23\ r\_32 - r\_12\ r\_21\ r\_33 + r\_11\ r\_22\ r\_33\)\)}, { \(\(\((r\_13\ r\_21 - r\_11\ r\_23)\)\ r\_31\)\/\(\(-r\_13\)\ r\_22\ r\_31 + r\_12\ r\_23\ r\_31 + r\_13\ r\_21\ r\_32 - r\_11\ r\_23\ r\_32 - r\_12\ r\_21\ r\_33 + r\_11\ r\_22\ r\_33\) + \(r\_21\ \((r\_11\ r\_33 - r\_13\ r\_31)\)\)\/\(\(-r\_13\)\ r\_22\ r\_31 + r\_12\ r\_23\ r\_31 + r\_13\ r\_21\ r\_32 - r\_11\ r\_23\ r\_32 - r\_12\ r\_21\ r\_33 + r\_11\ r\_22\ r\_33\) + \(r\_11\ \((r\_23\ r\_31 - r\_21\ r\_33)\)\)\/\(\(-r\_13\)\ r\_22\ r\_31 + r\_12\ r\_23\ r\_31 + r\_13\ r\_21\ r\_32 - r\_11\ r\_23\ r\_32 - r\_12\ r\_21\ r\_33 + r\_11\ r\_22\ r\_33\)\), \(\(\((r\_13\ r\_21 - r\_11\ r\_23)\)\ r\_32\)\/\(\(-r\_13\)\ r\_22\ r\_31 + r\_12\ r\_23\ r\_31 + r\_13\ r\_21\ r\_32 - r\_11\ r\_23\ r\_32 - r\_12\ r\_21\ r\_33 + r\_11\ r\_22\ r\_33\) + \(r\_22\ \((r\_11\ r\_33 - r\_13\ r\_31)\)\)\/\(\(-r\_13\)\ r\_22\ r\_31 + r\_12\ r\_23\ r\_31 + r\_13\ r\_21\ r\_32 - r\_11\ r\_23\ r\_32 - r\_12\ r\_21\ r\_33 + r\_11\ r\_22\ r\_33\) + \(r\_12\ \((r\_23\ r\_31 - r\_21\ r\_33)\)\)\/\(\(-r\_13\)\ r\_22\ r\_31 + r\_12\ r\_23\ r\_31 + r\_13\ r\_21\ r\_32 - r\_11\ r\_23\ r\_32 - r\_12\ r\_21\ r\_33 + r\_11\ r\_22\ r\_33\)\), \(\(\((r\_13\ r\_21 - r\_11\ r\_23)\)\ r\_33\)\/\(\(-r\_13\)\ r\_22\ r\_31 + r\_12\ r\_23\ r\_31 + r\_13\ r\_21\ r\_32 - r\_11\ r\_23\ r\_32 - r\_12\ r\_21\ r\_33 + r\_11\ r\_22\ r\_33\) + \(r\_23\ \((r\_11\ r\_33 - r\_13\ r\_31)\)\)\/\(\(-r\_13\)\ r\_22\ r\_31 + r\_12\ r\_23\ r\_31 + r\_13\ r\_21\ r\_32 - r\_11\ r\_23\ r\_32 - r\_12\ r\_21\ r\_33 + r\_11\ r\_22\ r\_33\) + \(r\_13\ \((r\_23\ r\_31 - r\_21\ r\_33)\)\)\/\(\(-r\_13\)\ r\_22\ r\_31 + r\_12\ r\_23\ r\_31 + r\_13\ r\_21\ r\_32 - r\_11\ r\_23\ r\_32 - r\_12\ r\_21\ r\_33 + r\_11\ r\_22\ r\_33\)\)}, { \(\(\((r\_11\ r\_22 - r\_12\ r\_21)\)\ r\_31\)\/\(\(-r\_13\)\ r\_22\ r\_31 + r\_12\ r\_23\ r\_31 + r\_13\ r\_21\ r\_32 - r\_11\ r\_23\ r\_32 - r\_12\ r\_21\ r\_33 + r\_11\ r\_22\ r\_33\) + \(r\_21\ \((r\_12\ r\_31 - r\_11\ r\_32)\)\)\/\(\(-r\_13\)\ r\_22\ r\_31 + r\_12\ r\_23\ r\_31 + r\_13\ r\_21\ r\_32 - r\_11\ r\_23\ r\_32 - r\_12\ r\_21\ r\_33 + r\_11\ r\_22\ r\_33\) + \(r\_11\ \((r\_21\ r\_32 - r\_22\ r\_31)\)\)\/\(\(-r\_13\)\ r\_22\ r\_31 + r\_12\ r\_23\ r\_31 + r\_13\ r\_21\ r\_32 - r\_11\ r\_23\ r\_32 - r\_12\ r\_21\ r\_33 + r\_11\ r\_22\ r\_33\)\), \(\(\((r\_11\ r\_22 - r\_12\ r\_21)\)\ r\_32\)\/\(\(-r\_13\)\ r\_22\ r\_31 + r\_12\ r\_23\ r\_31 + r\_13\ r\_21\ r\_32 - r\_11\ r\_23\ r\_32 - r\_12\ r\_21\ r\_33 + r\_11\ r\_22\ r\_33\) + \(r\_22\ \((r\_12\ r\_31 - r\_11\ r\_32)\)\)\/\(\(-r\_13\)\ r\_22\ r\_31 + r\_12\ r\_23\ r\_31 + r\_13\ r\_21\ r\_32 - r\_11\ r\_23\ r\_32 - r\_12\ r\_21\ r\_33 + r\_11\ r\_22\ r\_33\) + \(r\_12\ \((r\_21\ r\_32 - r\_22\ r\_31)\)\)\/\(\(-r\_13\)\ r\_22\ r\_31 + r\_12\ r\_23\ r\_31 + r\_13\ r\_21\ r\_32 - r\_11\ r\_23\ r\_32 - r\_12\ r\_21\ r\_33 + r\_11\ r\_22\ r\_33\)\), \(\(r\_23\ \((r\_12\ r\_31 - r\_11\ r\_32)\)\)\/\(\(-r\_13\)\ r\_22\ r\_31 + r\_12\ r\_23\ r\_31 + r\_13\ r\_21\ r\_32 - r\_11\ r\_23\ r\_32 - r\_12\ r\_21\ r\_33 + r\_11\ r\_22\ r\_33\) + \(r\_13\ \((r\_21\ r\_32 - r\_22\ r\_31)\)\)\/\(\(-r\_13\)\ r\_22\ r\_31 + r\_12\ r\_23\ r\_31 + r\_13\ r\_21\ r\_32 - r\_11\ r\_23\ r\_32 - r\_12\ r\_21\ r\_33 + r\_11\ r\_22\ r\_33\) + \(\((r\_11\ r\_22 - r\_12\ r\_21)\)\ r\_33\)\/\(\(-r\_13\)\ r\_22\ r\_31 + r\_12\ r\_23\ r\_31 + r\_13\ r\_21\ r\_32 - r\_11\ r\_23\ r\_32 - r\_12\ r\_21\ r\_33 + r\_11\ r\_22\ r\_33\)\)} }], ")"}], TraditionalForm]], "Output", CellLabel->"Out[48]="] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(Simplify[%]\)], "Input", CellLabel->"In[49]:=", AspectRatioFixed->True], Cell[BoxData[ FormBox[ RowBox[{"(", GridBox[{ {"1", "0", "0"}, {"0", "1", "0"}, {"0", "0", "1"} }, ColumnAlignments->{Decimal}], ")"}], TraditionalForm]], "Output", CellLabel->"Out[49]="] }, Open ]], Cell[TextData[ "Which is the identity matix and thus the solution vector for x is"], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[CellGroupData[{ Cell[BoxData[ \(FullSimplify[Inverse[rr] . yy]\)], "Input", CellLabel->"In[50]:=", AspectRatioFixed->True], Cell[BoxData[ FormBox[ RowBox[{ RowBox[{"(", GridBox[{ { \(\(r\_22\ r\_33 - r\_23\ r\_32\)\/\(r\_13\ \((r\_21\ r\_32 - r\_22\ r\_31)\) + r\_12\ \((r\_23\ r\_31 - r\_21\ r\_33)\) + r\_11\ \((r\_22\ r\_33 - r\_23\ r\_32)\)\)\), \(\(r\_13\ r\_32 - r\_12\ r\_33\)\/\(r\_13\ \((r\_21\ r\_32 - r\_22\ r\_31)\) + r\_12\ \((r\_23\ r\_31 - r\_21\ r\_33)\) + r\_11\ \((r\_22\ r\_33 - r\_23\ r\_32)\)\)\), \(\(r\_12\ r\_23 - r\_13\ r\_22\)\/\(r\_13\ \((r\_21\ r\_32 - r\_22\ r\_31)\) + r\_12\ \((r\_23\ r\_31 - r\_21\ r\_33)\) + r\_11\ \((r\_22\ r\_33 - r\_23\ r\_32)\)\)\)}, { \(\(r\_23\ r\_31 - r\_21\ r\_33\)\/\(r\_13\ \((r\_21\ r\_32 - r\_22\ r\_31)\) + r\_12\ \((r\_23\ r\_31 - r\_21\ r\_33)\) + r\_11\ \((r\_22\ r\_33 - r\_23\ r\_32)\)\)\), \(\(r\_11\ r\_33 - r\_13\ r\_31\)\/\(r\_13\ \((r\_21\ r\_32 - r\_22\ r\_31)\) + r\_12\ \((r\_23\ r\_31 - r\_21\ r\_33)\) + r\_11\ \((r\_22\ r\_33 - r\_23\ r\_32)\)\)\), \(\(r\_13\ r\_21 - r\_11\ r\_23\)\/\(r\_13\ \((r\_21\ r\_32 - r\_22\ r\_31)\) + r\_12\ \((r\_23\ r\_31 - r\_21\ r\_33)\) + r\_11\ \((r\_22\ r\_33 - r\_23\ r\_32)\)\)\)}, { \(\(r\_21\ r\_32 - r\_22\ r\_31\)\/\(r\_13\ \((r\_21\ r\_32 - r\_22\ r\_31)\) + r\_12\ \((r\_23\ r\_31 - r\_21\ r\_33)\) + r\_11\ \((r\_22\ r\_33 - r\_23\ r\_32)\)\)\), \(\(r\_12\ r\_31 - r\_11\ r\_32\)\/\(r\_13\ \((r\_21\ r\_32 - r\_22\ r\_31)\) + r\_12\ \((r\_23\ r\_31 - r\_21\ r\_33)\) + r\_11\ \((r\_22\ r\_33 - r\_23\ r\_32)\)\)\), \(\(r\_11\ r\_22 - r\_12\ r\_21\)\/\(r\_13\ \((r\_21\ r\_32 - r\_22\ r\_31)\) + r\_12\ \((r\_23\ r\_31 - r\_21\ r\_33)\) + r\_11\ \((r\_22\ r\_33 - r\_23\ r\_32)\)\)\)} }], ")"}], ".", "yy"}], TraditionalForm]], "Output", CellLabel->"Out[50]="] }, Open ]], Cell["Perhaps this is cleaner numerically, a x == z", "Text", Evaluatable->False, AspectRatioFixed->True], Cell[BoxData[ \(\(z = {1, 5, 9}; \)\)], "Input", CellLabel->"In[51]:=", AspectRatioFixed->True], Cell[CellGroupData[{ Cell[BoxData[ \(Inverse[a]\)], "Input", CellLabel->"In[52]:=", AspectRatioFixed->True], Cell[BoxData[ FormBox[ RowBox[{"(", GridBox[{ {\(3\/2\), "0", \(-\(1\/2\)\)}, {\(-\(19\/2\)\), "1", \(5\/2\)}, {\(37\/6\), \(-\(2\/3\)\), \(-\(3\/2\)\)} }, ColumnAlignments->{Decimal}], ")"}], TraditionalForm]], "Output", CellLabel->"Out[52]="] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(Inverse[a] . a\)], "Input", CellLabel->"In[53]:=", AspectRatioFixed->True], Cell[BoxData[ FormBox[ RowBox[{"(", GridBox[{ {"1", "0", "0"}, {"0", "1", "0"}, {"0", "0", "1"} }, ColumnAlignments->{Decimal}], ")"}], TraditionalForm]], "Output", CellLabel->"Out[53]="] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(Inverse[a] . z\)], "Input", CellLabel->"In[54]:=", AspectRatioFixed->True], Cell[BoxData[ \(TraditionalForm\`{\(-3\), 18, \(-\(32\/3\)\)}\)], "Output", CellLabel->"Out[54]="] }, Open ]], Cell[TextData["Which can be obtained equivalently from"], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[CellGroupData[{ Cell[BoxData[ \(LinearSolve[a, z]\)], "Input", CellLabel->"In[55]:=", AspectRatioFixed->True], Cell[BoxData[ \(TraditionalForm\`{\(-3\), 18, \(-\(32\/3\)\)}\)], "Output", CellLabel->"Out[55]="] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(Information["\", LongForm \[Rule] True]\)], "Input", CellLabel->"In[56]:=", AspectRatioFixed->True], Cell[BoxData[ \(TraditionalForm \`"LinearSolve[m, b] finds an x which solves the matrix equation m.x==b."\ \)], "Print"], Cell[BoxData[ FormBox[ InterpretationBox[ StyleBox[\(Attributes[LinearSolve]\ = \ {Protected}\n\ \n Options[LinearSolve]\ = \ {Method\ -> \ Automatic, \ Modulus\ -> \ 0, \ ZeroTest\ -> \ \((#1\ == \ 0\ &\ )\)}\), ShowStringCharacters->True, NumberMarks->True], InputForm[ Definition[ LinearSolve]], Editable->True, AutoDelete->True], TraditionalForm]], "Print"] }, Open ]], Cell[TextData[{ "Of course, ", StyleBox["a", FontSlant->"Italic"], " better have an inverse for this to work!!" }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell["\<\ How will we calculate the inverse matrix? Set up the problem in \ terms of the result that you need. (A famous trick from mathematics!!)\ \>", "Text", Evaluatable->False, AspectRatioFixed->True], Cell[TextData["Here is our unknown matrix"], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[CellGroupData[{ Cell[BoxData[ \(wwinv = {{winv\_11, winv\_12}, {winv\_21, winv\_22}}\)], "Input", CellLabel->"In[57]:=", AspectRatioFixed->True], Cell[BoxData[ FormBox[ RowBox[{"(", GridBox[{ {\(winv\_11\), \(winv\_12\)}, {\(winv\_21\), \(winv\_22\)} }], ")"}], TraditionalForm]], "Output", CellLabel->"Out[57]="] }, Open ]], Cell["\<\ We can construct the matrix that will have to give the indentity \ matrix.\ \>", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(eqs = wwinv . ww\)], "Input", CellLabel->"In[58]:=", AspectRatioFixed->True], Cell[BoxData[ FormBox[ RowBox[{"(", GridBox[{ {\(w\_11\ winv\_11 + w\_21\ winv\_12\), \(w\_12\ winv\_11 + w\_22\ winv\_12\)}, {\(w\_11\ winv\_21 + w\_21\ winv\_22\), \(w\_12\ winv\_21 + w\_22\ winv\_22\)} }], ")"}], TraditionalForm]], "Output", CellLabel->"Out[58]="] }, Open ]], Cell["This is easily solved", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(Solve[ eqs == IdentityMatrix[2], {winv\_11, winv\_12, winv\_21, winv\_22}]\)], "Input", CellLabel->"In[59]:="], Cell[BoxData[ \(TraditionalForm \`{{winv\_11 \[Rule] w\_22\/\(w\_11\ w\_22 - w\_12\ w\_21\), winv\_12 \[Rule] \(-\(w\_12\/\(w\_11\ w\_22 - w\_12\ w\_21\)\)\), winv\_21 \[Rule] \(-\(w\_21\/\(w\_11\ w\_22 - w\_12\ w\_21\)\)\), winv\_22 \[Rule] w\_11\/\(w\_11\ w\_22 - w\_12\ w\_21\)}}\)], "Output",\ CellLabel->"Out[59]="] }, Open ]], Cell[TextData["This matches the built in function."], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[CellGroupData[{ Cell[BoxData[ \(Inverse[ww]\)], "Input", CellLabel->"In[60]:=", AspectRatioFixed->True], Cell[BoxData[ FormBox[ RowBox[{"(", GridBox[{ {\(w\_22\/\(w\_11\ w\_22 - w\_12\ w\_21\)\), \(-\(w\_12\/\(w\_11\ w\_22 - w\_12\ w\_21\)\)\)}, {\(-\(w\_21\/\(w\_11\ w\_22 - w\_12\ w\_21\)\)\), \(w\_11\/\(w\_11\ w\_22 - w\_12\ w\_21\)\)} }], ")"}], TraditionalForm]], "Output", CellLabel->"Out[60]="] }, Open ]], Cell[TextData[ "Here is a defined function that calculates the inverse from cofactors and \ the determinant"], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[BoxData[ \(inverse[a_] := Transpose[cofactor[a]]/det[a]\)], "Input", CellLabel->"In[61]:=", AspectRatioFixed->True], Cell[CellGroupData[{ Cell[BoxData[ \(Simplify[inverse[ww] - Inverse[ww]]\)], "Input", CellLabel->"In[62]:=", AspectRatioFixed->True], Cell[BoxData[ FormBox[ RowBox[{"(", GridBox[{ {"0", "0"}, {"0", "0"} }, ColumnAlignments->{Decimal}], ")"}], TraditionalForm]], "Output", CellLabel->"Out[62]="] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(Simplify[inverse[a] - Inverse[a]]\)], "Input", CellLabel->"In[63]:=", AspectRatioFixed->True], Cell[BoxData[ FormBox[ RowBox[{"(", GridBox[{ {"0", "0", "0"}, {"0", "0", "0"}, {"0", "0", "0"} }, ColumnAlignments->{Decimal}], ")"}], TraditionalForm]], "Output", CellLabel->"Out[63]="] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(Simplify[inverse[z4] - Inverse[z4]]\)], "Input", CellLabel->"In[64]:=", AspectRatioFixed->True], Cell[BoxData[ FormBox[ RowBox[{"(", GridBox[{ {"0", "0", "0", "0"}, {"0", "0", "0", "0"}, {"0", "0", "0", "0"}, {"0", "0", "0", "0"} }, ColumnAlignments->{Decimal}], ")"}], TraditionalForm]], "Output", CellLabel->"Out[64]="] }, Open ]], Cell["\<\ Thus the matrix that defines the inverse is the Transpose[Matrix of \ cofactors]/Determinant!!\ \>", "Text", Evaluatable->False, AspectRatioFixed->True] }, Open ]], Cell[CellGroupData[{ Cell["Important point", "Subsection", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[StyleBox[ "The term \"adjoint\" has dual meanings. Varma and Morbidelli and Noble and \ Daniel, for example, call the Transpose[cofactor[a]] the \"adjoint\" matrix. \ In the context of linear operator theory, the adjoint for a constant matrix \ is adjoint[a] = Conjugate[Transpose[a]]. These two uses are not the same. \ We will make every effort to not confuse these in class, homework and tests.", FontSize->12, FontWeight->"Plain"]], "Text"] }, Open ]], Cell[CellGroupData[{ Cell[TextData["Gaussian elimination"], "Subsection", Evaluatable->False, PageBreakAbove->True, AspectRatioFixed->True], Cell[CellGroupData[{ Cell[TextData[{ "From a practical point, how is an inverse found or how do we solve a \ system of equations? The standard procedure is ", StyleBox["Gaussian Elimination", FontSlant->"Italic"], ". You probably have used it before so only a quick example will be given.\ \n\nA good reference for the next few sections is:\n", StyleBox["B. Noble and J. W. Daniel, (1988)", FontWeight->"Bold"], " ", StyleBox["Applied Linear Algebra", FontSlant->"Italic"], ", Prentice-Hall.\n\n\nConsider A x = b" }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[CellGroupData[{ Cell[BoxData[ \(a = {{1, 2, 3}, {7, 5, 6}, {1, 6, 9}}\)], "Input", CellLabel->"In[96]:=", AspectRatioFixed->True], Cell[BoxData[ FormBox[ RowBox[{"(", GridBox[{ {"1", "2", "3"}, {"7", "5", "6"}, {"1", "6", "9"} }, ColumnAlignments->{Decimal}], ")"}], TraditionalForm]], "Output", CellLabel->"Out[96]="] }, Open ]], Cell[TextData[ "We could solve this for a specific b vector or any one in general, lets try \ the general first. "], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[BoxData[ \(\(b = {b1, b2, b3}; \)\)], "Input", CellLabel->"In[97]:=", AspectRatioFixed->True], Cell[TextData[ "We would like the augmented matrix. This is actually not obvious how to \ construct by the Insert command seems to work with suitable tweaking!!"], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[CellGroupData[{ Cell[BoxData[ \(zz = Transpose[Insert[Transpose[a], \(-b\), 4]]\)], "Input", CellLabel->"In[98]:=", AspectRatioFixed->True], Cell[BoxData[ FormBox[ RowBox[{"(", GridBox[{ {"1", "2", "3", \(-b1\)}, {"7", "5", "6", \(-b2\)}, {"1", "6", "9", \(-b3\)} }], ")"}], TraditionalForm]], "Output", CellLabel->"Out[98]="] }, Open ]], Cell["Now, on with the show. Here is how to grab one row ", "Text", Evaluatable->False, AspectRatioFixed->True], Cell[CellGroupData[{ Cell[BoxData[ \(zz\[LeftDoubleBracket]1\[RightDoubleBracket]\)], "Input", CellLabel->"In[99]:=", AspectRatioFixed->True], Cell[BoxData[ \(TraditionalForm\`{1, 2, 3, \(-b1\)}\)], "Output", CellLabel->"Out[99]="] }, Open ]], Cell["\<\ Now use this row to eliminate the elements from the first column of \ the other two rows.\ \>", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(op12 = zz\[LeftDoubleBracket]2\[RightDoubleBracket] - zz\[LeftDoubleBracket]2, 1\[RightDoubleBracket]\ zz\[LeftDoubleBracket]1\[RightDoubleBracket]\)], "Input", CellLabel->"In[100]:=", AspectRatioFixed->True], Cell[BoxData[ \(TraditionalForm\`{0, \(-9\), \(-15\), 7\ b1 - b2}\)], "Output", CellLabel->"Out[100]="] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(op13 = zz\[LeftDoubleBracket]3\[RightDoubleBracket] - zz\[LeftDoubleBracket]1\[RightDoubleBracket]\)], "Input", CellLabel->"In[101]:=", AspectRatioFixed->True], Cell[BoxData[ \(TraditionalForm\`{0, 4, 6, b1 - b3}\)], "Output", CellLabel->"Out[101]="] }, Open ]], Cell["\<\ Here is the first intermediate step matrix (see how to reconstruct \ a matrix).\ \>", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(mattemp1 = {zz\[LeftDoubleBracket]1\[RightDoubleBracket], op12, op13} \)], "Input", CellLabel->"In[102]:=", AspectRatioFixed->True], Cell[BoxData[ FormBox[ RowBox[{"(", GridBox[{ {"1", "2", "3", \(-b1\)}, {"0", \(-9\), \(-15\), \(7\ b1 - b2\)}, {"0", "4", "6", \(b1 - b3\)} }], ")"}], TraditionalForm]], "Output", CellLabel->"Out[102]="] }, Open ]], Cell["\<\ Now we use the second row to do the elimination. Note the \ necessary factor.\ \>", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(op23 = mattemp1\[LeftDoubleBracket]3\[RightDoubleBracket] - \(mattemp1\[LeftDoubleBracket]3, 2\[RightDoubleBracket]\ mattemp1\[LeftDoubleBracket]2\[RightDoubleBracket]\)\/mattemp1 \[LeftDoubleBracket]2, 2\[RightDoubleBracket]\)], "Input", CellLabel->"In[103]:=", AspectRatioFixed->True], Cell[BoxData[ \(TraditionalForm \`{0, 0, \(-\(2\/3\)\), b1 + 4\/9\ \((7\ b1 - b2)\) - b3}\)], "Output", CellLabel->"Out[103]="] }, Open ]], Cell["\<\ After normalizing the last two rows, for a 3 by 3 we are finished \ with \"1\"'s down the diagonal and 0's below\ \>", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(ans1 = {zz\[LeftDoubleBracket]1\[RightDoubleBracket], op12\/op12\[LeftDoubleBracket]2\[RightDoubleBracket], op23\/op23\[LeftDoubleBracket]3\[RightDoubleBracket]}\)], "Input", CellLabel->"In[104]:=", AspectRatioFixed->True], Cell[BoxData[ FormBox[ RowBox[{"(", GridBox[{ {"1", "2", "3", \(-b1\)}, {"0", "1", \(5\/3\), \(1\/9\ \((b2 - 7\ b1)\)\)}, {"0", "0", "1", \(\(-\(3\/2\)\)\ \((b1 + 4\/9\ \((7\ b1 - b2)\) - b3)\)\)} }], ")"}], TraditionalForm]], "Output", CellLabel->"Out[104]="] }, Open ]], Cell[CellGroupData[{ Cell[TextData[ "The answer for {x1,x2,x3} is then obtained by back substitution. "], "Text",\ Evaluatable->False, AspectRatioFixed->True], Cell[TextData["x3="], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[CellGroupData[{ Cell[BoxData[ \(x3ans = Simplify[\(-ans1\[LeftDoubleBracket]3, 4\[RightDoubleBracket]\)]\)], "Input", CellLabel->"In[105]:=", AspectRatioFixed->True], Cell[BoxData[ \(TraditionalForm\`1\/6\ \((37\ b1 - 4\ b2 - 9\ b3)\)\)], "Output", CellLabel->"Out[105]="] }, Open ]], Cell[TextData["x2="], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[CellGroupData[{ Cell[BoxData[ \(x2ans = Simplify[\(- \((ans1\[LeftDoubleBracket]2, 3\[RightDoubleBracket]\ x3ans + ans1\[LeftDoubleBracket]2, 4\[RightDoubleBracket])\)\)]\)], "Input", CellLabel->"In[106]:=", AspectRatioFixed->True], Cell[BoxData[ \(TraditionalForm\`\(-\(\(19\ b1\)\/2\)\) + b2 + \(5\ b3\)\/2\)], "Output",\ CellLabel->"Out[106]="] }, Open ]], Cell[TextData["x1="], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[CellGroupData[{ Cell[BoxData[ \(x1ans = Simplify[\(- \((ans1\[LeftDoubleBracket]1, 2\[RightDoubleBracket]\ x2ans + ans1\[LeftDoubleBracket]1, 3\[RightDoubleBracket]\ x3ans + ans1\[LeftDoubleBracket]1, 4\[RightDoubleBracket])\)\)]\)], "Input", CellLabel->"In[107]:=", AspectRatioFixed->True], Cell[BoxData[ \(TraditionalForm\`1\/2\ \((3\ b1 - b3)\)\)], "Output", CellLabel->"Out[107]="] }, Open ]] }, Open ]], Cell["We can check these with the \"built in\" function:", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(LinearSolve[a, b]\)], "Input", CellLabel->"In[108]:=", AspectRatioFixed->True], Cell[BoxData[ \(TraditionalForm \`{1\/2\ \((3\ b1 - b3)\), 1\/2\ \((\(-19\)\ b1 + 2\ b2 + 5\ b3)\), 1\/6\ \((37\ b1 - 4\ b2 - 9\ b3)\)}\)], "Output", CellLabel->"Out[108]="] }, Open ]] }, Open ]], Cell[TextData["So it matches. "], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[CellGroupData[{ Cell[TextData["Now try a numerical example for b\n\nConsider A x = b"], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[BoxData[ \(\(a = {{9, 21, 3}, {4, 20, 6}, {1, 13, 9}}; \)\)], "Input", CellLabel->"In[109]:=", AspectRatioFixed->True], Cell[BoxData[ \(\(b = {1, 4, 13}; \)\)], "Input", CellLabel->"In[110]:=", AspectRatioFixed->True], Cell["Again we need the augmented matrix. ", "Text", Evaluatable->False, AspectRatioFixed->True], Cell[CellGroupData[{ Cell[BoxData[ \(zz = Transpose[Insert[Transpose[a], \(-b\), 4]]\)], "Input", CellLabel->"In[111]:=", AspectRatioFixed->True], Cell[BoxData[ FormBox[ RowBox[{"(", GridBox[{ {"9", "21", "3", \(-1\)}, {"4", "20", "6", \(-4\)}, {"1", "13", "9", \(-13\)} }, ColumnAlignments->{Decimal}], ")"}], TraditionalForm]], "Output", CellLabel->"Out[111]="] }, Open ]], Cell["Now, on with the show. Here is how to grab one row ", "Text", Evaluatable->False, AspectRatioFixed->True], Cell[CellGroupData[{ Cell[BoxData[ \(zz\[LeftDoubleBracket]1\[RightDoubleBracket]\)], "Input", CellLabel->"In[112]:=", AspectRatioFixed->True], Cell[BoxData[ \(TraditionalForm\`{9, 21, 3, \(-1\)}\)], "Output", CellLabel->"Out[112]="], Cell[CellGroupData[{ Cell[BoxData[ \(op12 = zz\[LeftDoubleBracket]2\[RightDoubleBracket] - \(zz\[LeftDoubleBracket]2, 1\[RightDoubleBracket]\ zz\[LeftDoubleBracket]1\[RightDoubleBracket]\)\/zz \[LeftDoubleBracket]1, 1\[RightDoubleBracket]\)], "Input", CellLabel->"In[113]:=", AspectRatioFixed->True], Cell[BoxData[ \(TraditionalForm\`{0, 32\/3, 14\/3, \(-\(32\/9\)\)}\)], "Output", CellLabel->"Out[113]="] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(op13 = zz\[LeftDoubleBracket]3\[RightDoubleBracket] - \(zz\[LeftDoubleBracket]3, 1\[RightDoubleBracket]\ zz\[LeftDoubleBracket]1\[RightDoubleBracket]\)\/zz \[LeftDoubleBracket]1, 1\[RightDoubleBracket]\)], "Input", CellLabel->"In[114]:=", AspectRatioFixed->True], Cell[BoxData[ \(TraditionalForm\`{0, 32\/3, 26\/3, \(-\(116\/9\)\)}\)], "Output", CellLabel->"Out[114]="] }, Open ]], Cell["Here is the first intermediate matrix:", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(mattemp1 = { zz\[LeftDoubleBracket]1\[RightDoubleBracket]\/zz \[LeftDoubleBracket]1, 1\[RightDoubleBracket], op12, op13}\)], "Input", CellLabel->"In[115]:=", AspectRatioFixed->True], Cell[BoxData[ FormBox[ RowBox[{"(", GridBox[{ {"1", \(7\/3\), \(1\/3\), \(-\(1\/9\)\)}, {"0", \(32\/3\), \(14\/3\), \(-\(32\/9\)\)}, {"0", \(32\/3\), \(26\/3\), \(-\(116\/9\)\)} }, ColumnAlignments->{Decimal}], ")"}], TraditionalForm]], "Output", CellLabel->"Out[115]="] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(op23 = mattemp1\[LeftDoubleBracket]3\[RightDoubleBracket] - \(mattemp1\[LeftDoubleBracket]3, 2\[RightDoubleBracket]\ mattemp1\[LeftDoubleBracket]2\[RightDoubleBracket]\)\/mattemp1 \[LeftDoubleBracket]2, 2\[RightDoubleBracket]\)], "Input", CellLabel->"In[116]:=", AspectRatioFixed->True], Cell[BoxData[ \(TraditionalForm\`{0, 0, 4, \(-\(28\/3\)\)}\)], "Output", CellLabel->"Out[116]="] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(ans1 = { zz\[LeftDoubleBracket]1\[RightDoubleBracket]\/zz \[LeftDoubleBracket]1, 1\[RightDoubleBracket], op12\/op12\[LeftDoubleBracket]2\[RightDoubleBracket], op23\/op23\[LeftDoubleBracket]3\[RightDoubleBracket]}\)], "Input", CellLabel->"In[117]:=", AspectRatioFixed->True], Cell[BoxData[ FormBox[ RowBox[{"(", GridBox[{ {"1", \(7\/3\), \(1\/3\), \(-\(1\/9\)\)}, {"0", "1", \(7\/16\), \(-\(1\/3\)\)}, {"0", "0", "1", \(-\(7\/3\)\)} }, ColumnAlignments->{Decimal}], ")"}], TraditionalForm]], "Output", CellLabel->"Out[117]="] }, Open ]], Cell[CellGroupData[{ Cell[TextData[ "The answer for {x1,x2,x3} is then obtained by back substitution. "], "Text",\ Evaluatable->False, AspectRatioFixed->True], Cell[TextData["x3="], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[CellGroupData[{ Cell[BoxData[ \(x3ans = \(-ans1\[LeftDoubleBracket]3, 4\[RightDoubleBracket]\)\)], "Input", CellLabel->"In[118]:=", AspectRatioFixed->True], Cell[BoxData[ \(TraditionalForm\`7\/3\)], "Output", CellLabel->"Out[118]="] }, Open ]], Cell[TextData["x2="], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[CellGroupData[{ Cell[BoxData[ \(x2ans = \(-\((ans1\[LeftDoubleBracket]2, 3\[RightDoubleBracket]\ x3ans + ans1\[LeftDoubleBracket]2, 4\[RightDoubleBracket])\)\)\)], "Input",\ CellLabel->"In[119]:=", AspectRatioFixed->True], Cell[BoxData[ \(TraditionalForm\`\(-\(11\/16\)\)\)], "Output", CellLabel->"Out[119]="] }, Open ]], Cell[TextData["x1="], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[CellGroupData[{ Cell[BoxData[ \(x1ans = \(-\((ans1\[LeftDoubleBracket]1, 2\[RightDoubleBracket]\ x2ans + ans1\[LeftDoubleBracket]1, 3\[RightDoubleBracket]\ x3ans + ans1\[LeftDoubleBracket]1, 4\[RightDoubleBracket])\)\)\)], "Input",\ CellLabel->"In[120]:=", AspectRatioFixed->True], Cell[BoxData[ \(TraditionalForm\`15\/16\)], "Output", CellLabel->"Out[120]="] }, Open ]] }, Open ]] }, Closed]], Cell[TextData["Again it agrees."], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[CellGroupData[{ Cell[BoxData[ \(LinearSolve[a, b]\)], "Input", CellLabel->"In[121]:=", AspectRatioFixed->True], Cell[BoxData[ \(TraditionalForm\`{15\/16, \(-\(11\/16\)\), 7\/3}\)], "Output", CellLabel->"Out[121]="] }, Open ]] }, Open ]], Cell["\<\ Of course, you cannot do an elimination if the element to do the \ eliminating is 0. To continue you must switch rows, (partial pivoting) which \ does not alter anything about the solution or switch rows and columns (full \ pivoting) in which case you do have some book keeping to attend to. See \ standard numerical analysis books about this issue for more information. \ \ \>", "Text", Evaluatable->False, AspectRatioFixed->True] }, Open ]], Cell[CellGroupData[{ Cell["LU decomposition", "Subsection", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ "For calculational purposes, it is often convenient to express the original \ matrix (of course) ", StyleBox["a", FontSlant->"Italic"], ", in terms of simpler pieces that allow straightforward computation of \ desired properties such as inverses and also can be used for solutions where \ the \"b\" vector may have many different values. \n\nConsider again ", StyleBox["A", FontSlant->"Italic"], " x = b\nHere is the idea. We wish to create a lower triangular matrix, L \ and an upper triangular matrix, U such that L U = A. We will find that U is \ just the resulting upper triangular matrix from Gauss elimination. The Lii \ elements will be the \"pivots\" or the \"on diagonal elements\" before the \ elimination. The Lij elements are the negatives of necessary multipliers for \ the elimination. This makes them the matrix elements of the matrix that is \ being worked on at a given step. (You will probably need to read this in \ chapter 3 of Noble and Daniel to make sense of what is being done.) \n\nThe \ reason that this will be useful is that we can then solve for an arbitrary b \ as follows.\nWe create a new vector, y, by solve the forward substitution \ problem,\n\nL y = b, then we solve\n\nUx = y \n\nby backward substitution to \ get x. This idea just comes from,\n\nL (Ux) = b with the Ux replaced by y. \ \n\nIf we do this, we do operations to get L and U, and then can solve for \ any b without doing any row operations. There is an operations count \ advantage if we need to solve for many different b's compared to using the \ augmented matrix formalizm given above. " }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell["\<\ Let's see if we can make this work. Here is what we want L to be\ \ \>", "Text", Evaluatable->False, AspectRatioFixed->True], Cell[CellGroupData[{ Cell[BoxData[ \(el = {{l\_11, 0, 0}, {l\_21, l\_22, 0}, {l\_31, l\_32, l\_33}}\)], "Input", CellLabel->"In[1]:="], Cell[BoxData[ FormBox[ RowBox[{"(", GridBox[{ {\(l\_11\), "0", "0"}, {\(l\_21\), \(l\_22\), "0"}, {\(l\_31\), \(l\_32\), \(l\_33\)} }], ")"}], TraditionalForm]], "Output", CellLabel->"Out[1]="], Cell["Here is what we want U to be. ", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(eu = {{1, u\_12, u\_13}, {0, 1, u\_23}, {0, 0, 1}}\)], "Input", CellLabel->"In[2]:="], Cell[BoxData[ FormBox[ RowBox[{"(", GridBox[{ {"1", \(u\_12\), \(u\_13\)}, {"0", "1", \(u\_23\)}, {"0", "0", "1"} }], ")"}], TraditionalForm]], "Output", CellLabel->"Out[2]="] }, Open ]], Cell["By definition, this should (also) be A.", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(zz = el . eu\)], "Input", CellLabel->"In[4]:="], Cell[BoxData[ FormBox[ RowBox[{"(", GridBox[{ {\(l\_11\), \(l\_11\ u\_12\), \(l\_11\ u\_13\)}, {\(l\_21\), \(l\_22 + l\_21\ u\_12\), \(l\_21\ u\_13 + l\_22\ u\_23\)}, {\(l\_31\), \(l\_32 + l\_31\ u\_12\), \(l\_33 + l\_31\ u\_13 + l\_32\ u\_23\)} }], ")"}], TraditionalForm]], "Output", CellLabel->"Out[4]="] }, Open ]] }, Open ]], Cell["\<\ We can see from our definition that the first column of L will be \ the same as the first column of A. \ \>", "Text"], Cell["\<\ Now continue and check if this gives back A by undoing it with \ Gaussian elimination. \ \>", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(zz\[LeftDoubleBracket]1\[RightDoubleBracket]\)], "Input", CellLabel->"In[5]:=", AspectRatioFixed->True], Cell[BoxData[ \(TraditionalForm\`{l\_11, l\_11\ u\_12, l\_11\ u\_13}\)], "Output", CellLabel->"Out[5]="], Cell[CellGroupData[{ Cell[BoxData[ \(op12 = zz\[LeftDoubleBracket]2\[RightDoubleBracket] - \(zz\[LeftDoubleBracket]2, 1\[RightDoubleBracket]\ zz\[LeftDoubleBracket]1\[RightDoubleBracket]\)\/zz \[LeftDoubleBracket]1, 1\[RightDoubleBracket]\)], "Input", CellLabel->"In[6]:=", AspectRatioFixed->True], Cell[BoxData[ \(TraditionalForm\`{0, l\_22, l\_22\ u\_23}\)], "Output", CellLabel->"Out[6]="] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(op13 = zz\[LeftDoubleBracket]3\[RightDoubleBracket] - \(zz\[LeftDoubleBracket]3, 1\[RightDoubleBracket]\ zz\[LeftDoubleBracket]1\[RightDoubleBracket]\)\/zz \[LeftDoubleBracket]1, 1\[RightDoubleBracket]\)], "Input", CellLabel->"In[7]:=", AspectRatioFixed->True], Cell[BoxData[ \(TraditionalForm\`{0, l\_32, l\_33 + l\_32\ u\_23}\)], "Output", CellLabel->"Out[7]="] }, Open ]], Cell["\<\ Here is the first intermediate matrix. Note the values in the \ second column!!\ \>", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(mattemp1 = { zz\[LeftDoubleBracket]1\[RightDoubleBracket]\/zz \[LeftDoubleBracket]1, 1\[RightDoubleBracket], op12, op13}\)], "Input", CellLabel->"In[8]:=", AspectRatioFixed->True], Cell[BoxData[ FormBox[ RowBox[{"(", GridBox[{ {"1", \(u\_12\), \(u\_13\)}, {"0", \(l\_22\), \(l\_22\ u\_23\)}, {"0", \(l\_32\), \(l\_33 + l\_32\ u\_23\)} }], ")"}], TraditionalForm]], "Output", CellLabel->"Out[8]="] }, Open ]], Cell["\<\ We see that we want the second column terms including and below the \ diagonal.\ \>", "Text"], Cell["Do it again and we get the L[3,3] element. ", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(op23 = mattemp1\[LeftDoubleBracket]3\[RightDoubleBracket] - \(mattemp1\[LeftDoubleBracket]3, 2\[RightDoubleBracket]\ mattemp1\[LeftDoubleBracket]2\[RightDoubleBracket]\)\/mattemp1 \[LeftDoubleBracket]2, 2\[RightDoubleBracket]\)], "Input", CellLabel->"In[9]:=", AspectRatioFixed->True], Cell[BoxData[ \(TraditionalForm\`{0, 0, l\_33}\)], "Output", CellLabel->"Out[9]="] }, Open ]], Cell["\<\ So for U we have (which works!!) our desired upper triagonal \ matrix. \ \>", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(ans1 = { zz\[LeftDoubleBracket]1\[RightDoubleBracket]\/zz \[LeftDoubleBracket]1, 1\[RightDoubleBracket], op12\/op12\[LeftDoubleBracket]2\[RightDoubleBracket], op23\/op23\[LeftDoubleBracket]3\[RightDoubleBracket]}\)], "Input", CellLabel->"In[10]:=", AspectRatioFixed->True], Cell[BoxData[ FormBox[ RowBox[{"(", GridBox[{ {"1", \(u\_12\), \(u\_13\)}, {"0", "1", \(u\_23\)}, {"0", "0", "1"} }], ")"}], TraditionalForm]], "Output", CellLabel->"Out[10]="] }, Open ]] }, Open ]], Cell["Check again", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(zz - el . eu\)], "Input", CellLabel->"In[12]:="], Cell[BoxData[ FormBox[ RowBox[{"(", GridBox[{ {"0", "0", "0"}, {"0", "0", "0"}, {"0", "0", "0"} }, ColumnAlignments->{Decimal}], ")"}], TraditionalForm]], "Output", CellLabel->"Out[12]="] }, Open ]], Cell["Now do a numerical example.", "Text"], Cell[BoxData[ \(\(a = {{12, 33, 3}, {4, 20, 16}, {111, 12, 9}}; \)\)], "Input", CellLabel->"In[3]:=", AspectRatioFixed->True], Cell[BoxData[ \(\(b = {1, 4, 13}; \)\)], "Input", CellLabel->"In[4]:=", AspectRatioFixed->True], Cell[CellGroupData[{ Cell[BoxData[ \(a\)], "Input", CellLabel->"In[16]:=", AspectRatioFixed->True], Cell[BoxData[ FormBox[ RowBox[{"(", GridBox[{ {"12", "33", "3"}, {"4", "20", "16"}, {"111", "12", "9"} }, ColumnAlignments->{Decimal}], ")"}], TraditionalForm]], "Output", CellLabel->"Out[16]="] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(a\[LeftDoubleBracket]1\[RightDoubleBracket]\)], "Input", CellLabel->"In[17]:=", AspectRatioFixed->True], Cell[BoxData[ \(TraditionalForm\`{12, 33, 3}\)], "Output", CellLabel->"Out[17]="] }, Open ]], Cell[TextData[{ "The first column of L is the same as ", StyleBox["a", FontSlant->"Italic"] }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[CellGroupData[{ Cell[BoxData[ \(l11 = a\[LeftDoubleBracket]1, 1\[RightDoubleBracket]\)], "Input", CellLabel->"In[18]:=", AspectRatioFixed->True], Cell[BoxData[ \(TraditionalForm\`12\)], "Output", CellLabel->"Out[18]="] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(l21 = a\[LeftDoubleBracket]2, 1\[RightDoubleBracket]\)], "Input", CellLabel->"In[19]:=", AspectRatioFixed->True], Cell[BoxData[ \(TraditionalForm\`4\)], "Output", CellLabel->"Out[19]="] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(l31 = a\[LeftDoubleBracket]3, 1\[RightDoubleBracket]\)], "Input", CellLabel->"In[20]:=", AspectRatioFixed->True], Cell[BoxData[ \(TraditionalForm\`111\)], "Output", CellLabel->"Out[20]="] }, Open ]], Cell[TextData["Now perform the 2 row operations"], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[CellGroupData[{ Cell[BoxData[ \(op12 = a\[LeftDoubleBracket]2\[RightDoubleBracket] - \(a\[LeftDoubleBracket]2, 1\[RightDoubleBracket]\ a\[LeftDoubleBracket]1\[RightDoubleBracket]\)\/a \[LeftDoubleBracket]1, 1\[RightDoubleBracket]\)], "Input", CellLabel->"In[21]:=", AspectRatioFixed->True], Cell[BoxData[ \(TraditionalForm\`{0, 9, 15}\)], "Output", CellLabel->"Out[21]="] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(op13 = a\[LeftDoubleBracket]3\[RightDoubleBracket] - \(a\[LeftDoubleBracket]3, 1\[RightDoubleBracket]\ a\[LeftDoubleBracket]1\[RightDoubleBracket]\)\/a \[LeftDoubleBracket]1, 1\[RightDoubleBracket]\)], "Input", CellLabel->"In[22]:=", AspectRatioFixed->True], Cell[BoxData[ \(TraditionalForm\`{0, \(-\(1173\/4\)\), \(-\(75\/4\)\)}\)], "Output", CellLabel->"Out[22]="] }, Open ]], Cell["The intermediate matrix looks like:", "Text", Evaluatable->False, AspectRatioFixed->True], Cell[CellGroupData[{ Cell[BoxData[ \(mattemp1 = { a\[LeftDoubleBracket]1\[RightDoubleBracket]\/a\[LeftDoubleBracket]1, 1 \[RightDoubleBracket], op12, op13}\)], "Input", CellLabel->"In[23]:=", AspectRatioFixed->True], Cell[BoxData[ FormBox[ RowBox[{"(", GridBox[{ {"1", \(11\/4\), \(1\/4\)}, {"0", "9", "15"}, {"0", \(-\(1173\/4\)\), \(-\(75\/4\)\)} }, ColumnAlignments->{Decimal}], ")"}], TraditionalForm]], "Output", CellLabel->"Out[23]="] }, Open ]], Cell[TextData["Now get the next column of L"], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[CellGroupData[{ Cell[BoxData[ \(l22 = mattemp1\[LeftDoubleBracket]2, 2\[RightDoubleBracket]\)], "Input",\ CellLabel->"In[24]:=", AspectRatioFixed->True], Cell[BoxData[ \(TraditionalForm\`9\)], "Output", CellLabel->"Out[24]="] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(l32 = mattemp1\[LeftDoubleBracket]3, 2\[RightDoubleBracket]\)], "Input",\ CellLabel->"In[25]:=", AspectRatioFixed->True], Cell[BoxData[ \(TraditionalForm\`\(-\(1173\/4\)\)\)], "Output", CellLabel->"Out[25]="] }, Open ]], Cell[TextData["We have only one row operation left"], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[CellGroupData[{ Cell[BoxData[ \(op23 = mattemp1\[LeftDoubleBracket]3\[RightDoubleBracket] - \(mattemp1\[LeftDoubleBracket]3, 2\[RightDoubleBracket]\ mattemp1\[LeftDoubleBracket]2\[RightDoubleBracket]\)\/mattemp1 \[LeftDoubleBracket]2, 2\[RightDoubleBracket]\)], "Input", CellLabel->"In[26]:=", AspectRatioFixed->True], Cell[BoxData[ \(TraditionalForm\`{0, 0, 470}\)], "Output", CellLabel->"Out[26]="] }, Open ]], Cell[TextData["Then we can get the last value for L"], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[CellGroupData[{ Cell[BoxData[ \(l33 = op23\[LeftDoubleBracket]3\[RightDoubleBracket]\)], "Input", CellLabel->"In[27]:=", AspectRatioFixed->True], Cell[BoxData[ \(TraditionalForm\`470\)], "Output", CellLabel->"Out[27]="] }, Open ]], Cell[TextData["The upper matix is "], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[CellGroupData[{ Cell[BoxData[ \(TraditionalForm \`U = {a\[LeftDoubleBracket]1\[RightDoubleBracket]\/a \[LeftDoubleBracket]1, 1\[RightDoubleBracket], op12\/op12\[LeftDoubleBracket]2\[RightDoubleBracket], op23\/op23\[LeftDoubleBracket]3\[RightDoubleBracket]}\)], "Input", CellLabel->"In[28]:=", AspectRatioFixed->True], Cell[BoxData[ FormBox[ RowBox[{"(", GridBox[{ {"1", \(11\/4\), \(1\/4\)}, {"0", "1", \(5\/3\)}, {"0", "0", "1"} }, ColumnAlignments->{Decimal}], ")"}], TraditionalForm]], "Output", CellLabel->"Out[28]="] }, Open ]], Cell[TextData["Construct L"], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[CellGroupData[{ Cell[BoxData[ \(L = {{l11, 0, 0}, {l21, l22, 0}, {l31, l32, l33}}\)], "Input", CellLabel->"In[29]:=", AspectRatioFixed->True], Cell[BoxData[ FormBox[ RowBox[{"(", GridBox[{ {"12", "0", "0"}, {"4", "9", "0"}, {"111", \(-\(1173\/4\)\), "470"} }, ColumnAlignments->{Decimal}], ")"}], TraditionalForm]], "Output", CellLabel->"Out[29]="] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(L . U\)], "Input", CellLabel->"In[30]:=", AspectRatioFixed->True], Cell[BoxData[ FormBox[ RowBox[{"(", GridBox[{ {"12", "33", "3"}, {"4", "20", "16"}, {"111", "12", "9"} }, ColumnAlignments->{Decimal}], ")"}], TraditionalForm]], "Output", CellLabel->"Out[30]="] }, Open ]], Cell[TextData[{ "Check against ", StyleBox["a", FontSlant->"Italic"] }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[CellGroupData[{ Cell[BoxData[ \(a\)], "Input", CellLabel->"In[31]:=", AspectRatioFixed->True], Cell[BoxData[ FormBox[ RowBox[{"(", GridBox[{ {"12", "33", "3"}, {"4", "20", "16"}, {"111", "12", "9"} }, ColumnAlignments->{Decimal}], ")"}], TraditionalForm]], "Output", CellLabel->"Out[31]="] }, Open ]], Cell[TextData["to solve for an arbitrary b"], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[CellGroupData[{ Cell[BoxData[ \(b\)], "Input", CellLabel->"In[32]:=", AspectRatioFixed->True], Cell[BoxData[ \(TraditionalForm\`{1, 4, 13}\)], "Output", CellLabel->"Out[32]="] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(y = LinearSolve[L, b]\)], "Input", CellLabel->"In[33]:=", AspectRatioFixed->True], Cell[BoxData[ \(TraditionalForm\`{1\/12, 11\/27, 1109\/4230}\)], "Output", CellLabel->"Out[33]="] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(xx = LinearSolve[U, y]\)], "Input", CellLabel->"In[34]:=", AspectRatioFixed->True], Cell[BoxData[ \(TraditionalForm\`{419\/4230, \(-\(25\/846\)\), 1109\/4230}\)], "Output",\ CellLabel->"Out[34]="] }, Open ]], Cell["Compare this to the built-in function", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(LinearSolve[a, b]\)], "Input", CellLabel->"In[35]:=", AspectRatioFixed->True], Cell[BoxData[ \(TraditionalForm\`{419\/4230, \(-\(25\/846\)\), 1109\/4230}\)], "Output",\ CellLabel->"Out[35]="] }, Open ]], Cell["We are glad to see that it works. ", "Text"] }, Open ]], Cell[CellGroupData[{ Cell["Inverse by Gaussian elimination", "Subsection", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ "We have mentioned that we would never be calculating properties of large \ matrices with the direct calculation of determinants by Laplace's method. \ Gaussian elimination is the procedure that is most efficient at matix \ manipulations so we should figure out how to use it to calculate the inverse.\ \n\nSince we have already seen that that for Ly = b, then, Ux=y is easily \ solved to get x by forward and back substitution. That is L U x = b,\nUx= L", StyleBox["-1", FontVariations->{"CompatibilityType"->"Superscript"}], " b = y\nx = U", StyleBox["-1", FontVariations->{"CompatibilityType"->"Superscript"}], " y\nwhich are trivial calculations as they are only forward and back \ substitutions. If b were composed of n vectors that represented an n \ identity matrix, solving for x would be the same as calculating the inverse \ of ", StyleBox["a", FontSlant->"Italic"], ", one column at a time. So we do this three times for the three required \ b's. " }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[CellGroupData[{ Cell[BoxData[{ \(\(b1 = {1, 0, 0}; \)\), \(\(b2 = {0, 1, 0}; \)\), \(\(b3 = {0, 0, 1}; \)\)}], "Input", CellLabel->"In[37]:=", AspectRatioFixed->True], Cell[CellGroupData[{ Cell[BoxData[ \(L\)], "Input", CellLabel->"In[40]:=", AspectRatioFixed->True], Cell[BoxData[ FormBox[ RowBox[{"(", GridBox[{ {"12", "0", "0"}, {"4", "9", "0"}, {"111", \(-\(1173\/4\)\), "470"} }, ColumnAlignments->{Decimal}], ")"}], TraditionalForm]], "Output", CellLabel->"Out[40]="] }, Open ]], Cell[CellGroupData[{ Cell[TextData[ "The answer for {x1,x2,x3} is then obtained by back substitution. "], "Text",\ Evaluatable->False, AspectRatioFixed->True], Cell[TextData["x3="], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[CellGroupData[{ Cell[BoxData[ \(y11 = b1\[LeftDoubleBracket]1\[RightDoubleBracket]\/L\[LeftDoubleBracket]1, 1 \[RightDoubleBracket]\)], "Input", CellLabel->"In[41]:=", AspectRatioFixed->True], Cell[BoxData[ \(TraditionalForm\`1\/12\)], "Output", CellLabel->"Out[41]="] }, Open ]], Cell[TextData["x2="], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[CellGroupData[{ Cell[BoxData[ \(y21 = \(b1\[LeftDoubleBracket]2\[RightDoubleBracket] - y11\ L\[LeftDoubleBracket]2, 1\[RightDoubleBracket]\)\/L \[LeftDoubleBracket]2, 2\[RightDoubleBracket]\)], "Input", CellLabel->"In[42]:=", AspectRatioFixed->True], Cell[BoxData[ \(TraditionalForm\`\(-\(1\/27\)\)\)], "Output", CellLabel->"Out[42]="] }, Open ]], Cell[TextData["x1="], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[CellGroupData[{ Cell[BoxData[ \(y31 = \(b1\[LeftDoubleBracket]3\[RightDoubleBracket] - y11\ L\[LeftDoubleBracket]3, 1\[RightDoubleBracket] - y21\ L\[LeftDoubleBracket]3, 2\[RightDoubleBracket]\)\/L \[LeftDoubleBracket]3, 3\[RightDoubleBracket]\)], "Input", CellLabel->"In[43]:=", AspectRatioFixed->True], Cell[BoxData[ \(TraditionalForm\`\(-\(181\/4230\)\)\)], "Output", CellLabel->"Out[43]="] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(U\)], "Input", CellLabel->"In[44]:=", AspectRatioFixed->True], Cell[BoxData[ FormBox[ RowBox[{"(", GridBox[{ {"1", \(11\/4\), \(1\/4\)}, {"0", "1", \(5\/3\)}, {"0", "0", "1"} }, ColumnAlignments->{Decimal}], ")"}], TraditionalForm]], "Output", CellLabel->"Out[44]="] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(x31 = y31\)], "Input", CellLabel->"In[45]:=", AspectRatioFixed->True], Cell[BoxData[ \(TraditionalForm\`\(-\(181\/4230\)\)\)], "Output", CellLabel->"Out[45]="] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(x21 = y21 - U\[LeftDoubleBracket]2, 3\[RightDoubleBracket]\ x31\)], "Input", CellLabel->"In[46]:=", AspectRatioFixed->True], Cell[BoxData[ \(TraditionalForm\`29\/846\)], "Output", CellLabel->"Out[46]="] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(x11 = y11 - U\[LeftDoubleBracket]1, 2\[RightDoubleBracket]\ x21 - U\[LeftDoubleBracket]1, 3\[RightDoubleBracket]\ x31\)], "Input", CellLabel->"In[47]:=", AspectRatioFixed->True], Cell[BoxData[ \(TraditionalForm\`\(-\(1\/4230\)\)\)], "Output", CellLabel->"Out[47]="] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(Inverse[a]\)], "Input", CellLabel->"In[48]:=", AspectRatioFixed->True], Cell[BoxData[ FormBox[ RowBox[{"(", GridBox[{ {\(-\(1\/4230\)\), \(-\(29\/5640\)\), \(13\/1410\)}, {\(29\/846\), \(-\(5\/1128\)\), \(-\(1\/282\)\)}, {\(-\(181\/4230\)\), \(391\/5640\), \(1\/470\)} }, ColumnAlignments->{Decimal}], ")"}], TraditionalForm]], "Output", CellLabel->"Out[48]="] }, Open ]] }, Open ]], Cell[TextData[ "So the first column checks,\nLet us get the entire matrix"], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[CellGroupData[{ Cell[BoxData[{ \(\(b1 = {1, 0, 0}; \)\), \(\(b2 = {0, 1, 0}; \)\), \(\(b3 = {0, 0, 1}; \)\)}], "Input", CellLabel->"In[49]:=", AspectRatioFixed->True], Cell["define the identity matrix", "Text", Evaluatable->False, AspectRatioFixed->True], Cell[BoxData[ \(\(bi = {{1, 0, 0}, {0, 1, 0}, {0, 0, 1}}; \)\)], "Input", CellLabel->"In[52]:=", AspectRatioFixed->True], Cell[TextData["initialize the y matrix"], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[CellGroupData[{ Cell[BoxData[ \(y = {{1, 1, 1}, {1, 1, 1}, {1, 1, 1}}\)], "Input", CellLabel->"In[53]:=", AspectRatioFixed->True], Cell[BoxData[ FormBox[ RowBox[{"(", GridBox[{ {"1", "1", "1"}, {"1", "1", "1"}, {"1", "1", "1"} }, ColumnAlignments->{Decimal}], ")"}], TraditionalForm]], "Output", CellLabel->"Out[53]="] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(L\)], "Input", CellLabel->"In[54]:=", AspectRatioFixed->True], Cell[BoxData[ FormBox[ RowBox[{"(", GridBox[{ {"12", "0", "0"}, {"4", "9", "0"}, {"111", \(-\(1173\/4\)\), "470"} }, ColumnAlignments->{Decimal}], ")"}], TraditionalForm]], "Output", CellLabel->"Out[54]="] }, Open ]], Cell[TextData[{ "We can easily solve the forward substitution (the value of this is to \ write it in a ", StyleBox["Mathematica", FontSlant->"Italic"], " loop)" }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[BoxData[ \(\(Do[ y\[LeftDoubleBracket]1, i\[RightDoubleBracket] = bi\[LeftDoubleBracket]i, 1\[RightDoubleBracket]\/L \[LeftDoubleBracket]1, 1\[RightDoubleBracket]; y\[LeftDoubleBracket]2, i\[RightDoubleBracket] = \(bi\[LeftDoubleBracket]i, 2\[RightDoubleBracket] - y\[LeftDoubleBracket]1, i\[RightDoubleBracket]\ L\[LeftDoubleBracket]2, 1\[RightDoubleBracket]\)\/L \[LeftDoubleBracket]2, 2\[RightDoubleBracket]; \(y\[LeftDoubleBracket]3, i\[RightDoubleBracket] = \(bi\[LeftDoubleBracket]i, 3\[RightDoubleBracket] - y\[LeftDoubleBracket]1, i\[RightDoubleBracket]\ L\[LeftDoubleBracket]3, 1\[RightDoubleBracket] - y\[LeftDoubleBracket]2, i\[RightDoubleBracket]\ L\[LeftDoubleBracket]3, 2\[RightDoubleBracket]\)\/L \[LeftDoubleBracket]3, 3\[RightDoubleBracket]; \), {i, 1, 3}]; \)\)], "Input", CellLabel->"In[55]:=", AspectRatioFixed->True], Cell[TextData["Which gives"], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[CellGroupData[{ Cell[BoxData[ \(y\)], "Input", CellLabel->"In[56]:=", AspectRatioFixed->True], Cell[BoxData[ FormBox[ RowBox[{"(", GridBox[{ {\(1\/12\), "0", "0"}, {\(-\(1\/27\)\), \(1\/9\), "0"}, {\(-\(181\/4230\)\), \(391\/5640\), \(1\/470\)} }, ColumnAlignments->{Decimal}], ")"}], TraditionalForm]], "Output", CellLabel->"Out[56]="] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(U\)], "Input", CellLabel->"In[57]:=", AspectRatioFixed->True], Cell[BoxData[ FormBox[ RowBox[{"(", GridBox[{ {"1", \(11\/4\), \(1\/4\)}, {"0", "1", \(5\/3\)}, {"0", "0", "1"} }, ColumnAlignments->{Decimal}], ")"}], TraditionalForm]], "Output", CellLabel->"Out[57]="] }, Open ]], Cell[TextData["We can check this one"], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[CellGroupData[{ Cell[BoxData[ \(LinearSolve[U, y]\)], "Input", CellLabel->"In[58]:=", AspectRatioFixed->True], Cell[BoxData[ FormBox[ RowBox[{"(", GridBox[{ {\(-\(1\/4230\)\), \(-\(29\/5640\)\), \(13\/1410\)}, {\(29\/846\), \(-\(5\/1128\)\), \(-\(1\/282\)\)}, {\(-\(181\/4230\)\), \(391\/5640\), \(1\/470\)} }, ColumnAlignments->{Decimal}], ")"}], TraditionalForm]], "Output", CellLabel->"Out[58]="] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(y\)], "Input", CellLabel->"In[59]:=", AspectRatioFixed->True], Cell[BoxData[ FormBox[ RowBox[{"(", GridBox[{ {\(1\/12\), "0", "0"}, {\(-\(1\/27\)\), \(1\/9\), "0"}, {\(-\(181\/4230\)\), \(391\/5640\), \(1\/470\)} }, ColumnAlignments->{Decimal}], ")"}], TraditionalForm]], "Output", CellLabel->"Out[59]="] }, Open ]], Cell[TextData["Now the back substitution"], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[BoxData[ \(\(ainv = {{1, 1, 1}, {1, 1, 1}, {1, 1, 1}}; \)\)], "Input", CellLabel->"In[60]:=", AspectRatioFixed->True], Cell[BoxData[ \(\(Do[ ainv\[LeftDoubleBracket]3, i\[RightDoubleBracket] = y\[LeftDoubleBracket]3, i\[RightDoubleBracket]; ainv\[LeftDoubleBracket]2, i\[RightDoubleBracket] = y\[LeftDoubleBracket]2, i\[RightDoubleBracket] - ainv\[LeftDoubleBracket]3, i\[RightDoubleBracket]\ U\[LeftDoubleBracket]2, 3\[RightDoubleBracket]; \(ainv\[LeftDoubleBracket]1, i\[RightDoubleBracket] = y\[LeftDoubleBracket]1, i\[RightDoubleBracket] - ainv\[LeftDoubleBracket]2, i\[RightDoubleBracket]\ U\[LeftDoubleBracket]1, 2\[RightDoubleBracket] - ainv\[LeftDoubleBracket]3, i\[RightDoubleBracket]\ U\[LeftDoubleBracket]1, 3\[RightDoubleBracket]; \), {i, 1, 3}]; \)\)], "Input", CellLabel->"In[61]:=", AspectRatioFixed->True], Cell[CellGroupData[{ Cell[BoxData[ \(ainv\)], "Input", CellLabel->"In[62]:=", AspectRatioFixed->True], Cell[BoxData[ FormBox[ RowBox[{"(", GridBox[{ {\(-\(1\/4230\)\), \(-\(29\/5640\)\), \(13\/1410\)}, {\(29\/846\), \(-\(5\/1128\)\), \(-\(1\/282\)\)}, {\(-\(181\/4230\)\), \(391\/5640\), \(1\/470\)} }, ColumnAlignments->{Decimal}], ")"}], TraditionalForm]], "Output", CellLabel->"Out[62]="] }, Open ]], Cell[TextData["Which checks with the built in function. "], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[CellGroupData[{ Cell[BoxData[ \(Inverse[a]\)], "Input", CellLabel->"In[63]:=", AspectRatioFixed->True], Cell[BoxData[ FormBox[ RowBox[{"(", GridBox[{ {\(-\(1\/4230\)\), \(-\(29\/5640\)\), \(13\/1410\)}, {\(29\/846\), \(-\(5\/1128\)\), \(-\(1\/282\)\)}, {\(-\(181\/4230\)\), \(391\/5640\), \(1\/470\)} }, ColumnAlignments->{Decimal}], ")"}], TraditionalForm]], "Output", CellLabel->"Out[63]="] }, Open ]] }, Open ]], Cell[TextData[ "The LU factorization can be done with a canned package also, but it employs \ partial pivoting so there can be differences in the LU"], "Text", Evaluatable->False, AspectRatioFixed->True], Cell["Here we load the package:", "Text"], Cell[BoxData[ \(Needs["\"]\)], "Input", CellLabel->"In[1]:=", AspectRatioFixed->True], Cell[CellGroupData[{ Cell[BoxData[ \(LUFactor[a]\)], "Input", CellLabel->"In[5]:=", AspectRatioFixed->True], Cell[BoxData[ FormBox[ RowBox[{"LU", "(", RowBox[{ RowBox[{"(", GridBox[{ {\(4\/37\), \(1173\/37\), \(75\/37\)}, {\(4\/111\), \(724\/1173\), \(5640\/391\)}, {"111", "12", "9"} }, ColumnAlignments->{Decimal}], ")"}], ",", \({3, 1, 2}\)}], ")"}], TraditionalForm]], "Output", CellLabel->"Out[5]="] }, Open ]], Cell["Solve for the inverse one column at a time:", "Text"], Cell[BoxData[{ \(\(b1 = {1, 0, 0}; \)\), \(\(b2 = {0, 1, 0}; \)\), \(\(b3 = {0, 0, 1}; \)\)}], "Input", CellLabel->"In[6]:=", AspectRatioFixed->True], Cell[CellGroupData[{ Cell[BoxData[ \(row1 = LUSolve[LUFactor[a], b1]\)], "Input", CellLabel->"In[9]:=", AspectRatioFixed->True], Cell[BoxData[ \(TraditionalForm\`{\(-\(1\/4230\)\), 29\/846, \(-\(181\/4230\)\)}\)], "Output", CellLabel->"Out[9]="] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(row2 = LUSolve[LUFactor[a], b2]\)], "Input", CellLabel->"In[10]:=", AspectRatioFixed->True], Cell[BoxData[ \(TraditionalForm\`{\(-\(29\/5640\)\), \(-\(5\/1128\)\), 391\/5640}\)], "Output", CellLabel->"Out[10]="] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(row3 = LUSolve[LUFactor[a], b3]\)], "Input", CellLabel->"In[11]:=", AspectRatioFixed->True], Cell[BoxData[ \(TraditionalForm\`{13\/1410, \(-\(1\/282\)\), 1\/470}\)], "Output", CellLabel->"Out[11]="] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(temp = {row1, row2, row3}\)], "Input", CellLabel->"In[12]:=", AspectRatioFixed->True], Cell[BoxData[ FormBox[ RowBox[{"(", GridBox[{ {\(-\(1\/4230\)\), \(29\/846\), \(-\(181\/4230\)\)}, {\(-\(29\/5640\)\), \(-\(5\/1128\)\), \(391\/5640\)}, {\(13\/1410\), \(-\(1\/282\)\), \(1\/470\)} }, ColumnAlignments->{Decimal}], ")"}], TraditionalForm]], "Output", CellLabel->"Out[12]="] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(inversea = \ Transpose[temp]\)], "Input", CellLabel->"In[13]:=", AspectRatioFixed->True], Cell[BoxData[ FormBox[ RowBox[{"(", GridBox[{ {\(-\(1\/4230\)\), \(-\(29\/5640\)\), \(13\/1410\)}, {\(29\/846\), \(-\(5\/1128\)\), \(-\(1\/282\)\)}, {\(-\(181\/4230\)\), \(391\/5640\), \(1\/470\)} }, ColumnAlignments->{Decimal}], ")"}], TraditionalForm]], "Output", CellLabel->"Out[13]="] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(Inverse[a]\)], "Input", CellLabel->"In[14]:=", AspectRatioFixed->True], Cell[BoxData[ FormBox[ RowBox[{"(", GridBox[{ {\(-\(1\/4230\)\), \(-\(29\/5640\)\), \(13\/1410\)}, {\(29\/846\), \(-\(5\/1128\)\), \(-\(1\/282\)\)}, {\(-\(181\/4230\)\), \(391\/5640\), \(1\/470\)} }, ColumnAlignments->{Decimal}], ")"}], TraditionalForm]], "Output", CellLabel->"Out[14]="] }, Open ]], Cell["So we get the same answer!!", "Text", Evaluatable->False, AspectRatioFixed->True] }, Open ]] }, Open ]] }, FrontEndVersion->"4.0 for Macintosh", ScreenRectangle->{{0, 1152}, {0, 850}}, WindowToolbars->{}, CellGrouping->Manual, WindowSize->{629, 791}, WindowMargins->{{40, Automatic}, {Automatic, 11}}, PrintingCopies->1, PrintingPageRange->{27, 32}, PrintingOptions->{"PrintingMargins"->{{54, 54}, {72, 72}}, "PrintCellBrackets"->False, "PrintRegistrationMarks"->False, "PrintMultipleHorizontalPages"->False}, PrivateNotebookOptions->{"ColorPalette"->{RGBColor, 128}}, ShowCellLabel->True, ShowCellTags->False, RenderingOptions->{"ObjectDithering"->True, "RasterDithering"->False}, CharacterEncoding->"MacintoshAutomaticEncoding", StyleDefinitions -> Notebook[{ Cell[CellGroupData[{ Cell["Style Definitions", "Subtitle"], Cell["\<\ Modify the definitions below to change the default appearance of \ all cells in a given style. Make modifications to any definition using commands in the Format menu.\ \>", "Text"], Cell[CellGroupData[{ Cell["Style Environment Names", "Section"], Cell[StyleData[All, "Working"], ScriptMinSize->9], Cell[StyleData[All, "Printout"], PageWidth->PaperWidth, ShowCellLabel->False, ImageSize->{200, 200}, PrivateFontOptions->{"FontType"->"Outline"}] }, Closed]], Cell[CellGroupData[{ Cell["Notebook Options", "Section"], Cell["\<\ The options defined for the style below will be used at the \ Notebook level.\ \>", "Text"], Cell[StyleData["Notebook"], PageHeaders->{{Cell[ TextData[ { CounterBox[ "Page"]}], "PageNumber"], None, Cell[ TextData[ { ValueBox[ "FileName"]}], "Header"]}, {Cell[ TextData[ { ValueBox[ "FileName"]}], "Header"], None, Cell[ TextData[ { CounterBox[ "Page"]}], "PageNumber"]}}, PageHeaderLines->{True, True}, PrintingOptions->{"FirstPageHeader"->False, "FacingPages"->True}, CellLabelAutoDelete->False, CellFrameLabelMargins->6, StyleMenuListing->None] }, Closed]], Cell[CellGroupData[{ Cell["Styles for Headings", "Section"], Cell[CellGroupData[{ Cell[StyleData["Title"], CellFrame->{{0, 0}, {0, 0.25}}, CellMargins->{{18, 30}, {4, 20}}, CellGroupingRules->{"TitleGrouping", 0}, PageBreakBelow->False, CellFrameMargins->9, LineSpacing->{0.95, 0}, CounterIncrements->"Title", CounterAssignments->{{"Section", 0}, {"Equation", 0}, {"Figure", 0}}, FontSize->36, Background->RGBColor[0.750011, 1, 0.750011]], Cell[StyleData["Title", "Printout"], CellMargins->{{18, 30}, {4, 0}}, CellFrameMargins->4, FontSize->30] }, Open ]], Cell[CellGroupData[{ Cell[StyleData["Subtitle"], CellMargins->{{18, 30}, {0, 10}}, CellGroupingRules->{"TitleGrouping", 10}, PageBreakBelow->False, LineSpacing->{1, 0}, CounterIncrements->"Subtitle", CounterAssignments->{{"Section", 0}, {"Equation", 0}, {"Figure", 0}}, FontSize->24, FontSlant->"Italic", Background->RGBColor[0.8, 0.920012, 0.920012]], Cell[StyleData["Subtitle", "Printout"], CellMargins->{{18, 30}, {0, 10}}, FontSize->18] }, Closed]], Cell[CellGroupData[{ Cell[StyleData["SectionFirst"], CellFrame->{{0, 0}, {0, 3}}, CellMargins->{{18, 30}, {4, 30}}, CellGroupingRules->{"SectionGrouping", 40}, PageBreakBelow->False, CellFrameMargins->3, CounterIncrements->"Section", CounterAssignments->{{"Subsection", 0}, {"Subsubsection", 0}}, FontSize->18, FontWeight->"Bold"], Cell[StyleData["SectionFirst", "Printout"], FontSize->14] }, Closed]], Cell[CellGroupData[{ Cell[StyleData["Section"], CellMargins->{{18, 30}, {4, 30}}, CellGroupingRules->{"SectionGrouping", 40}, PageBreakBelow->False, CounterIncrements->"Section", CounterAssignments->{{"Subsection", 0}, {"Subsubsection", 0}}, FontSize->18, FontWeight->"Bold", Background->RGBColor[0.920012, 0.870024, 0.770016]], Cell[StyleData["Section", "Printout"], FontSize->14] }, Open ]], Cell[CellGroupData[{ Cell[StyleData["Subsection"], CellDingbat->"\[FilledSquare]", CellMargins->{{18, 30}, {4, 20}}, CellGroupingRules->{"SectionGrouping", 50}, PageBreakBelow->False, CounterIncrements->"Subsection", CounterAssignments->{{"Subsubsection", 0}}, FontSize->14, FontWeight->"Bold", Background->RGBColor[0.970001, 0.890013, 0.850004]], Cell[StyleData["Subsection", "Printout"], FontSize->12] }, Closed]], Cell[CellGroupData[{ Cell[StyleData["Subsubsection"], CellDingbat->"\[FilledSmallSquare]", CellMargins->{{18, 30}, {4, 12}}, CellGroupingRules->{"SectionGrouping", 60}, PageBreakBelow->False, CounterIncrements->"Subsubsection", FontSize->12, FontWeight->"Bold", Background->RGBColor[0.870008, 1, 0.960006]], Cell[StyleData["Subsubsection", "Printout"], FontSize->10] }, Closed]] }, Open ]], Cell[CellGroupData[{ Cell["Styles for Body Text", "Section"], Cell[CellGroupData[{ Cell[StyleData["Text"], CellMargins->{{18, 10}, {Inherited, 6}}, TextJustification->1, LineSpacing->{1, 2}, CounterIncrements->"Text", Background->RGBColor[0.900008, 1, 0.940002]], Cell[StyleData["Text", "Printout"], CellMargins->{{18, 30}, {Inherited, 4}}, LineSpacing->{1, 3}, FontSize->10] }, Closed]], Cell[CellGroupData[{ Cell[StyleData["Caption"], CellMargins->{{55, 50}, {5, 5}}, PageBreakAbove->False, FontSize->10], Cell[StyleData["Caption", "Printout"], CellMargins->{{55, 55}, {5, 2}}, FontSize->8] }, Closed]] }, Closed]], Cell[CellGroupData[{ Cell["Styles for Input/Output", "Section"], Cell["\<\ The cells in this section define styles used for input and output \ to the kernel. Be careful when modifying, renaming, or removing these \ styles, because the front end associates special meanings with these style \ names.\ \>", "Text"], Cell[CellGroupData[{ Cell[StyleData["Input"], CellMargins->{{55, 10}, {5, 8}}, Evaluatable->True, CellGroupingRules->"InputGrouping", CellHorizontalScrolling->True, PageBreakWithin->False, GroupPageBreakWithin->False, CellLabelMargins->{{26, Inherited}, {Inherited, Inherited}}, DefaultFormatType->DefaultInputFormatType, AutoItalicWords->{}, FormatType->InputForm, ShowStringCharacters->True, NumberMarks->True, CounterIncrements->"Input", FontSize->12, FontWeight->"Bold"], Cell[StyleData["Input", "Printout"], CellMargins->{{55, 55}, {0, 10}}, ShowCellLabel->False, FontSize->9.5] }, Closed]], Cell[CellGroupData[{ Cell[StyleData["Output"], CellMargins->{{55, 10}, {8, 5}}, CellEditDuplicate->True, CellGroupingRules->"OutputGrouping", CellHorizontalScrolling->True, PageBreakWithin->False, GroupPageBreakWithin->False, GeneratedCell->True, CellAutoOverwrite->True, CellLabelPositioning->Left, CellLabelMargins->{{26, Inherited}, {Inherited, Inherited}}, DefaultFormatType->DefaultOutputFormatType, AutoItalicWords->{}, FormatType->InputForm, CounterIncrements->"Output", Background->RGBColor[0.940017, 0.890013, 0.990005]], Cell[StyleData["Output", "Printout"], CellMargins->{{55, 55}, {10, 10}}, ShowCellLabel->False, FontSize->9.5] }, Open ]], Cell[CellGroupData[{ Cell[StyleData["Message"], CellDingbat->"\[LongDash]", CellMargins->{{55, Inherited}, {Inherited, Inherited}}, CellGroupingRules->"OutputGrouping", PageBreakWithin->False, GroupPageBreakWithin->False, GeneratedCell->True, CellAutoOverwrite->True, ShowCellLabel->False, CellLabelMargins->{{26, Inherited}, {Inherited, Inherited}}, DefaultFormatType->DefaultOutputFormatType, AutoItalicWords->{}, FormatType->InputForm, CounterIncrements->"Message", StyleMenuListing->None, FontSize->10, FontSlant->"Italic"], Cell[StyleData["Message", "Printout"], CellMargins->{{55, 55}, {0, 3}}, FontSize->8] }, Closed]], Cell[CellGroupData[{ Cell[StyleData["Print"], CellMargins->{{55, Inherited}, {Inherited, Inherited}}, CellGroupingRules->"OutputGrouping", CellHorizontalScrolling->True, PageBreakWithin->False, GroupPageBreakWithin->False, GeneratedCell->True, CellAutoOverwrite->True, ShowCellLabel->False, CellLabelMargins->{{26, Inherited}, {Inherited, Inherited}}, DefaultFormatType->DefaultOutputFormatType, TextAlignment->Left, AutoItalicWords->{}, FormatType->InputForm, CounterIncrements->"Print", StyleMenuListing->None], Cell[StyleData["Print", "Printout"], CellMargins->{{54, 72}, {2, 10}}, FontSize->8] }, Closed]], Cell[CellGroupData[{ Cell[StyleData["Graphics"], CellMargins->{{55, Inherited}, {Inherited, Inherited}}, CellGroupingRules->"GraphicsGrouping", CellHorizontalScrolling->True, PageBreakWithin->False, GeneratedCell->True, CellAutoOverwrite->True, ShowCellLabel->False, DefaultFormatType->DefaultOutputFormatType, FormatType->InputForm, CounterIncrements->"Graphics", StyleMenuListing->None, Background->RGBColor[0.780011, 0.920012, 1], ButtonBoxOptions->{Background->RGBColor[0.750011, 0.630014, 0.760021]}], Cell[StyleData["Graphics", "Printout"], CellMargins->{{55, 55}, {0, 15}}, ImageSize->{0.0625, 0.0625}, ImageMargins->{{35, Inherited}, {Inherited, 0}}, FontSize->8] }, Open ]], Cell[CellGroupData[{ Cell[StyleData["CellLabel"], CellMargins->{{9, Inherited}, {Inherited, Inherited}}, StyleMenuListing->None, FontFamily->"Helvetica", FontSize->9, FontSlant->"Oblique"], Cell[StyleData["CellLabel", "Printout"], CellMargins->{{0, Inherited}, {Inherited, Inherited}}, FontSize->8] }, Closed]] }, Open ]], Cell[CellGroupData[{ Cell["Unique Styles", "Section"], Cell[CellGroupData[{ Cell[StyleData["Author"], CellMargins->{{45, Inherited}, {2, 20}}, CellGroupingRules->{"TitleGrouping", 20}, PageBreakBelow->False, CounterAssignments->{{"Section", 0}, {"Equation", 0}, {"Figure", 0}}, FontSize->14, FontWeight->"Bold"], Cell[StyleData["Author", "Printout"], CellMargins->{{36, Inherited}, {2, 30}}, FontSize->12] }, Closed]], Cell[CellGroupData[{ Cell[StyleData["Address"], CellMargins->{{45, Inherited}, {2, 2}}, CellGroupingRules->{"TitleGrouping", 30}, PageBreakBelow->False, LineSpacing->{1, 1}, CounterAssignments->{{"Section", 0}, {"Equation", 0}, {"Figure", 0}}, FontSize->12, FontSlant->"Italic"], Cell[StyleData["Address", "Printout"], CellMargins->{{36, Inherited}, {2, 2}}, FontSize->10] }, Closed]], Cell[CellGroupData[{ Cell[StyleData["Abstract"], CellMargins->{{45, 75}, {Inherited, 30}}, LineSpacing->{1, 0}], Cell[StyleData["Abstract", "Printout"], CellMargins->{{36, 67}, {Inherited, 50}}, FontSize->10] }, Closed]], Cell[CellGroupData[{ Cell[StyleData["Reference"], CellMargins->{{18, 40}, {2, 2}}, TextJustification->1, LineSpacing->{1, 0}], Cell[StyleData["Reference", "Printout"], CellMargins->{{18, 40}, {Inherited, 0}}, FontSize->8] }, Closed]] }, Closed]], Cell[CellGroupData[{ Cell["Styles for Automatic Numbering", "Section"], Cell["\<\ The following styles are useful for numbered equations, figures, \ etc. They automatically give the cell a FrameLabel containing a reference to \ a particular counter, and also increment that counter.\ \>", "Text"], Cell[CellGroupData[{ Cell[StyleData["NumberedEquation"], CellMargins->{{55, 10}, {0, 10}}, CellFrameLabels->{{None, Cell[ TextData[ {"(", CounterBox[ "NumberedEquation"], ")"}]]}, {None, None}}, DefaultFormatType->DefaultInputFormatType, CounterIncrements->"NumberedEquation", FormatTypeAutoConvert->False], Cell[StyleData["NumberedEquation", "Printout"], CellMargins->{{55, 55}, {0, 10}}, FontSize->10] }, Closed]], Cell[CellGroupData[{ Cell[StyleData["NumberedFigure"], CellMargins->{{55, 145}, {2, 10}}, CellHorizontalScrolling->True, CellFrameLabels->{{None, None}, {Cell[ TextData[ {"Figure ", CounterBox[ "NumberedFigure"]}], FontWeight -> "Bold"], None}}, CounterIncrements->"NumberedFigure", FormatTypeAutoConvert->False], Cell[StyleData["NumberedFigure", "Printout"], FontSize->10] }, Closed]], Cell[CellGroupData[{ Cell[StyleData["NumberedTable"], CellMargins->{{55, 145}, {2, 10}}, CellFrameLabels->{{None, None}, {Cell[ TextData[ {"Table ", CounterBox[ "NumberedTable"]}], FontWeight -> "Bold"], None}}, TextAlignment->Center, CounterIncrements->"NumberedTable", FormatTypeAutoConvert->False], Cell[StyleData["NumberedTable", "Printout"], CellMargins->{{18, Inherited}, {Inherited, Inherited}}, FontSize->10] }, Closed]] }, Closed]], Cell[CellGroupData[{ Cell["Formulas and Programming", "Section"], Cell[CellGroupData[{ Cell[StyleData["DisplayFormula"], CellMargins->{{55, 10}, {2, 10}}, CellHorizontalScrolling->True, DefaultFormatType->DefaultInputFormatType, ScriptLevel->0, SingleLetterItalics->True, UnderoverscriptBoxOptions->{LimitsPositioning->True}], Cell[StyleData["DisplayFormula", "Printout"], FontSize->10] }, Closed]], Cell[CellGroupData[{ Cell[StyleData["ChemicalFormula"], CellMargins->{{55, 10}, {2, 10}}, DefaultFormatType->DefaultInputFormatType, AutoSpacing->False, ScriptLevel->1, ScriptBaselineShifts->{0.6, Automatic}, SingleLetterItalics->False, ZeroWidthTimes->True], Cell[StyleData["ChemicalFormula", "Printout"], FontSize->10] }, Closed]], Cell[CellGroupData[{ Cell[StyleData["Program"], CellMargins->{{18, 10}, {Inherited, 6}}, FontFamily->"Courier"], Cell[StyleData["Program", "Printout"], CellMargins->{{18, 30}, {Inherited, 4}}, FontSize->9.5] }, Closed]] }, Closed]] }, Open ]] }], MacintoshSystemPageSetup->"\<\ 00<0004/0B`000002n88o?moogl" ] (*********************************************************************** 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, 37, 0, 78, "Title"], Cell[1757, 51, 727, 15, 280, "Text"], Cell[2487, 68, 553, 18, 91, "Section", Evaluatable->False], Cell[3043, 88, 242, 6, 56, "Text"], Cell[CellGroupData[{ Cell[3310, 98, 129, 3, 96, "Section", Evaluatable->False], Cell[3442, 103, 401, 7, 68, "Text", Evaluatable->False], Cell[CellGroupData[{ Cell[3868, 114, 184, 6, 58, "Subsection", Evaluatable->False], Cell[4055, 122, 379, 9, 70, "Text", Evaluatable->False], Cell[CellGroupData[{ Cell[4459, 135, 121, 3, 28, "Input"], Cell[4583, 140, 257, 8, 58, "Output"] }, Open ]], Cell[4855, 151, 812, 17, 154, "Text", Evaluatable->False], Cell[CellGroupData[{ Cell[5692, 172, 95, 3, 28, "Input"], Cell[5790, 177, 256, 8, 59, "Output"] }, Open ]], Cell[6061, 188, 286, 5, 38, "Text", Evaluatable->False], Cell[CellGroupData[{ Cell[6372, 197, 129, 3, 28, "Input"], Cell[6504, 202, 76, 2, 27, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[6617, 209, 129, 3, 28, "Input"], Cell[6749, 214, 76, 2, 27, "Output"] }, Open ]], Cell[6840, 219, 238, 7, 26, "Text", Evaluatable->False], Cell[CellGroupData[{ Cell[7103, 230, 119, 3, 43, "Input"], Cell[7225, 235, 266, 8, 77, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[7528, 248, 119, 3, 43, "Input"], Cell[7650, 253, 274, 8, 77, "Output"] }, Open ]], Cell[7939, 264, 264, 6, 38, "Text", Evaluatable->False], Cell[8206, 272, 236, 6, 38, "Text", Evaluatable->False], Cell[CellGroupData[{ Cell[8467, 282, 70, 2, 28, "Input"], Cell[8540, 286, 256, 8, 59, "Output"] }, Open ]], Cell[8811, 297, 158, 7, 26, "Text", Evaluatable->False], Cell[8972, 306, 220, 5, 38, "Text", Evaluatable->False], Cell[9195, 313, 302, 7, 44, "Input"], Cell[CellGroupData[{ Cell[9522, 324, 64, 2, 28, "Input"], Cell[9589, 328, 262, 8, 59, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[9888, 341, 74, 2, 28, "Input"], Cell[9965, 345, 263, 8, 59, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[10265, 358, 60, 2, 28, "Input"], Cell[10328, 362, 263, 8, 59, "Output"] }, Open ]], Cell[10606, 373, 156, 5, 24, "Text", Evaluatable->False], Cell[CellGroupData[{ Cell[10787, 382, 87, 2, 28, "Input"], Cell[10877, 386, 242, 8, 59, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[11156, 399, 112, 3, 28, "Input"], Cell[11271, 404, 249, 6, 21, "Message"], Cell[11523, 412, 249, 6, 21, "Message"], Cell[11775, 420, 249, 6, 21, "Message"], Cell[12027, 428, 259, 6, 21, "Message"], Cell[12289, 436, 144, 4, 27, "Output"] }, Open ]], Cell[12448, 443, 168, 7, 26, "Text", Evaluatable->False] }, Open ]], Cell[CellGroupData[{ Cell[12653, 455, 36, 0, 42, "Subsection"], Cell[12692, 457, 2462, 85, 400, "Text", Evaluatable->False], Cell[CellGroupData[{ Cell[15179, 546, 154, 5, 48, "Subsubsection"], Cell[CellGroupData[{ Cell[15358, 555, 38, 0, 32, "Subsubsection"], Cell[15399, 557, 318, 10, 52, "Text"], Cell[CellGroupData[{ Cell[15742, 571, 165, 4, 44, "Input"], Cell[15910, 577, 1550, 29, 117, "Output"] }, Open ]], Cell[17475, 609, 211, 4, 38, "Text"], Cell[17689, 615, 183, 4, 38, "Text"], Cell[CellGroupData[{ Cell[17897, 623, 112, 2, 28, "Input"], Cell[18012, 627, 230, 5, 27, "Output"] }, Open ]], Cell[18257, 635, 189, 4, 38, "Text"], Cell[18449, 641, 41, 0, 24, "Text"], Cell[CellGroupData[{ Cell[18515, 645, 87, 2, 28, "Input"], Cell[18605, 649, 291, 6, 21, "Message"], Cell[18899, 657, 548, 11, 42, "Output"] }, Open ]], Cell[19462, 671, 280, 5, 52, "Text"], Cell[CellGroupData[{ Cell[19767, 680, 91, 2, 28, "Input"], Cell[19861, 684, 301, 7, 21, "Message"], Cell[20165, 693, 1550, 29, 117, "Output"] }, Open ]], Cell[21730, 725, 196, 3, 38, "Text"], Cell[CellGroupData[{ Cell[21951, 732, 134, 3, 24, "Text"], Cell[22088, 737, 651, 10, 444, "Input"] }, Open ]], Cell[22754, 750, 194, 4, 38, "Text"], Cell[CellGroupData[{ Cell[22973, 758, 194, 5, 44, "Input"], Cell[23170, 765, 1024, 16, 87, "Output"] }, Open ]], Cell[24209, 784, 168, 4, 38, "Text"], Cell[CellGroupData[{ Cell[24402, 792, 89, 2, 28, "Input"], Cell[24494, 796, 218, 5, 27, "Output"] }, Open ]], Cell[24727, 804, 62, 0, 24, "Text"], Cell[CellGroupData[{ Cell[24814, 808, 111, 2, 28, "Input"], Cell[24928, 812, 291, 6, 21, "Message"], Cell[25222, 820, 218, 5, 27, "Output"] }, Open ]], Cell[25455, 828, 26, 0, 24, "Text"], Cell[CellGroupData[{ Cell[25506, 832, 78, 2, 28, "Input"], Cell[25587, 836, 85, 2, 27, "Output"] }, Open ]], Cell[25687, 841, 106, 3, 24, "Text"], Cell[CellGroupData[{ Cell[25818, 848, 128, 3, 28, "Input"], Cell[25949, 853, 263, 7, 59, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[26249, 865, 74, 2, 28, "Input"], Cell[26326, 869, 285, 6, 27, "Output"] }, Open ]], Cell[26626, 878, 139, 3, 24, "Text"], Cell[CellGroupData[{ Cell[26790, 885, 106, 2, 28, "Input"], Cell[26899, 889, 218, 5, 27, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[27154, 899, 70, 2, 28, "Input"], Cell[27227, 903, 85, 2, 27, "Output"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell[27361, 911, 174, 7, 32, "Subsubsection"], Cell[27538, 920, 32, 0, 24, "Text"], Cell[CellGroupData[{ Cell[27595, 924, 84, 2, 28, "Input"], Cell[27682, 928, 144, 4, 27, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[27863, 937, 101, 2, 28, "Input"], Cell[27967, 941, 144, 4, 27, "Output"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell[28160, 951, 200, 7, 32, "Subsubsection"], Cell[28363, 960, 60, 0, 24, "Text"], Cell[CellGroupData[{ Cell[28448, 964, 105, 2, 28, "Input"], Cell[28556, 968, 315, 6, 42, "Output"] }, Open ]], Cell[28886, 977, 92, 3, 24, "Text"], Cell[CellGroupData[{ Cell[29003, 984, 71, 2, 28, "Input"], Cell[29077, 988, 1243, 45, 59, "Output"] }, Open ]], Cell[30335, 1036, 95, 3, 24, "Text"], Cell[CellGroupData[{ Cell[30455, 1043, 92, 2, 28, "Input"], Cell[30550, 1047, 157, 4, 27, "Output"] }, Open ]], Cell[30722, 1054, 51, 0, 24, "Text"], Cell[CellGroupData[{ Cell[30798, 1058, 83, 2, 28, "Input"], Cell[30884, 1062, 315, 6, 42, "Output"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell[31248, 1074, 217, 8, 32, "Subsubsection"], Cell[31468, 1084, 41, 0, 24, "Text"], Cell[CellGroupData[{ Cell[31534, 1088, 106, 2, 28, "Input"], Cell[31643, 1092, 349, 7, 42, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[32029, 1104, 100, 2, 28, "Input"], Cell[32132, 1108, 312, 7, 21, "Message"], Cell[32447, 1117, 166, 4, 27, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[32650, 1126, 79, 2, 28, "Input"], Cell[32732, 1130, 349, 7, 42, "Output"] }, Open ]] }, Open ]] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell[33154, 1145, 84, 2, 42, "Subsection", Evaluatable->False], Cell[33241, 1149, 200, 7, 52, "Text", Evaluatable->False], Cell[33444, 1158, 175, 4, 28, "Input"], Cell[33622, 1164, 107, 2, 24, "Text", Evaluatable->False], Cell[CellGroupData[{ Cell[33754, 1170, 96, 3, 28, "Input"], Cell[33853, 1175, 362, 7, 59, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[34252, 1187, 96, 3, 28, "Input"], Cell[34351, 1192, 362, 7, 59, "Output"] }, Open ]], Cell[34728, 1202, 152, 4, 24, "Text", Evaluatable->False], Cell[34883, 1208, 175, 5, 24, "Text", Evaluatable->False], Cell[35061, 1215, 136, 3, 44, "Input"], Cell[35200, 1220, 265, 10, 32, "Text", Evaluatable->False], Cell[CellGroupData[{ Cell[35490, 1234, 91, 3, 28, "Input"], Cell[35584, 1239, 112, 2, 27, "Output"] }, Open ]], Cell[35711, 1244, 265, 10, 32, "Text", Evaluatable->False], Cell[CellGroupData[{ Cell[36001, 1258, 91, 3, 28, "Input"], Cell[36095, 1263, 112, 2, 27, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[36244, 1270, 69, 2, 28, "Input"], Cell[36316, 1274, 112, 2, 27, "Output"] }, Open ]], Cell[36443, 1279, 471, 14, 46, "Text", Evaluatable->False], Cell[CellGroupData[{ Cell[36939, 1297, 67, 2, 28, "Input"], Cell[37009, 1301, 112, 2, 27, "Output"] }, Open ]], Cell[37136, 1306, 53, 0, 24, "Text"], Cell[CellGroupData[{ Cell[37214, 1310, 90, 3, 28, "Input"], Cell[37307, 1315, 112, 2, 27, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[37456, 1322, 90, 3, 28, "Input"], Cell[37549, 1327, 112, 2, 27, "Output"] }, Open ]], Cell[37676, 1332, 186, 5, 24, "Text", Evaluatable->False], Cell[37865, 1339, 426, 12, 60, "Text", Evaluatable->False], Cell[38294, 1353, 175, 4, 28, "Input"], Cell[CellGroupData[{ Cell[38494, 1361, 91, 3, 28, "Input"], Cell[38588, 1366, 695, 13, 62, "Output"] }, Open ]], Cell[39298, 1382, 283, 10, 32, "Text", Evaluatable->False], Cell[CellGroupData[{ Cell[39606, 1396, 91, 3, 28, "Input"], Cell[39700, 1401, 695, 13, 62, "Output"] }, Open ]], Cell[40410, 1417, 111, 2, 24, "Text", Evaluatable->False], Cell[CellGroupData[{ Cell[40546, 1423, 90, 3, 28, "Input"], Cell[40639, 1428, 335, 7, 62, "Output"] }, Open ]], Cell[40989, 1438, 158, 5, 24, "Text", Evaluatable->False], Cell[CellGroupData[{ Cell[41172, 1447, 91, 3, 28, "Input"], Cell[41266, 1452, 218, 5, 27, "Output"] }, Open ]], Cell[41499, 1460, 341, 13, 26, "Text"], Cell[CellGroupData[{ Cell[41865, 1477, 65, 2, 28, "Input"], Cell[41933, 1481, 218, 5, 27, "Output"] }, Open ]], Cell[42166, 1489, 162, 5, 24, "Text", Evaluatable->False] }, Open ]], Cell[CellGroupData[{ Cell[42365, 1499, 84, 2, 42, "Subsection", Evaluatable->False], Cell[42452, 1503, 253, 6, 38, "Text", Evaluatable->False], Cell[CellGroupData[{ Cell[42730, 1513, 122, 3, 28, "Input"], Cell[42855, 1518, 257, 8, 59, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[43149, 1531, 91, 3, 28, "Input"], Cell[43243, 1536, 272, 7, 59, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[43552, 1548, 91, 3, 28, "Input"], Cell[43646, 1553, 272, 7, 59, "Output"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell[43967, 1566, 96, 2, 42, "Subsection", Evaluatable->False], Cell[44066, 1570, 362, 9, 66, "Text", Evaluatable->False], Cell[44431, 1581, 101, 3, 28, "Input"], Cell[CellGroupData[{ Cell[44557, 1588, 90, 3, 28, "Input"], Cell[44650, 1593, 78, 2, 27, "Output"] }, Open ]], Cell[44743, 1598, 95, 2, 24, "Text", Evaluatable->False], Cell[44841, 1602, 126, 3, 28, "Input"], Cell[CellGroupData[{ Cell[44992, 1609, 90, 3, 28, "Input"], Cell[45085, 1614, 102, 2, 27, "Output"] }, Open ]], Cell[45202, 1619, 94, 2, 24, "Text", Evaluatable->False], Cell[CellGroupData[{ Cell[45321, 1625, 91, 3, 28, "Input"], Cell[45415, 1630, 225, 5, 27, "Output"] }, Open ]], Cell[45655, 1638, 118, 2, 24, "Text", Evaluatable->False], Cell[45776, 1642, 708, 13, 194, "Text", Evaluatable->False], Cell[46487, 1657, 183, 7, 26, "Text", Evaluatable->False], Cell[CellGroupData[{ Cell[46695, 1668, 85, 3, 28, "Input"], Cell[46783, 1673, 202, 6, 42, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[47022, 1684, 96, 3, 28, "Input"], Cell[47121, 1689, 202, 6, 42, "Output"] }, Open ]], Cell[47338, 1698, 368, 9, 40, "Text", Evaluatable->False], Cell[47709, 1709, 272, 7, 44, "Input"], Cell[47984, 1718, 113, 2, 24, "Text", Evaluatable->False], Cell[CellGroupData[{ Cell[48122, 1724, 103, 3, 28, "Input"], Cell[48228, 1729, 203, 6, 42, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[48468, 1740, 103, 3, 28, "Input"], Cell[48574, 1745, 560, 13, 59, "Output"] }, Open ]], Cell[49149, 1761, 114, 2, 24, "Text", Evaluatable->False], Cell[49266, 1765, 280, 6, 51, "Input"], Cell[CellGroupData[{ Cell[49571, 1775, 96, 3, 28, "Input"], Cell[49670, 1780, 205, 6, 42, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[49912, 1791, 96, 3, 28, "Input"], Cell[50011, 1796, 560, 13, 59, "Output"] }, Open ]], Cell[50586, 1812, 175, 5, 24, "Text", Evaluatable->False], Cell[CellGroupData[{ Cell[50786, 1821, 269, 7, 53, "Input"], Cell[51058, 1830, 287, 6, 21, "Message"] }, Open ]], Cell[CellGroupData[{ Cell[51382, 1841, 91, 3, 28, "Input"], Cell[51476, 1846, 221, 5, 27, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[51734, 1856, 249, 6, 53, "Input"], Cell[51986, 1864, 221, 5, 27, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[52244, 1874, 75, 2, 28, "Input"], Cell[52322, 1878, 77, 2, 27, "Output"] }, Open ]], Cell[52414, 1883, 115, 2, 24, "Text", Evaluatable->False], Cell[CellGroupData[{ Cell[52554, 1889, 109, 3, 28, "Input"], Cell[52666, 1894, 77, 2, 27, "Output"] }, Open ]], Cell[52758, 1899, 121, 2, 24, "Text", Evaluatable->False], Cell[CellGroupData[{ Cell[52904, 1905, 149, 4, 28, "Input"], Cell[53056, 1911, 307, 9, 76, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[53400, 1925, 91, 3, 28, "Input"], Cell[53494, 1930, 80, 2, 27, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[53611, 1937, 91, 3, 28, "Input"], Cell[53705, 1942, 80, 2, 27, "Output"] }, Open ]], Cell[53800, 1947, 338, 6, 66, "Text", Evaluatable->False], Cell[CellGroupData[{ Cell[54163, 1957, 90, 3, 28, "Input"], Cell[54256, 1962, 77, 2, 27, "Output"] }, Open ]], Cell[54348, 1967, 88, 2, 24, "Text", Evaluatable->False], Cell[CellGroupData[{ Cell[54461, 1973, 247, 6, 53, "Input"], Cell[54711, 1981, 77, 2, 27, "Output"] }, Open ]], Cell[54803, 1986, 89, 2, 24, "Text", Evaluatable->False], Cell[CellGroupData[{ Cell[54917, 1992, 247, 6, 53, "Input"], Cell[55167, 2000, 77, 2, 27, "Output"] }, Open ]], Cell[55259, 2005, 88, 2, 24, "Text", Evaluatable->False], Cell[CellGroupData[{ Cell[55372, 2011, 247, 6, 53, "Input"], Cell[55622, 2019, 77, 2, 27, "Output"] }, Open ]], Cell[55714, 2024, 98, 2, 24, "Text", Evaluatable->False] }, Open ]], Cell[CellGroupData[{ Cell[55849, 2031, 74, 2, 42, "Subsection", Evaluatable->False], Cell[55926, 2035, 311, 6, 66, "Text", Evaluatable->False] }, Open ]], Cell[CellGroupData[{ Cell[56274, 2046, 90, 2, 42, "Subsection", Evaluatable->False], Cell[56367, 2050, 774, 32, 94, "Text", Evaluatable->False], Cell[57144, 2084, 136, 3, 44, "Input"], Cell[57283, 2089, 109, 2, 24, "Text", Evaluatable->False], Cell[CellGroupData[{ Cell[57417, 2095, 96, 3, 28, "Input"], Cell[57516, 2100, 239, 5, 27, "Output"] }, Open ]], Cell[57770, 2108, 122, 2, 24, "Text", Evaluatable->False] }, Open ]], Cell[CellGroupData[{ Cell[57929, 2115, 84, 2, 42, "Subsection", Evaluatable->False], Cell[58016, 2119, 818, 31, 88, "Text", Evaluatable->False], Cell[CellGroupData[{ Cell[58859, 2154, 100, 3, 28, "Input"], Cell[58962, 2159, 7994, 142, 197, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[66993, 2306, 95, 3, 28, "Input"], Cell[67091, 2311, 257, 8, 59, "Output"] }, Open ]], Cell[67363, 2322, 140, 3, 24, "Text", Evaluatable->False], Cell[CellGroupData[{ Cell[67528, 2329, 114, 3, 28, "Input"], Cell[67645, 2334, 2731, 53, 207, "Output"] }, Open ]], Cell[70391, 2390, 109, 2, 24, "Text", Evaluatable->False], Cell[70503, 2394, 103, 3, 28, "Input"], Cell[CellGroupData[{ Cell[70631, 2401, 94, 3, 28, "Input"], Cell[70728, 2406, 314, 8, 86, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[71079, 2419, 98, 3, 28, "Input"], Cell[71180, 2424, 257, 8, 59, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[71474, 2437, 98, 3, 28, "Input"], Cell[71575, 2442, 104, 2, 43, "Output"] }, Open ]], Cell[71694, 2447, 113, 2, 24, "Text", Evaluatable->False], Cell[CellGroupData[{ Cell[71832, 2453, 101, 3, 28, "Input"], Cell[71936, 2458, 104, 2, 43, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[72077, 2465, 137, 3, 28, "Input"], Cell[72217, 2470, 128, 3, 22, "Print"], Cell[72348, 2475, 489, 13, 52, "Print"] }, Open ]], Cell[72852, 2491, 181, 7, 26, "Text", Evaluatable->False], Cell[73036, 2500, 213, 6, 38, "Text", Evaluatable->False], Cell[73252, 2508, 100, 2, 24, "Text", Evaluatable->False], Cell[CellGroupData[{ Cell[73377, 2514, 136, 3, 28, "Input"], Cell[73516, 2519, 215, 6, 42, "Output"] }, Open ]], Cell[73746, 2528, 98, 3, 24, "Text"], Cell[CellGroupData[{ Cell[73869, 2535, 100, 3, 28, "Input"], Cell[73972, 2540, 345, 8, 42, "Output"] }, Open ]], Cell[74332, 2551, 37, 0, 24, "Text"], Cell[CellGroupData[{ Cell[74394, 2555, 141, 4, 28, "Input"], Cell[74538, 2561, 358, 7, 78, "Output"] }, Open ]], Cell[74911, 2571, 109, 2, 24, "Text", Evaluatable->False], Cell[CellGroupData[{ Cell[75045, 2577, 95, 3, 28, "Input"], Cell[75143, 2582, 375, 8, 64, "Output"] }, Open ]], Cell[75533, 2593, 166, 4, 24, "Text", Evaluatable->False], Cell[75702, 2599, 128, 3, 28, "Input"], Cell[CellGroupData[{ Cell[75855, 2606, 119, 3, 28, "Input"], Cell[75977, 2611, 218, 7, 42, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[76232, 2623, 117, 3, 28, "Input"], Cell[76352, 2628, 257, 8, 59, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[76646, 2641, 119, 3, 28, "Input"], Cell[76768, 2646, 306, 9, 76, "Output"] }, Open ]], Cell[77089, 2658, 166, 5, 24, "Text", Evaluatable->False] }, Open ]], Cell[CellGroupData[{ Cell[77292, 2668, 85, 2, 42, "Subsection", Evaluatable->False], Cell[77380, 2672, 471, 8, 66, "Text"] }, Open ]], Cell[CellGroupData[{ Cell[77888, 2685, 124, 3, 42, "Subsection", Evaluatable->False, PageBreakAbove->True], Cell[CellGroupData[{ Cell[78037, 2692, 581, 15, 126, "Text", Evaluatable->False], Cell[CellGroupData[{ Cell[78643, 2711, 121, 3, 28, "Input"], Cell[78767, 2716, 257, 8, 59, "Output"] }, Open ]], Cell[79039, 2727, 172, 4, 24, "Text", Evaluatable->False], Cell[79214, 2733, 106, 3, 28, "Input"], Cell[79323, 2738, 222, 5, 38, "Text", Evaluatable->False], Cell[CellGroupData[{ Cell[79570, 2747, 131, 3, 28, "Input"], Cell[79704, 2752, 245, 7, 59, "Output"] }, Open ]], Cell[79964, 2762, 116, 2, 24, "Text", Evaluatable->False], Cell[CellGroupData[{ Cell[80105, 2768, 128, 3, 28, "Input"], Cell[80236, 2773, 94, 2, 27, "Output"] }, Open ]], Cell[80345, 2778, 113, 3, 24, "Text"], Cell[CellGroupData[{ Cell[80483, 2785, 259, 6, 28, "Input"], Cell[80745, 2793, 109, 2, 27, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[80891, 2800, 199, 5, 28, "Input"], Cell[81093, 2807, 95, 2, 27, "Output"] }, Open ]], Cell[81203, 2812, 103, 3, 24, "Text"], Cell[CellGroupData[{ Cell[81331, 2819, 163, 4, 28, "Input"], Cell[81497, 2825, 264, 7, 59, "Output"] }, Open ]], Cell[81776, 2835, 102, 3, 24, "Text"], Cell[CellGroupData[{ Cell[81903, 2842, 351, 7, 45, "Input"], Cell[82257, 2851, 137, 3, 43, "Output"] }, Open ]], Cell[82409, 2857, 136, 3, 24, "Text"], Cell[CellGroupData[{ Cell[82570, 2864, 264, 5, 45, "Input"], Cell[82837, 2871, 335, 8, 77, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[83209, 2884, 143, 4, 24, "Text", Evaluatable->False], Cell[83355, 2890, 77, 2, 24, "Text", Evaluatable->False], Cell[CellGroupData[{ Cell[83457, 2896, 167, 5, 28, "Input"], Cell[83627, 2903, 111, 2, 43, "Output"] }, Open ]], Cell[83753, 2908, 77, 2, 24, "Text", Evaluatable->False], Cell[CellGroupData[{ Cell[83855, 2914, 258, 7, 28, "Input"], Cell[84116, 2923, 121, 3, 43, "Output"] }, Open ]], Cell[84252, 2929, 77, 2, 24, "Text", Evaluatable->False], Cell[CellGroupData[{ Cell[84354, 2935, 332, 8, 28, "Input"], Cell[84689, 2945, 99, 2, 43, "Output"] }, Open ]] }, Open ]], Cell[84815, 2951, 66, 0, 24, "Text"], Cell[CellGroupData[{ Cell[84906, 2955, 102, 3, 28, "Input"], Cell[85011, 2960, 190, 4, 43, "Output"] }, Open ]] }, Open ]], Cell[85228, 2968, 90, 2, 24, "Text", Evaluatable->False], Cell[CellGroupData[{ Cell[85343, 2974, 127, 2, 52, "Text", Evaluatable->False], Cell[85473, 2978, 131, 3, 28, "Input"], Cell[85607, 2983, 105, 3, 28, "Input"], Cell[85715, 2988, 101, 2, 24, "Text", Evaluatable->False], Cell[CellGroupData[{ Cell[85841, 2994, 132, 3, 28, "Input"], Cell[85976, 2999, 286, 8, 59, "Output"] }, Open ]], Cell[86277, 3010, 117, 2, 24, "Text", Evaluatable->False], Cell[CellGroupData[{ Cell[86419, 3016, 129, 3, 28, "Input"], Cell[86551, 3021, 95, 2, 27, "Output"], Cell[CellGroupData[{ Cell[86671, 3027, 327, 7, 45, "Input"], Cell[87001, 3036, 110, 2, 43, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[87148, 3043, 327, 7, 45, "Input"], Cell[87478, 3052, 111, 2, 43, "Output"] }, Open ]], Cell[87604, 3057, 54, 0, 24, "Text"], Cell[CellGroupData[{ Cell[87683, 3061, 228, 6, 45, "Input"], Cell[87914, 3069, 340, 8, 86, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[88291, 3082, 351, 7, 45, "Input"], Cell[88645, 3091, 102, 2, 43, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[88784, 3098, 335, 7, 45, "Input"], Cell[89122, 3107, 319, 8, 86, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[89478, 3120, 143, 4, 24, "Text", Evaluatable->False], Cell[89624, 3126, 77, 2, 24, "Text", Evaluatable->False], Cell[CellGroupData[{ Cell[89726, 3132, 150, 4, 28, "Input"], Cell[89879, 3138, 81, 2, 43, "Output"] }, Open ]], Cell[89975, 3143, 77, 2, 24, "Text", Evaluatable->False], Cell[CellGroupData[{ Cell[90077, 3149, 234, 6, 28, "Input"], Cell[90314, 3157, 92, 2, 43, "Output"] }, Open ]], Cell[90421, 3162, 77, 2, 24, "Text", Evaluatable->False], Cell[CellGroupData[{ Cell[90523, 3168, 306, 7, 28, "Input"], Cell[90832, 3177, 83, 2, 43, "Output"] }, Open ]] }, Open ]] }, Closed]], Cell[90954, 3184, 90, 2, 22, "Text", Evaluatable->False], Cell[CellGroupData[{ Cell[91069, 3190, 102, 3, 28, "Input"], Cell[91174, 3195, 108, 2, 43, "Output"] }, Open ]] }, Open ]], Cell[91309, 3201, 447, 9, 66, "Text", Evaluatable->False] }, Open ]], Cell[CellGroupData[{ Cell[91793, 3215, 86, 2, 42, "Subsection", Evaluatable->False], Cell[91882, 3219, 1696, 28, 364, "Text", Evaluatable->False], Cell[93581, 3249, 139, 5, 24, "Text", Evaluatable->False], Cell[CellGroupData[{ Cell[93745, 3258, 122, 3, 28, "Input"], Cell[93870, 3263, 253, 7, 59, "Output"], Cell[94126, 3272, 46, 0, 24, "Text"], Cell[CellGroupData[{ Cell[94197, 3276, 107, 2, 28, "Input"], Cell[94307, 3280, 235, 7, 59, "Output"] }, Open ]], Cell[94557, 3290, 55, 0, 24, "Text"], Cell[CellGroupData[{ Cell[94637, 3294, 69, 2, 28, "Input"], Cell[94709, 3298, 397, 9, 59, "Output"] }, Open ]] }, Open ]], Cell[95133, 3311, 128, 3, 24, "Text"], Cell[95264, 3316, 112, 3, 24, "Text"], Cell[CellGroupData[{ Cell[95401, 3323, 127, 3, 28, "Input"], Cell[95531, 3328, 110, 2, 27, "Output"], Cell[CellGroupData[{ Cell[95666, 3334, 325, 7, 45, "Input"], Cell[95994, 3343, 99, 2, 27, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[96130, 3350, 325, 7, 45, "Input"], Cell[96458, 3359, 107, 2, 27, "Output"] }, Open ]], Cell[96580, 3364, 104, 3, 24, "Text"], Cell[CellGroupData[{ Cell[96709, 3371, 226, 6, 45, "Input"], Cell[96938, 3379, 275, 7, 59, "Output"] }, Open ]], Cell[97228, 3389, 103, 3, 24, "Text"], Cell[97334, 3394, 59, 0, 24, "Text"], Cell[CellGroupData[{ Cell[97418, 3398, 349, 7, 45, "Input"], Cell[97770, 3407, 88, 2, 27, "Output"] }, Open ]], Cell[97873, 3412, 96, 3, 24, "Text"], Cell[CellGroupData[{ Cell[97994, 3419, 334, 7, 45, "Input"], Cell[98331, 3428, 236, 7, 59, "Output"] }, Open ]] }, Open ]], Cell[98594, 3439, 27, 0, 24, "Text"], Cell[CellGroupData[{ Cell[98646, 3443, 70, 2, 28, "Input"], Cell[98719, 3447, 257, 8, 59, "Output"] }, Open ]], Cell[98991, 3458, 43, 0, 24, "Text"], Cell[99037, 3460, 133, 3, 28, "Input"], Cell[99173, 3465, 103, 3, 28, "Input"], Cell[CellGroupData[{ Cell[99301, 3472, 85, 3, 28, "Input"], Cell[99389, 3477, 264, 8, 59, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[99690, 3490, 127, 3, 28, "Input"], Cell[99820, 3495, 87, 2, 27, "Output"] }, Open ]], Cell[99922, 3500, 162, 6, 26, "Text", Evaluatable->False], Cell[CellGroupData[{ Cell[100109, 3510, 136, 3, 28, "Input"], Cell[100248, 3515, 78, 2, 27, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[100363, 3522, 136, 3, 28, "Input"], Cell[100502, 3527, 77, 2, 27, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[100616, 3534, 136, 3, 28, "Input"], Cell[100755, 3539, 79, 2, 27, "Output"] }, Open ]], Cell[100849, 3544, 106, 2, 24, "Text", Evaluatable->False], Cell[CellGroupData[{ Cell[100980, 3550, 322, 7, 45, "Input"], Cell[101305, 3559, 86, 2, 27, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[101428, 3566, 322, 7, 45, "Input"], Cell[101753, 3575, 113, 2, 43, "Output"] }, Open ]], Cell[101881, 3580, 99, 2, 24, "Text", Evaluatable->False], Cell[CellGroupData[{ Cell[102005, 3586, 222, 5, 45, "Input"], Cell[102230, 3593, 293, 8, 77, "Output"] }, Open ]], Cell[102538, 3604, 102, 2, 24, "Text", Evaluatable->False], Cell[CellGroupData[{ Cell[102665, 3610, 145, 4, 28, "Input"], Cell[102813, 3616, 77, 2, 27, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[102927, 3623, 145, 4, 28, "Input"], Cell[103075, 3629, 92, 2, 43, "Output"] }, Open ]], Cell[103182, 3634, 109, 2, 24, "Text", Evaluatable->False], Cell[CellGroupData[{ Cell[103316, 3640, 350, 7, 45, "Input"], Cell[103669, 3649, 87, 2, 27, "Output"] }, Open ]], Cell[103771, 3654, 110, 2, 24, "Text", Evaluatable->False], Cell[CellGroupData[{ Cell[103906, 3660, 136, 3, 28, "Input"], Cell[104045, 3665, 79, 2, 27, "Output"] }, Open ]], Cell[104139, 3670, 93, 2, 24, "Text", Evaluatable->False], Cell[CellGroupData[{ Cell[104257, 3676, 342, 7, 46, "Input"], Cell[104602, 3685, 273, 8, 77, "Output"] }, Open ]], Cell[104890, 3696, 85, 2, 24, "Text", Evaluatable->False], Cell[CellGroupData[{ Cell[105000, 3702, 133, 3, 28, "Input"], Cell[105136, 3707, 275, 8, 68, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[105448, 3720, 89, 3, 28, "Input"], Cell[105540, 3725, 264, 8, 59, "Output"] }, Open ]], Cell[105819, 3736, 136, 6, 26, "Text", Evaluatable->False], Cell[CellGroupData[{ Cell[105980, 3746, 85, 3, 28, "Input"], Cell[106068, 3751, 264, 8, 59, "Output"] }, Open ]], Cell[106347, 3762, 101, 2, 24, "Text", Evaluatable->False], Cell[CellGroupData[{ Cell[106473, 3768, 85, 3, 28, "Input"], Cell[106561, 3773, 86, 2, 27, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[106684, 3780, 105, 3, 28, "Input"], Cell[106792, 3785, 103, 2, 43, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[106932, 3792, 106, 3, 28, "Input"], Cell[107041, 3797, 119, 3, 43, "Output"] }, Open ]], Cell[107175, 3803, 53, 0, 24, "Text"], Cell[CellGroupData[{ Cell[107253, 3807, 101, 3, 28, "Input"], Cell[107357, 3812, 119, 3, 43, "Output"] }, Open ]], Cell[107491, 3818, 51, 0, 24, "Text"] }, Open ]], Cell[CellGroupData[{ Cell[107579, 3823, 101, 2, 42, "Subsection", Evaluatable->False], Cell[107683, 3827, 1069, 23, 182, "Text", Evaluatable->False], Cell[CellGroupData[{ Cell[108777, 3854, 168, 5, 60, "Input"], Cell[CellGroupData[{ Cell[108970, 3863, 85, 3, 28, "Input"], Cell[109058, 3868, 275, 8, 68, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[109370, 3881, 143, 4, 24, "Text", Evaluatable->False], Cell[109516, 3887, 77, 2, 24, "Text", Evaluatable->False], Cell[CellGroupData[{ Cell[109618, 3893, 200, 5, 45, "Input"], Cell[109821, 3900, 81, 2, 43, "Output"] }, Open ]], Cell[109917, 3905, 77, 2, 24, "Text", Evaluatable->False], Cell[CellGroupData[{ Cell[110019, 3911, 269, 6, 45, "Input"], Cell[110291, 3919, 90, 2, 43, "Output"] }, Open ]], Cell[110396, 3924, 77, 2, 24, "Text", Evaluatable->False], Cell[CellGroupData[{ Cell[110498, 3930, 334, 7, 45, "Input"], Cell[110835, 3939, 94, 2, 43, "Output"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell[110978, 3947, 85, 3, 28, "Input"], Cell[111066, 3952, 273, 8, 77, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[111376, 3965, 93, 3, 28, "Input"], Cell[111472, 3970, 94, 2, 43, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[111603, 3977, 150, 4, 28, "Input"], Cell[111756, 3983, 83, 2, 43, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[111876, 3990, 217, 5, 28, "Input"], Cell[112096, 3997, 92, 2, 43, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[112225, 4004, 94, 3, 28, "Input"], Cell[112322, 4009, 358, 8, 86, "Output"] }, Open ]] }, Open ]], Cell[112707, 4021, 132, 3, 38, "Text", Evaluatable->False], Cell[CellGroupData[{ Cell[112864, 4028, 168, 5, 60, "Input"], Cell[113035, 4035, 90, 2, 24, "Text", Evaluatable->False], Cell[113128, 4039, 128, 3, 28, "Input"], Cell[113259, 4044, 97, 2, 24, "Text", Evaluatable->False], Cell[CellGroupData[{ Cell[113381, 4050, 121, 3, 28, "Input"], Cell[113505, 4055, 257, 8, 59, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[113799, 4068, 85, 3, 28, "Input"], Cell[113887, 4073, 275, 8, 68, "Output"] }, Open ]], Cell[114177, 4084, 230, 8, 26, "Text", Evaluatable->False], Cell[114410, 4094, 1022, 19, 81, "Input"], Cell[115435, 4115, 85, 2, 24, "Text", Evaluatable->False], Cell[CellGroupData[{ Cell[115545, 4121, 85, 3, 28, "Input"], Cell[115633, 4126, 311, 8, 86, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[115981, 4139, 85, 3, 28, "Input"], Cell[116069, 4144, 273, 8, 77, "Output"] }, Open ]], Cell[116357, 4155, 95, 2, 24, "Text", Evaluatable->False], Cell[CellGroupData[{ Cell[116477, 4161, 101, 3, 28, "Input"], Cell[116581, 4166, 358, 8, 86, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[116976, 4179, 85, 3, 28, "Input"], Cell[117064, 4184, 311, 8, 86, "Output"] }, Open ]], Cell[117390, 4195, 99, 2, 24, "Text", Evaluatable->False], Cell[117492, 4199, 130, 3, 28, "Input"], Cell[117625, 4204, 834, 16, 60, "Input"], Cell[CellGroupData[{ Cell[118484, 4224, 88, 3, 28, "Input"], Cell[118575, 4229, 358, 8, 86, "Output"] }, Open ]], Cell[118948, 4240, 116, 2, 24, "Text", Evaluatable->False], Cell[CellGroupData[{ Cell[119089, 4246, 94, 3, 28, "Input"], Cell[119186, 4251, 358, 8, 86, "Output"] }, Open ]] }, Open ]], Cell[119571, 4263, 207, 4, 38, "Text", Evaluatable->False], Cell[119781, 4269, 41, 0, 24, "Text"], Cell[119825, 4271, 130, 3, 28, "Input"], Cell[CellGroupData[{ Cell[119980, 4278, 94, 3, 28, "Input"], Cell[120077, 4283, 413, 11, 77, "Output"] }, Open ]], Cell[120505, 4297, 59, 0, 24, "Text"], Cell[120567, 4299, 167, 5, 60, "Input"], Cell[CellGroupData[{ Cell[120759, 4308, 114, 3, 28, "Input"], Cell[120876, 4313, 125, 3, 43, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[121038, 4321, 115, 3, 28, "Input"], Cell[121156, 4326, 127, 3, 43, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[121320, 4334, 115, 3, 28, "Input"], Cell[121438, 4339, 111, 2, 43, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[121586, 4346, 109, 3, 28, "Input"], Cell[121698, 4351, 358, 8, 86, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[122093, 4364, 112, 3, 28, "Input"], Cell[122208, 4369, 358, 8, 86, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[122603, 4382, 94, 3, 28, "Input"], Cell[122700, 4387, 358, 8, 86, "Output"] }, Open ]], Cell[123073, 4398, 91, 2, 24, "Text", Evaluatable->False] }, Open ]] }, Open ]] } ] *) (*********************************************************************** End of Mathematica Notebook file. ***********************************************************************)