(************** Content-type: application/mathematica **************
Mathematica-Compatible Notebook
This notebook can be used with any Mathematica-compatible
application, such as Mathematica, MathReader or Publicon. 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[ 12432, 442]*)
(*NotebookOutlinePosition[ 13160, 467]*)
(* CellTagsIndexPosition[ 13116, 463]*)
(*WindowFrame->Normal*)
Notebook[{
Cell[TextData[{
"Math 236 ",
StyleBox["\[FilledSmallCircle]",
FontSlant->"Plain"],
" 2 May 2001"
}], "Subsubtitle",
TextAlignment->Center,
TextJustification->0],
Cell[CellGroupData[{
Cell[TextData[{
"Spotted ",
StyleBox["o",
FontWeight->"Bold",
FontColor->RGBColor[1, 0, 0]],
"wls and flying ",
StyleBox["s",
FontWeight->"Bold",
FontColor->RGBColor[1, 0, 0]],
"quirrels revisited:\napplying diagonalization"
}], "Subtitle",
TextAlignment->Center],
Cell[CellGroupData[{
Cell["Introduction", "Section"],
Cell[TextData[{
"Consider again the linear discrete dynamical system \n \t\t",
Cell[BoxData[
\(TraditionalForm\`\(x\& \[Rule] \)(t\ + \ 1)\ = \
A\ \ \(\(x\& \[Rule] \)(t)\)\)]],
", \t\t",
Cell[BoxData[
\(TraditionalForm\`\(x\& \[Rule] \)(
0)\ = \ \(\(x\_0\)\& \[Rule] \)\)]],
" a given state vector. \n whose coefficient matrix ",
Cell[BoxData[
\(TraditionalForm\`A\)]],
" is:"
}], "Text",
ParagraphSpacing->{0.5, 0}],
Cell[BoxData[
RowBox[{
RowBox[{"A", " ", "=", " ",
RowBox[{"(", GridBox[{
{"0.4", "0.3"},
{\(-0.325\), "1.2"}
}], ")"}]}], ";"}]], "Input"],
Cell["In exact rational form, this is:", "Text"],
Cell[BoxData[
\(a\ = \ Rationalize[A]; \ a\ // \ MatrixForm\)], "Input"],
Cell[TextData[{
"We know that ",
Cell[BoxData[
FormBox[
RowBox[{\(\(x\& \[Rule] \)(t)\), " ", "=", " ",
RowBox[{"(", "\[NegativeThinSpace]", GridBox[{
{\(o(t)\)},
{\(s(t)\)}
}], "\[NegativeThinSpace]", ")"}]}], TraditionalForm]]],
" can be expressed in the closed form\n\t\t\t\t",
Cell[BoxData[
\(TraditionalForm\`\(x\& \[Rule] \)(t)\ = \
A\^t\ \(\(x\_0\)\& \[Rule] \)\)]],
".\nBut what does ",
Cell[BoxData[
\(TraditionalForm\`A\^t\)]],
" actually look like?"
}], "Text",
ParagraphSpacing->{0.5, 0}]
}, Closed]],
Cell[CellGroupData[{
Cell["The problem", "Section"],
Cell[TextData[{
"Develop an explicit closed-form formula for ",
Cell[BoxData[
FormBox[
RowBox[{\(\(x\& \[Rule] \)(t)\), " ", "=", " ",
RowBox[{"(", "\[NegativeThinSpace]", GridBox[{
{\(o(t)\)},
{\(s(t)\)}
}], "\[NegativeThinSpace]", ")"}]}], TraditionalForm]]],
" as a function of discrete time ",
Cell[BoxData[
\(TraditionalForm\`t\)]],
", no matter what the initial state ",
Cell[BoxData[
\(TraditionalForm\`\(\(x\_0\)\& \[Rule] \)\)]],
". (In the original notebook, we did this just for a specific ",
Cell[BoxData[
\(TraditionalForm\`\(\(x\_0\)\& \[Rule] \)\)]],
".) Use diagonalization of ",
Cell[BoxData[
\(TraditionalForm\`A\)]],
", if possible."
}], "Text"]
}, Closed]],
Cell[CellGroupData[{
Cell["A solution", "Section"],
Cell["\<\
First, find the eigenvalues and basis vectors of associated eigenspaces:\
\>", "Text"],
Cell[BoxData[
\(esys\ = \ Eigensystem[a]\)], "Input"],
Cell[BoxData[
\(N[%]\)], "Input"],
Cell["\<\
Note. We want to work with the exact, rational coefficients and not decimal \
numerical approximations: watch what happens if you try to use the decimal \
version instead:\
\>", "SmallText"],
Cell[BoxData[
\(Eigensystem[A]\)], "Input"],
Cell[BoxData[
\(Rationalize[%]\)], "Input"],
Cell["Extract the individual eigenvalues and basis eigenvectors:", "Text"],
Cell[BoxData[{
\(\[Lambda]1\ = \ Last@\(First@esys\); \ \[Lambda]2\ = \
First@\(First@esys\);\), "\n",
\(v1\ = \ Last@\(Last@esys\); \ v2\ = \ First@\(Last@esys\);\), "\n",
\({\[Lambda]1, \ v1}\), "\n",
\({\[Lambda]2, \ v2}\)}], "Input"],
Cell[TextData[{
"The vectors ",
StyleBox["v1",
FontFamily->"Courier",
FontWeight->"Bold"],
" and ",
StyleBox["v2",
FontFamily->"Courier",
FontWeight->"Bold"],
" here are not quite the same as the vectors ",
Cell[BoxData[
FormBox[
RowBox[{\(\(v\_1\)\& \[Rule] \), " ", "=", " ",
RowBox[{"(", "\[NegativeThinSpace]", GridBox[{
{"60"},
{"130"}
}], "\[NegativeThinSpace]", ")"}]}], TraditionalForm]]],
" and ",
Cell[BoxData[
FormBox[
RowBox[{\(\(v\_2\)\& \[Rule] \), " ", "=", " ",
RowBox[{"(", "\[NegativeThinSpace]", GridBox[{
{"200"},
{"100"}
}], "\[NegativeThinSpace]", ")"}]}], TraditionalForm]]],
" used in the original notebok, but rather scalar multiples of them. It's \
as if now we are measuring not the same quantities (number of owls and \
thousands of squirrels) as before, but rather hundreds of such quantities. "
}], "Text"],
Cell[TextData[{
"Because the ",
Cell[BoxData[
\(TraditionalForm\`2\ \[Times]\ 2\)]],
" matrix ",
Cell[BoxData[
\(TraditionalForm\`A\)]],
" has two distinct eigenvalues, ",
Cell[BoxData[
\(TraditionalForm\`\[DoubleStruckCapitalR]\^2\)]],
" has ",
Cell[BoxData[
\(TraditionalForm\`\(\(v\_1\)\& \[Rule] \)\)]],
" and ",
Cell[BoxData[
\(TraditionalForm\`\(\(v\_2\)\& \[Rule] \)\)]],
" as an eigenbasis. Hence ",
Cell[BoxData[
\(TraditionalForm\`A\)]],
" ",
StyleBox["is",
FontSlant->"Italic"],
" diagonalizable. The diagonalizing matrix is:"
}], "Text"],
Cell[BoxData[
\(S\ = \ Transpose[{v1, \ v2}]; \ S\ // \ MatrixForm\)], "Input"],
Cell[TextData[{
"Then the diagonal form is ",
Cell[BoxData[
\(TraditionalForm\`D\ = \ S\^\(-1\)\ A\ S\)]],
" of ",
Cell[BoxData[
\(TraditionalForm\`A\)]],
" is as follows (we to avoid conflict with ",
StyleBox["Mathematica",
FontSlant->"Italic"],
"'s derivative function ",
StyleBox["D",
FontFamily->"Courier"],
", we must use some other name):"
}], "Text"],
Cell[BoxData[
\(diag\ = \ DiagonalMatrix[{\[Lambda]1, \ \[Lambda]2}]; \
diag // \ MatrixForm\)], "Input"],
Cell["Just as a check:", "Text"],
Cell[BoxData[
\(diag\ === \ Inverse[S]\ . \ a\ . \ S\)], "Input"],
Cell[TextData[{
"Since ",
Cell[BoxData[
\(TraditionalForm\`A\ = \ S\ D\ S\^\(-1\)\)]],
", we want to calculate ",
Cell[BoxData[
\(TraditionalForm\`A\^t\)]],
" as \n\t\t\t\t",
Cell[BoxData[
\(TraditionalForm\`A\^t\ = \ S\ D\^t\ S\^\(\(-1\)\(\ \)\)\)]],
". (*)\nHere, of course, we do ",
StyleBox["not",
FontSlant->"Italic"],
" realize ",
Cell[BoxData[
\(TraditionalForm\`D\^t\)]],
" by actually invoking ",
StyleBox["MatrixPower",
FontFamily->"Courier"],
". Instead, we use our knowledge about what powers of a diagonal matrix \
look like:"
}], "Text",
ParagraphSpacing->{0.5, 0}],
Cell[BoxData[
\(d[t_]\ := \
DiagonalMatrix[{\[Lambda]1\^t, \ \[Lambda]2\^t}]\)], "Input"],
Cell["For example:", "Text"],
Cell[BoxData[{
\(d[2]\ // \ MatrixForm\), "\n",
\(d[3]\ // \ MatrixForm\)}], "Input"],
Cell["\<\
Watch out here: the numerators and denominators are getting big!\
\>", "Text"],
Cell["Define:", "Text"],
Cell[BoxData[
\(invS\ = \ Inverse[S]; \ invS\ // \ MatrixForm\)], "Input"],
Cell[TextData[{
"Then the explict form of the coefficient matrix ",
Cell[BoxData[
\(TraditionalForm\`A\)]],
" provided by the diagonalization is:"
}], "Text"],
Cell[BoxData[
\(\(S\ . \ d[t]\ . \ invS\ // Simplify\) // MatrixForm\)], "Input"],
Cell["\<\
In terms of the diagonalization, then, the explicit form of the state vector \
is given by:\
\>", "Text"],
Cell[BoxData[
\(Clear[x]\)], "Input"],
Cell[BoxData[
\(x[t_]\ := \ S\ . \ d[t]\ . \ invS\ . \ x0\)], "Input"],
Cell[TextData[{
StyleBox["Exercise.",
FontWeight->"Bold"],
" Using (*) and the fact that ",
Cell[BoxData[
FormBox[
RowBox[{\(D\^t\), " ", "=", " ",
RowBox[{"(", "\[NegativeThinSpace]", GridBox[{
{\(\[Lambda]\_1\^t\), "0"},
{"0", \(\[Lambda]\_2\^t\)}
}], "\[NegativeThinSpace]", ")"}]}], TraditionalForm]]],
", try to use paper and pencil calculations to obtain an explicit, closed \
form for the first and second coordinate functions ",
Cell[BoxData[
\(TraditionalForm\`o(t)\)]],
" and ",
Cell[BoxData[
\(TraditionalForm\`s(t)\)]],
" of ",
Cell[BoxData[
\(TraditionalForm\`\(x\& \[Rule] \)(t)\)]],
". (Use the specific values of ",
Cell[BoxData[
\(TraditionalForm\`\[Lambda]\_1\)]],
" and ",
Cell[BoxData[
\(TraditionalForm\`\[Lambda]\_\(\(2\)\(\ \)\)\)]],
" here.)"
}], "Text",
CellFrame->True,
Background->GrayLevel[0.849989]],
Cell["\<\
Continuing our work from above, let's use the diagonalization to track the \
long-run behavior just for one initial state:\
\>", "Text"],
Cell[BoxData[
\(x0\ = {100, \ 175}/100\)], "Input"],
Cell[TextData[{
"This is essentially the same initial state as Example 3 in the original \
notebook [the initial state there was ",
Cell[BoxData[
\(TraditionalForm\`\((100, \ 175)\)\)]],
"]. We have scaled that original initial state in order to keep the \
numbers to a reasonable size; again it's as if we changed units so as to \
measure in 100's."
}], "Text"],
Cell[TextData[{
"The closed form formula for ",
Cell[BoxData[
\(TraditionalForm\`\(x\& \[Rule] \)(t)\)]],
" is therefore:"
}], "Text"],
Cell[BoxData[
\(x[t]\ // Simplify\)], "Input"],
Cell[BoxData[
\(N[x[t]]\)], "Input"],
Cell["We compute:", "Text"],
Cell[BoxData[
\(Table[N[x[t]], \ {t, \ 0, \ 10}]\ // \ TableForm\)], "Input"],
Cell[TextData[{
"These include the same values we obtained in the original notebook (scaled \
by 100). In the original notebook we used the eigenvalues and eigenvectors \
in a somewhat different way, to obtain the closed-form formula via ",
"\n\t\t\t\t",
Cell[BoxData[
\(TraditionalForm\`\(x\& \[Rule] \)(t)\ = \
c\_1\ \[Lambda]\_1\^t\ \(\(v\_1\)\& \[Rule] \)\ + \
c\_2\ \[Lambda]\_2\^t\ \(\(v\_2\)\& \[Rule] \)\)]],
" \nwhere we first solved for ",
Cell[BoxData[
\(TraditionalForm\`c\_1\)]],
" and ",
Cell[BoxData[
\(TraditionalForm\`c\_2\)]],
" in order to express\n\t\t\t\t",
Cell[BoxData[
\(TraditionalForm\`x\_0\ = \
c\_1\ \(\(v\_1\)\& \[Rule] \)\ + \
c\_2\ \(\(v\_2\)\& \[Rule] \)\)]],
" ."
}], "Text",
ParagraphSpacing->{0.5, 0}],
Cell[TextData[{
StyleBox["Question.",
FontWeight->"Bold"],
" What are the advantages of doing it the new way, via diagonalization? \
Disadvantages?"
}], "Text",
CellFrame->True,
Background->GrayLevel[0.849989]]
}, Closed]]
}, Open ]]
},
FrontEndVersion->"4.1 for Microsoft Windows",
ScreenRectangle->{{0, 1280}, {0, 979}},
WindowToolbars->{},
WindowSize->{829, 813},
WindowMargins->{{213, Automatic}, {61, Automatic}},
PrintingCopies->1,
PrintingPageRange->{Automatic, Automatic}
]
(*******************************************************************
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[1705, 50, 176, 7, 53, "Subsubtitle"],
Cell[CellGroupData[{
Cell[1906, 61, 291, 11, 95, "Subtitle"],
Cell[CellGroupData[{
Cell[2222, 76, 31, 0, 59, "Section"],
Cell[2256, 78, 474, 14, 86, "Text"],
Cell[2733, 94, 200, 6, 41, "Input"],
Cell[2936, 102, 48, 0, 33, "Text"],
Cell[2987, 104, 78, 1, 30, "Input"],
Cell[3068, 107, 611, 18, 98, "Text"]
}, Closed]],
Cell[CellGroupData[{
Cell[3716, 130, 30, 0, 39, "Section"],
Cell[3749, 132, 785, 22, 65, "Text"]
}, Closed]],
Cell[CellGroupData[{
Cell[4571, 159, 29, 0, 39, "Section"],
Cell[4603, 161, 96, 2, 33, "Text"],
Cell[4702, 165, 58, 1, 30, "Input"],
Cell[4763, 168, 37, 1, 30, "Input"],
Cell[4803, 171, 200, 4, 28, "SmallText"],
Cell[5006, 177, 47, 1, 30, "Input"],
Cell[5056, 180, 47, 1, 30, "Input"],
Cell[5106, 183, 74, 0, 33, "Text"],
Cell[5183, 185, 267, 5, 90, "Input"],
Cell[5453, 192, 1018, 28, 64, "Text"],
Cell[6474, 222, 621, 23, 34, "Text"],
Cell[7098, 247, 85, 1, 30, "Input"],
Cell[7186, 250, 396, 14, 33, "Text"],
Cell[7585, 266, 115, 2, 30, "Input"],
Cell[7703, 270, 32, 0, 33, "Text"],
Cell[7738, 272, 72, 1, 30, "Input"],
Cell[7813, 275, 672, 22, 86, "Text"],
Cell[8488, 299, 101, 2, 30, "Input"],
Cell[8592, 303, 28, 0, 33, "Text"],
Cell[8623, 305, 96, 2, 50, "Input"],
Cell[8722, 309, 88, 2, 33, "Text"],
Cell[8813, 313, 23, 0, 33, "Text"],
Cell[8839, 315, 80, 1, 30, "Input"],
Cell[8922, 318, 170, 5, 33, "Text"],
Cell[9095, 325, 88, 1, 30, "Input"],
Cell[9186, 328, 115, 3, 33, "Text"],
Cell[9304, 333, 41, 1, 30, "Input"],
Cell[9348, 336, 78, 1, 30, "Input"],
Cell[9429, 339, 970, 30, 85, "Text"],
Cell[10402, 371, 146, 3, 33, "Text"],
Cell[10551, 376, 56, 1, 30, "Input"],
Cell[10610, 379, 375, 8, 52, "Text"],
Cell[10988, 389, 146, 5, 34, "Text"],
Cell[11137, 396, 51, 1, 30, "Input"],
Cell[11191, 399, 40, 1, 30, "Input"],
Cell[11234, 402, 27, 0, 33, "Text"],
Cell[11264, 404, 82, 1, 30, "Input"],
Cell[11349, 407, 827, 22, 132, "Text"],
Cell[12179, 431, 225, 7, 49, "Text"]
}, Closed]]
}, Open ]]
}
]
*)
(*******************************************************************
End of Mathematica Notebook file.
*******************************************************************)