(*********************************************************************** 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[ 11051, 347]*) (*NotebookOutlinePosition[ 11731, 371]*) (* CellTagsIndexPosition[ 11687, 367]*) (*WindowFrame->Normal*) Notebook[{ Cell[CellGroupData[{ Cell["\<\ Homogeneous Linear Systems of ODE's with constant \ coefficients\ \>", "Section"], Cell[BoxData[{ \(TextForm\`We\ consider\ systems\ of\ the\ form\), "\n", \(TextForm\`x\&\[RightVector]' \((t)\)\ = \ A\ \(x\&\[RightVector]\) \((t)\)\), "\n", \(TextForm\`where\ \(x\&\[RightVector]\) \((t)\) = \ \((\(x\_1\) \((t)\), \ \ ... \ , \ \(x\_t\) \((t)\))\)\ is\ a\ vector\ whose\ components\ are\), "\n\ ", \(TextForm\`functions\ of\ t, \ and\ A\ is\ an\ n\[Cross] n\ constant\ matrix . \ \ For\ practical\), "\n", \(TextForm\`purposes, \ we\ limit\ ourselves\ to\ the\ case\ n = 2. \)}], "Text"], Cell[BoxData[ \(RHS[x1_, x2_]\ := \ A . {x1, x2}\)], "Input"], Cell[BoxData[ \(Needs["\"]\)], "Input"], Cell[CellGroupData[{ Cell["Example 1 Source (A has two positive eigenvalues:", "Subsubsection"], Cell["\<\ We define A in terms of its diagonalization--i.e. in terms of its \ eigenvalues and eigenvectors. What, by the way, are its eigenvalues and eigenvectors here?\ \>", "Text"], Cell[BoxData[ \(A\ = {{1, 1}, {1, \(-1\)}}\ . {{2, 0}, {0, 4}} . Inverse[{{1, 1}, {1, \(-1\)}}]\)], "Input"], Cell["\<\ Now we plot the direction field for A. Unlike direction fields for \ single ODE's, direction fields for systems suppress the time variable. This \ gives us an extra dimension for plotting the dependent variables, but it \ limits us to autonomous ODE's\ \>", "Text"], Cell[BoxData[ \(\(\(directions\)\(\ \)\(=\)\(\ \)\(RHS[x1, x2]\)\(\ \)\)\)], "Input"], Cell[BoxData[ \(PlotVectorField[directions, {x1, \(-3\), 3}, {x2, \(-3\), 3}, \ Axes -> \ True, \n\tScaleFunction \[Rule] \((1 &)\), Ticks \[Rule] None, Frame \[Rule] True, AspectRatio \[Rule] 1, \ PlotPoints\ -> \ 15]\)], "Input"], Cell[BoxData[ \(\(\(\n\)\(rhs\ = \ RHS[x1[t], x2[t]]\)\)\)], "Input"], Cell["\<\ Now we set up and solve the differentialequation, letting \"a\" and \ \"b\" be the initial values for x1 and x2.\ \>", "Text"], Cell[BoxData[ \(ivp\ = \ {\(x1'\)[t]\ == \ First[rhs], \ \(x2'\)[t]\ == \ Part[rhs, 2], \n\t\ \ \ \ \ \ \ \ \ \ x1[0]\ == \ a, \ \ \ \ \ \ \ \ \ x2[0]\ == \ b}\)], "Input"], Cell[BoxData[ \(DSolve[ivp, {x1[t], x2[t]}, t]\)], "Input"], Cell[BoxData[ \(soln[t_, a_, b_]\ = \ Expand[{x1[t], x2[t]} /. First[%]]\)], "Input"], Cell[BoxData[ \(\(ParametricPlot[ Evaluate[ Table[\n\t\t\tsoln[ t, .01*Cos[angle], .01*Sin[angle]], \n\t\t\t{angle, 0, 2*Pi, .05*Pi}]], \n\t\ \ \ \ \ {t, \(-1.5\), 1.5}, AspectRatio -> Automatic];\)\)], "Input"], Cell["\<\ Note that there are two \"straight line\" solutions corresponding \ to the two eigenvectors of A and that other solutions tend to diverge from \ one of the lines and become parallel to the other. Given any particular \ solution curve, the previous plot does not provide any information about which way the solution moves as t increases. On the other hand you can figure this out by looking at the direction \ field.\ \>", "Text"] }, Open ]], Cell[CellGroupData[{ Cell["\<\ Example 2: Saddle Point (A has real eigenvalues of opposite sign)\ \ \>", "Subsubsection"], Cell["Same eigenvectors, different eigenvalues:", "Text"], Cell[BoxData[ \(A\ = {{1, 1}, {2, \(-2\)}}\ . {{ .6, 0}, {0, \(- .7\)}} . Inverse[{{1, 1}, {2, \(-2\)}}]\)], "Input"], Cell["The direction field:", "Text"], Cell[BoxData[ \(\(\(directions\)\(\ \)\(=\)\(\ \)\(RHS[x1, x2]\)\(\ \)\)\)], "Input"], Cell[BoxData[ \(\(PlotVectorField[directions, {x1, \(-3\), 3}, {x2, \(-3\), 3}, \ Axes -> \ True, \n\tScaleFunction \[Rule] \((1 &)\), Ticks \[Rule] None, Frame \[Rule] True, AspectRatio \[Rule] 1, \ PlotPoints\ -> \ 15];\)\)], "Input"], Cell["The solution", "Text"], Cell[BoxData[ \(rhs = \ RHS[x1[t], x2[t]]\)], "Input"], Cell[BoxData[ \(ivp\ = \ {\(x1'\)[t]\ == \ First[rhs], \ \(x2'\)[t]\ == \ Part[rhs, 2], \n\t\ \ \ \ \ \ \ \ \ \ x1[0]\ == \ a, \ \ \ \ \ \ \ \ \ x2[0]\ == \ b}\)], "Input"], Cell[BoxData[ \(DSolve[ivp, {x1[t], x2[t]}, t]\)], "Input"], Cell[BoxData[ \(soln[t_, a_, b_]\ = \ Expand[{x1[t], x2[t]} /. First[%]]\)], "Input"], Cell[BoxData[ \(\(ParametricPlot[ Evaluate[ Table[\n\t\t\tsoln[t, r, 1], \n\t\t\t{r, \(-2\), 2, .2}]], \n\t\ \ \ \ \ {t, \(-2\), 2}, AspectRatio -> Automatic];\)\)], "Input"], Cell["\<\ Can you guess what will happen if we change the eigenvalues of A so that both are negative?\ \>", "Text"] }, Open ]], Cell[CellGroupData[{ Cell["Example 3: Indifferent point (Imaginary eigenvalues)", "Subsubsection"], Cell["\<\ It's not so easy to specify a real matrix A with imaginary \ eigenvalues in terms of its diagonalization. We take a slightly different \ approach. Note that the middle matrix has eigenvalues \[PlusMinus]i. Why \ should A have the same eigenvalues?\ \>", "Text"], Cell[BoxData[ \(A\ = {{1, 1}, {2, \(-1\)}}\ . {{0, 1}, {\(-1\), 0}} . Inverse[{{1, 1}, {2, \(-1\)}}]\)], "Input"], Cell[BoxData[ \(\(\(directions\)\(\ \)\(=\)\(\ \)\(RHS[x1, x2]\)\(\ \)\)\)], "Input"], Cell[BoxData[ \(\(PlotVectorField[directions, {x1, \(-3\), 3}, {x2, \(-3\), 3}, \ Axes -> \ True, \n\tScaleFunction \[Rule] \((1 &)\), Ticks \[Rule] None, Frame \[Rule] True, AspectRatio \[Rule] 1, \ PlotPoints\ -> \ 15];\)\)], "Input"], Cell["The solution", "Text"], Cell[BoxData[ \(rhs\ = \ RHS[x1[t], x2[t]]\)], "Input"], Cell[BoxData[ \(ivp\ = \ {\(x1'\)[t]\ == \ First[rhs], \ \(x2'\)[t]\ == \ Part[rhs, 2], \n\t\ \ \ \ \ \ \ \ \ \ x1[0]\ == \ a, \ \ \ \ \ \ \ \ \ x2[0]\ == \ b}\)], "Input"], Cell[BoxData[ \(DSolve[ivp, {x1[t], x2[t]}, t]\)], "Input"], Cell[BoxData[ \(soln[t_, a_, b_]\ = \ Expand[{x1[t], x2[t]} /. First[%]]\)], "Input"], Cell[BoxData[ \(\(ParametricPlot[ Evaluate[ Table[\n\t\t\tsoln[t, r, 0], \n\t\t\t{r, 0, 2, .1}]], \n\t\ \ \ \ \ {t, \(-5\), 5}, AspectRatio -> Automatic];\)\)], "Input"] }, Open ]], Cell[CellGroupData[{ Cell["\<\ Example 4: Spiral Point (A has complex conjugate \ eigenvalues)\ \>", "Subsubsection"], Cell[" Note that the middle matrix has eigenvalues 1\[PlusMinus]i. ", "Text"], Cell[BoxData[ \(A\ = {{1, 1}, {2, \(-2\)}}\ . {{1, 1}, {\(-1\), 1}} . Inverse[{{1, 1}, {2, \(-2\)}}]\)], "Input"], Cell[BoxData[ \(\(\(directions\)\(\ \)\(=\)\(\ \)\(RHS[x1, x2]\)\(\ \)\)\)], "Input"], Cell[BoxData[ \(\(PlotVectorField[directions, {x1, \(-3\), 3}, {x2, \(-3\), 3}, \ Axes -> \ True, \n\tScaleFunction \[Rule] \((1 &)\), Ticks \[Rule] None, Frame \[Rule] True, AspectRatio \[Rule] 1, \ PlotPoints\ -> \ 15];\)\)], "Input"], Cell["The solution", "Text"], Cell[BoxData[ \(\(\(\n\)\(rhs\ = \ RHS[x1[t], x2[t]]\)\)\)], "Input"], Cell[BoxData[ \(ivp\ = \ {\(x1'\)[t]\ == \ First[rhs], \ \(x2'\)[t]\ == \ Part[rhs, 2], \n\t\ \ \ \ \ \ \ \ \ \ x1[0]\ == \ a, \ \ \ \ \ \ \ \ \ x2[0]\ == \ b}\)], "Input"], Cell[BoxData[ \(DSolve[ivp, {x1[t], x2[t]}, t]\)], "Input"], Cell[BoxData[ \(soln[t_, a_, b_]\ = \ Expand[{x1[t], x2[t]} /. First[%]]\)], "Input"], Cell[BoxData[ \(\(ParametricPlot[ Evaluate[ Table[\n\t\t\tsoln[ t, .01*Cos[angle], .01*Sin[angle]], \n\t\t\t{angle, 0, 2*Pi, .1*Pi}]], \n\t\ \ \ \ \ {t, \(-1.5\), 1.5}, AspectRatio -> Automatic];\)\)], "Input"], Cell["\<\ How would this have been different had the eigenvalues been -1\ \[PlusMinus]i?\ \>", "Text"] }, Open ]], Cell[CellGroupData[{ Cell["Example 5: Improper node (A has repeated eigenvalues)", \ "Subsubsection"], Cell["We start with the simplest possible example.", "Text"], Cell[BoxData[ \(A\ = {{1, 1}, {0, 1}}\)], "Input"], Cell[BoxData[ \(\(\(directions\)\(\ \)\(=\)\(\ \)\(RHS[x1, x2]\)\(\ \)\)\)], "Input"], Cell[BoxData[ \(\(PlotVectorField[directions, {x1, \(-3\), 3}, {x2, \(-3\), 3}, \ Axes -> \ True, \n\tScaleFunction \[Rule] \((1 &)\), Ticks \[Rule] None, Frame \[Rule] True, AspectRatio \[Rule] 1, \ PlotPoints\ -> \ 15];\)\)], "Input"], Cell["The solution", "Text"], Cell[BoxData[ \(\(\(\n\)\(rhs\ = \ RHS[x1[t], x2[t]]\)\)\)], "Input"], Cell[BoxData[ \(ivp\ = \ {\(x1'\)[t]\ == \ First[rhs], \ \(x2'\)[t]\ == \ Part[rhs, 2], \n\t\ \ \ \ \ \ \ \ \ \ x1[0]\ == \ a, \ \ \ \ \ \ \ \ \ x2[0]\ == \ b}\)], "Input"], Cell[BoxData[ \(DSolve[ivp, {x1[t], x2[t]}, t]\)], "Input"], Cell[BoxData[ \(soln[t_, a_, b_]\ = \ Expand[{x1[t], x2[t]} /. First[%]]\)], "Input"], Cell[BoxData[ \(\(ParametricPlot[ Evaluate[ Table[\n\t\t\tsoln[ t, .01*Cos[angle], .01*Sin[angle]], \n\t\t\t{angle, 0, 2*Pi, .025*Pi}]], \n\t\ \ \ \ \ {t, \(-1.5\), 1.5}, AspectRatio -> Automatic];\)\)], "Input"], Cell["\<\ Note that solutions tend toward the same line regardless of whether t goes to positive or negative infinity. \ \>", "Text"] }, Open ]] }, Open ]] }, FrontEndVersion->"4.0 for X", ScreenRectangle->{{0, 1280}, {0, 1024}}, ScreenStyleEnvironment->"Presentation", WindowSize->{1272, 947}, WindowMargins->{{0, Automatic}, {Automatic, 23}} ] (*********************************************************************** 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, 91, 3, 70, "Section"], Cell[1833, 56, 557, 11, 137, "Text"], Cell[2393, 69, 66, 1, 39, "Input"], Cell[2462, 72, 65, 1, 39, "Input"], Cell[CellGroupData[{ Cell[2552, 77, 74, 0, 56, "Subsubsection"], Cell[2629, 79, 183, 4, 70, "Text"], Cell[2815, 85, 123, 2, 39, "Input"], Cell[2941, 89, 277, 5, 70, "Text"], Cell[3221, 96, 89, 1, 39, "Input"], Cell[3313, 99, 257, 4, 63, "Input"], Cell[3573, 105, 74, 1, 63, "Input"], Cell[3650, 108, 136, 4, 70, "Text"], Cell[3789, 114, 203, 3, 63, "Input"], Cell[3995, 119, 63, 1, 39, "Input"], Cell[4061, 122, 90, 1, 39, "Input"], Cell[4154, 125, 274, 6, 111, "Input"], Cell[4431, 133, 441, 8, 120, "Text"] }, Open ]], Cell[CellGroupData[{ Cell[4909, 146, 100, 3, 56, "Subsubsection"], Cell[5012, 151, 57, 0, 45, "Text"], Cell[5072, 153, 132, 2, 39, "Input"], Cell[5207, 157, 36, 0, 45, "Text"], Cell[5246, 159, 89, 1, 39, "Input"], Cell[5338, 162, 268, 4, 63, "Input"], Cell[5609, 168, 28, 0, 45, "Text"], Cell[5640, 170, 58, 1, 39, "Input"], Cell[5701, 173, 203, 3, 63, "Input"], Cell[5907, 178, 63, 1, 39, "Input"], Cell[5973, 181, 90, 1, 39, "Input"], Cell[6066, 184, 221, 5, 111, "Input"], Cell[6290, 191, 115, 3, 70, "Text"] }, Open ]], Cell[CellGroupData[{ Cell[6442, 199, 78, 0, 56, "Subsubsection"], Cell[6523, 201, 274, 5, 70, "Text"], Cell[6800, 208, 128, 2, 39, "Input"], Cell[6931, 212, 89, 1, 39, "Input"], Cell[7023, 215, 268, 4, 63, "Input"], Cell[7294, 221, 28, 0, 45, "Text"], Cell[7325, 223, 60, 1, 39, "Input"], Cell[7388, 226, 203, 3, 63, "Input"], Cell[7594, 231, 63, 1, 39, "Input"], Cell[7660, 234, 90, 1, 39, "Input"], Cell[7753, 237, 216, 5, 111, "Input"] }, Open ]], Cell[CellGroupData[{ Cell[8006, 247, 97, 3, 56, "Subsubsection"], Cell[8106, 252, 78, 0, 45, "Text"], Cell[8187, 254, 128, 2, 39, "Input"], Cell[8318, 258, 89, 1, 39, "Input"], Cell[8410, 261, 268, 4, 63, "Input"], Cell[8681, 267, 28, 0, 45, "Text"], Cell[8712, 269, 74, 1, 63, "Input"], Cell[8789, 272, 203, 3, 63, "Input"], Cell[8995, 277, 63, 1, 39, "Input"], Cell[9061, 280, 90, 1, 39, "Input"], Cell[9154, 283, 273, 6, 111, "Input"], Cell[9430, 291, 102, 3, 45, "Text"] }, Open ]], Cell[CellGroupData[{ Cell[9569, 299, 82, 1, 56, "Subsubsection"], Cell[9654, 302, 60, 0, 45, "Text"], Cell[9717, 304, 55, 1, 39, "Input"], Cell[9775, 307, 89, 1, 39, "Input"], Cell[9867, 310, 268, 4, 63, "Input"], Cell[10138, 316, 28, 0, 45, "Text"], Cell[10169, 318, 74, 1, 63, "Input"], Cell[10246, 321, 203, 3, 63, "Input"], Cell[10452, 326, 63, 1, 39, "Input"], Cell[10518, 329, 90, 1, 39, "Input"], Cell[10611, 332, 275, 6, 111, "Input"], Cell[10889, 340, 134, 3, 70, "Text"] }, Open ]] }, Open ]] } ] *) (*********************************************************************** End of Mathematica Notebook file. ***********************************************************************)