(*********************************************************************** 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[ 14222, 436]*) (*NotebookOutlinePosition[ 14863, 459]*) (* CellTagsIndexPosition[ 14819, 455]*) (*WindowFrame->Normal*) Notebook[{ Cell[CellGroupData[{ Cell["\<\ Math 230, Spring 2000 Mathematica assignment 4 Solutions\ \>", "Subsubtitle"], Cell["\<\ The following problems are taken from pages 179 to 193 of the \ Differential Equations with Mathematica book. \ \>", "Text"], Cell[BoxData[ \(Needs["\"]\)], "Input"], Cell[CellGroupData[{ Cell["Problem 1.", "Subsection"], Cell[CellGroupData[{ Cell["Part a.", "Subsubsection"], Cell[BoxData[{ \(\(A1\ = \ {{2, \(-1\)}, {3, \(-2\)}};\)\), "\n", \(\(A2\ = \ {{1, \(-1\)}, {5, \(-3\)}};\)\), "\n", \(\(A3\ = \ {{\(-3\), 5/2}, {\(-5\)/2, 2}};\)\), "\n", \(MatrixForm[A1]\), "\n", \(MatrixForm[A2]\), "\n", \(MatrixForm[A3]\)}], "Input"], Cell[BoxData[ \(Eigensystem[A1]\)], "Input"], Cell[BoxData[ \(\(\(So\)\(\ \)\(the\)\(\ \)\(general\)\(\ \)\(solution\)\(\ \)\(to\)\(\ \ \)\(the\)\(\ \)\(first\)\(\ \)\(system\)\(\ \)\(is\)\(\ \)\)\)], "Text"], Cell[BoxData[ RowBox[{\(mysoln1[t_]\), " ", "=", " ", RowBox[{ RowBox[{"a", RowBox[{"(", "\[NegativeThinSpace]", GridBox[{ {"1"}, {"3"} }], "\[NegativeThinSpace]", ")"}], \(e\^\(-t\)\)}], "+", RowBox[{"b", RowBox[{"(", "\[NegativeThinSpace]", GridBox[{ {"1"}, {"1"} }], "\[NegativeThinSpace]", ")"}], \(e\^t\)}]}]}]], "Input"], Cell[BoxData[ \(Eigensystem[A2]\)], "Input"], Cell[BoxData[{ RowBox[{\(So\ the\ general\ solution\ to\ the\ second\ system\ is\), " "}], "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"a", RowBox[{"(", "\[NegativeThinSpace]", GridBox[{ {\(2 - i\)}, {"5"} }], "\[NegativeThinSpace]", ")"}], \(e\^\(\((\(-1\) - i)\) t\)\)}], "+", RowBox[{"b", RowBox[{"(", "\[NegativeThinSpace]", GridBox[{ {\(2 + i\)}, {"5"} }], "\[NegativeThinSpace]", ")"}], \(e\^\(\((\(-1\) + i)\) t\)\)}]}], " "}], "\[IndentingNewLine]", \(which\ can\ be\ written\ in\ real\ form\ \ as\)}], "Text"], Cell[BoxData[ RowBox[{" ", RowBox[{\(mysoln2[t_]\), "=", " ", RowBox[{ RowBox[{"c", " ", \(e\^\(-t\)\), RowBox[{"\[LeftAngleBracket]", RowBox[{ RowBox[{ RowBox[{"(", "\[NegativeThinSpace]", GridBox[{ {"2"}, {"5"} }], "\[NegativeThinSpace]", ")"}], \(Cos[t]\)}], " ", "-", " ", RowBox[{ RowBox[{"(", "\[NegativeThinSpace]", GridBox[{ {"1"}, {"0"} }], "\[NegativeThinSpace]", ")"}], \(Sin[t]\)}]}], "\[RightAngleBracket]"}]}], "+", " ", RowBox[{"d", " ", \(e\^\(-t\)\), " ", RowBox[{"\[LeftAngleBracket]", RowBox[{ RowBox[{ RowBox[{"-", RowBox[{"(", "\[NegativeThinSpace]", GridBox[{ {"1"}, {"0"} }], "\[NegativeThinSpace]", ")"}]}], \(Cos[t]\)}], " ", "-", " ", RowBox[{ RowBox[{"(", "\[NegativeThinSpace]", GridBox[{ {"2"}, {"5"} }], "\[NegativeThinSpace]", ")"}], \(Sin[t]\)}]}], "\[RightAngleBracket]"}], " "}]}]}]}]], "Input"], Cell[BoxData[ \(Eigensystem[A3]\)], "Input"], Cell[BoxData[{ \(So\ the\ general\ solution\ \ has\ the\ form\), "\[IndentingNewLine]", \(\(e\^\(t/2\)\) \((v\ + \ tw)\)\), "\[IndentingNewLine]", \(for\ some\ vectors\ v\ and\ w . \ \ When\ I\ compute\ these\ vectors\ \ by\ hand, \ I\ get\)}], "Text"], Cell[BoxData[ RowBox[{\(mysoln3[t_]\), "=", RowBox[{\(e\^\(t/2\)\), RowBox[{"\[LeftAngleBracket]", " ", RowBox[{ RowBox[{"a", RowBox[{"(", "\[NegativeThinSpace]", GridBox[{ {"1"}, {"1"} }], "\[NegativeThinSpace]", ")"}]}], "+", " ", RowBox[{"b", RowBox[{"(", "\[NegativeThinSpace]", GridBox[{ {\(\(-2\)/5\)}, {"0"} }], "\[NegativeThinSpace]", ")"}]}], " ", "+", " ", RowBox[{"b", " ", "t", RowBox[{"(", "\[NegativeThinSpace]", GridBox[{ {"1"}, {"1"} }], "\[NegativeThinSpace]", ")"}]}]}], " ", "\[RightAngleBracket]"}]}]}]], "Input"], Cell[BoxData[ \(\(\(\[IndentingNewLine]\)\(\[IndentingNewLine]\)\(\[IndentingNewLine]\)\ \(\[IndentingNewLine]\)\(\[IndentingNewLine]\)\(\[IndentingNewLine]\)\)\)], \ "Input"] }, Open ]], Cell[CellGroupData[{ Cell["Part b", "Subsubsection"], Cell[BoxData[{ \(sys1\ = \ {\(x'\)[t] == 2 x[t] - y[t], \(y'\)[t] == 3 x[t] - 2 y[t]}\), "\n", \(sys2\ = \ {\(x'\)[t] == x[t] - y[t], \(y'\)[t] == 5 x[t] - 3 y[t]}\), "\n", \(sys3\ = \ {\(x'\)[t] == \(-3\) x[t] + 5/2 y[t], \(y'\)[ t] == \(-5\)/2 x[t] + 2 y[t]}\n\)}], "Input"], Cell["\<\ First system:\ \>", "Text"], Cell[BoxData[ \(soln1[t_]\ = {x[t], y[t]} /. First[DSolve[sys1, {x[t], y[t]}, t]]\)], "Input"], Cell["\<\ To find the relationship between the constants in my solution to \ the first system and the constants in the computer'solution, I set t=0 in \ both and compare:\ \>", "Text"], Cell[BoxData[{ \(mysoln1[0]\), "\[IndentingNewLine]", \(soln1[0]\)}], "Input"], Cell["Therefore C[1] = a+b and C[2] = 3a+b.", "Text"], Cell["Second system:", "Text"], Cell[BoxData[ \(soln2[ t_]\ = \n\t\ FullSimplify[{x[t], y[t]} /. First[DSolve[sys2, {x[t], y[t]}, t]]]\)], "Input"], Cell["\<\ To find the relationship between the constants in my solution to \ the first system and the constants in the computer'solution, I set t=0 in \ both and compare:\ \>", "Text"], Cell[BoxData[{ \(mysoln2[0]\), "\[IndentingNewLine]", \(soln2[0]\)}], "Input"], Cell["Therefore C[1] = -d + 2c and C[2] = 5c.", "Text"], Cell[BoxData[ \(soln3[t_]\ = \ Simplify[{x[t], y[t]} /. First[DSolve[sys3, {x[t], y[t]}, t]]]\)], "Input"], Cell["\<\ To find the relationship between the constants in my solution to \ the first system and the constants in the computer'solution, I set t=0 in \ both and compare:\ \>", "Text"], Cell[BoxData[{ \(mysoln3[0]\), "\[IndentingNewLine]", \(soln3[0]\)}], "Input"], Cell["Hence C[1] = a - 2b/5 and C[2] = a.", "Text"], Cell[BoxData[ \(\(\(\[IndentingNewLine]\)\(\[IndentingNewLine]\)\(\[IndentingNewLine]\)\ \(\[IndentingNewLine]\)\(\[IndentingNewLine]\)\(\[IndentingNewLine]\)\(\ \[IndentingNewLine]\)\)\)], "Input"] }, Open ]], Cell[CellGroupData[{ Cell["Part c", "Subsubsection"], Cell["\<\ To get the plots I put the Mathematica solutions in slightly \ different form:\ \>", "Text"], Cell[BoxData[{ \(\[IndentingNewLine]sol1[a_, b_]\ = \ soln1[t] /. {C[1] \[Rule] a, C[2] \[Rule] b}\), "\[IndentingNewLine]", \(sol2[a_, b_]\ = \ soln2[t] /. {C[1] \[Rule] a, C[2] \[Rule] b}\), "\[IndentingNewLine]", \(sol3[a_, b_]\ = \ soln3[t] /. {C[1] \[Rule] a, C[2] \[Rule] b}\)}], "Input"], Cell[BoxData[ \(\(ParametricPlot[\n\ \ Evaluate[ Flatten[\n\t Table[sol1[a, b], {a, \(-2\), 2, .5}, {b, \(-2\), 2, .5}\n\t], 1]], \n\t{t, \(-5\), 5}, \n\ \ PlotRange -> {{\(-2\), 2}, {\(-2\), 2}}, \n\ \ Ticks \[Rule] None, \n\ \ Frame \[Rule] True\t\ \ \ \n];\)\)], "Input"], Cell["\<\ The origin is a saddle point--in particular, it's an unstable \ critical point.\ \>", "Text"], Cell[BoxData[ \(\(ParametricPlot[\n\ \ Evaluate[ Flatten[\n\t Table[sol2[a, b], {a, \(-2\), 2, .5}, {b, \(-2\), 2, .5}\n\t], 1]], \n\t{t, \(-5\), 5}, \n\ \ PlotRange -> {{\(-2\), 2}, {\(-2\), 2}}, \n\ \ Ticks \[Rule] None, \n\ \ Frame \[Rule] True\t\ \ \ \n];\)\)], "Input"], Cell["The origin is a stable spiral point.", "Text"], Cell[BoxData[ \(\(ParametricPlot[\n\ \ Evaluate[ Flatten[\n\t Table[sol3[a, b], {a, \(-2\), 2, .5}, {b, \(-2\), 2, .5}\n\t], 1]], \n\t{t, \(-5\), 5}, \n\ \ PlotRange -> {{\(-2\), 2}, {\(-2\), 2}}, \n\ \ Ticks \[Rule] None, \n\ \ Frame \[Rule] True\t\ \ \ \n];\)\)], "Input"], Cell["The origin is an unstable improper node.", "Text"], Cell[BoxData[ \(\(\(\[IndentingNewLine]\)\(\[IndentingNewLine]\)\(\[IndentingNewLine]\)\ \(\[IndentingNewLine]\)\(\[IndentingNewLine]\)\(\[IndentingNewLine]\)\(\ \[IndentingNewLine]\)\(\[IndentingNewLine]\)\(\[IndentingNewLine]\)\)\)], \ "Input"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell["Problem 4.", "Subsection"], Cell[CellGroupData[{ Cell["Part a.", "Subsubsection"], Cell[BoxData[{ \(sys1\ = \ {\(x'\)[t]\ == \ 2 x[t] - y[t]\ + \ E^t, \n\t\t\ \ \ \ \ \ \ \ \ \ \ \ \ \ \(y'\)[ t] == 3 x[t] - 2 y[t] + t, \n\t\t\ \ \ \ \ \ \ \ \ \ \ \ \ \ x[ 0]\ == \ a, y[0] == b}\), "\n", \(sys2\ = \ {\(x'\)[t]\ == \ 2 x[t] - 5 y[t]\ - Cos[t], \n\t\t\ \ \ \ \ \ \ \ \ \ \ \ \ \ \(y'\)[t] == 1 x[t] - 2 y[t] + Sin[t], \n\t\t\ \ \ \ \ \ \ \ \ \ \ \ \ \ x[ 0]\ == \ a, y[0] == b}\), "\n", \(sys3\ = \ {\(x'\)[t]\ == \ \(-3\) x[t] + Sqrt[2]*y[t] + E^\((\(-t\))\)\ , \n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \(y'\)[ t] == Sqrt[2]*x[t] - 2 y[t]\ - \ E^\((\(-t\))\), \n\t\t\ \ \ \ \ \ \ \ \ \ \ \ \ \ x[0] \[Equal] a, y[0] \[Equal] b}\)}], "Input"], Cell[BoxData[ \(sol1[a_, b_]\ = \ {x[t], y[t]} /. Simplify[First[DSolve[sys1, {x[t], y[t]}, t]]]\)], "Input"], Cell[BoxData[ \(sol2[a_, b_]\ = \ {x[t], y[t]} /. Simplify[First[DSolve[sys2, {x[t], y[t]}, t]]]\)], "Input"], Cell[BoxData[ \(sol3[a_, b_]\ = \ {x[t], y[t]} /. First[DSolve[sys3, {x[t], y[t]}, t]]\)], "Input"], Cell[BoxData[ \(\(\(\[IndentingNewLine]\)\(\[IndentingNewLine]\)\(\[IndentingNewLine]\)\ \(\[IndentingNewLine]\)\(\[IndentingNewLine]\)\)\)], "Input"] }, Open ]], Cell[CellGroupData[{ Cell["Part c.", "Subsubsection"], Cell[BoxData[ \(\(ParametricPlot[\n\ \ Evaluate[sol1[1, 1]], \n\t{t, \(-1\), 1}, \n\ \ Ticks \[Rule] None, \n\ \ Frame \[Rule] True, PlotPoints -> 1000\t\ \ \ \n];\)\)], "Input"], Cell[BoxData[ \(\(ParametricPlot[\n\ \ Evaluate[sol1[1, 1]], \n\t{t, \(-3\), 3}, \n\ \ Ticks \[Rule] None, \n\ \ Frame \[Rule] True, PlotPoints -> 1000\t\ \ \ \n];\)\)], "Input"], Cell["\<\ Looks like the solution is headed to infinity asymptotic to a line \ of slope about 1 as t goes to infinity, and that as t goes to negative infinity,the solution goes to infinity \ asymptotic to a line of slope 4. \ \>", "Text"], Cell[BoxData[ \(\(ParametricPlot[\n\ \ Evaluate[sol2[1, 1]], \n\t{t, \(-1\), 1}, \n\ \ Ticks \[Rule] None, \n\ \ Frame \[Rule] True, PlotPoints -> 1000\t\ \ \ \n];\)\)], "Input"], Cell[BoxData[ \(\(ParametricPlot[\n\ \ Evaluate[sol2[1, 1]], \n\t{t, \(-20\), 20}, \n\ \ Ticks \[Rule] None, \n\ \ Frame \[Rule] True, PlotPoints -> 1000\t\ \ \ \n];\)\)], "Input"], Cell["\<\ It looks like the solution will generally spiral out to infinity as \ t goes to either positive or negative infinity.\ \>", "Text"], Cell[BoxData[ \(\(ParametricPlot[\n\ \ \ Evaluate[sol3[1, 1]], \n\t{t, \(-1\), 1}, \n\ \ Ticks \[Rule] None, \n\ \ Frame \[Rule] True, PlotPoints -> 1000\n];\)\)], "Input"], Cell[BoxData[""], "Input"], Cell[BoxData[ \(\(ParametricPlot[\n\ \ \ Evaluate[sol3[1, 1]], \n\t{t, \(-1.5\), 1}, \n\ \ Ticks \[Rule] None, \n\ \ Frame \[Rule] True, PlotPoints -> 1000\n];\)\)], "Input"], Cell["\<\ It looks like the solution converges to the origin as t goes to \ positive infinity and tends to infinity with slope about -1 as t goes to negative infinity.\ \>", "Text"] }, Open ]] }, Open ]] }, Open ]] }, FrontEndVersion->"4.0 for X", ScreenRectangle->{{0, 1280}, {0, 1024}}, WindowSize->{812, 771}, WindowMargins->{{Automatic, 148}, {Automatic, 89}} ] (*********************************************************************** 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[CellGroupData[{ Cell[1739, 51, 87, 4, 89, "Subsubtitle"], Cell[1829, 57, 135, 3, 32, "Text"], Cell[1967, 62, 65, 1, 27, "Input"], Cell[CellGroupData[{ Cell[2057, 67, 32, 0, 45, "Subsection"], Cell[CellGroupData[{ Cell[2114, 71, 32, 0, 42, "Subsubsection"], Cell[2149, 73, 286, 6, 107, "Input"], Cell[2438, 81, 48, 1, 27, "Input"], Cell[2489, 84, 166, 2, 29, "Text"], Cell[2658, 88, 472, 12, 45, "Input"], Cell[3133, 102, 48, 1, 27, "Input"], Cell[3184, 105, 713, 18, 83, "Text"], Cell[3900, 125, 1443, 34, 45, "Input"], Cell[5346, 161, 48, 1, 27, "Input"], Cell[5397, 164, 267, 4, 63, "Text"], Cell[5667, 170, 838, 20, 45, "Input"], Cell[6508, 192, 179, 3, 123, "Input"] }, Open ]], Cell[CellGroupData[{ Cell[6724, 200, 31, 0, 42, "Subsubsection"], Cell[6758, 202, 335, 6, 75, "Input"], Cell[7096, 210, 38, 3, 50, "Text"], Cell[7137, 215, 108, 2, 27, "Input"], Cell[7248, 219, 184, 5, 50, "Text"], Cell[7435, 226, 87, 2, 43, "Input"], Cell[7525, 230, 53, 0, 32, "Text"], Cell[7581, 232, 30, 0, 32, "Text"], Cell[7614, 234, 139, 3, 43, "Input"], Cell[7756, 239, 184, 5, 50, "Text"], Cell[7943, 246, 87, 2, 43, "Input"], Cell[8033, 250, 55, 0, 32, "Text"], Cell[8091, 252, 129, 3, 27, "Input"], Cell[8223, 257, 184, 5, 50, "Text"], Cell[8410, 264, 87, 2, 43, "Input"], Cell[8500, 268, 51, 0, 32, "Text"], Cell[8554, 270, 202, 3, 139, "Input"] }, Open ]], Cell[CellGroupData[{ Cell[8793, 278, 31, 0, 42, "Subsubsection"], Cell[8827, 280, 102, 3, 32, "Text"], Cell[8932, 285, 332, 6, 75, "Input"], Cell[9267, 293, 352, 7, 155, "Input"], Cell[9622, 302, 103, 3, 32, "Text"], Cell[9728, 307, 352, 7, 155, "Input"], Cell[10083, 316, 52, 0, 32, "Text"], Cell[10138, 318, 352, 7, 155, "Input"], Cell[10493, 327, 57, 0, 32, "Text"], Cell[10553, 329, 250, 4, 171, "Input"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell[10852, 339, 32, 0, 45, "Subsection"], Cell[CellGroupData[{ Cell[10909, 343, 32, 0, 42, "Subsubsection"], Cell[10944, 345, 820, 14, 155, "Input"], Cell[11767, 361, 123, 2, 27, "Input"], Cell[11893, 365, 123, 2, 27, "Input"], Cell[12019, 369, 113, 2, 27, "Input"], Cell[12135, 373, 154, 2, 107, "Input"] }, Open ]], Cell[CellGroupData[{ Cell[12326, 380, 32, 0, 42, "Subsubsection"], Cell[12361, 382, 202, 3, 107, "Input"], Cell[12566, 387, 202, 3, 107, "Input"], Cell[12771, 392, 241, 6, 68, "Text"], Cell[13015, 400, 202, 3, 107, "Input"], Cell[13220, 405, 204, 3, 107, "Input"], Cell[13427, 410, 141, 3, 32, "Text"], Cell[13571, 415, 196, 3, 107, "Input"], Cell[13770, 420, 26, 0, 27, "Input"], Cell[13799, 422, 198, 3, 107, "Input"], Cell[14000, 427, 182, 4, 50, "Text"] }, Open ]] }, Open ]] }, Open ]] } ] *) (*********************************************************************** End of Mathematica Notebook file. ***********************************************************************)