(*********************************************************************** Mathematica-Compatible Notebook This notebook can be used on any computer system with Mathematica 3.0, MathReader 3.0, or any compatible application. The data for the notebook starts with the line of 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[ 14502, 398]*) (*NotebookOutlinePosition[ 15180, 422]*) (* CellTagsIndexPosition[ 15136, 418]*) (*WindowFrame->Normal*) Notebook[{ Cell[CellGroupData[{ Cell["\<\ Qualitative Behavior of Non-linear Systems: A Competing Species \ Example\ \>", "Section"], Cell["\<\ Suppose that x(t) and y(t) are the populations (counted in , say, \ millions) of two different species living in the same environment at time \ t.Assuming that the two species compete for food, water, and space,one might \ imagine that the populations are governed roughly by the system of ODE's x' = x(1 - x- y) \t y' = y(2-4x-y) \t A fundamental idea for studying the qualitative behavior of solutions to \ nonlinear systems such as this one is to first determine the constant \ solutions, then consider the behavior of solutions near these constant \ solutions, and finally describe the entire phase portrait in terms of its \ behavior relative to the constant solutions. We proceed by first setting up the system and finding its critical points with the help of \ a direction field.\ \>", "Text"], Cell[BoxData[{ \(Needs["\"]\), \(Needs["\"]\)}], "Input"], Cell[BoxData[{ \(f[x_, y_]\ = \ .5 x \((1 - x - y)\)\), \(g[x_, y_]\ = \ y \((2 - 4 x - y)\)\t\)}], "Input"], Cell[BoxData[ \(\(PlotVectorField[{f[x, y], g[x, y]}, {x, 0, 1.5}, {y, 0, 2.5}, Axes -> \ True, \n\tScaleFunction \[Rule] \((1&)\), Ticks \[Rule] None, Frame \[Rule] True, AspectRatio \[Rule] 1, \ PlotPoints\ -> \ 25]; \)\)], "Input"], Cell["\<\ Why was the above choice of ranges for x and y a reasonable one? \ Think in terms of the situation we are trying to model. \t\t Critical points can be approximately detected with a direction field by looking for those places in which the vector field seems to be turning \ quite a lot. In this picture there appear to be three such places--roughly speaking, the points (.4,.5), (0,1.75), and (.9,0). We can improve these guesses with a little help:\ \>", "Text"], Cell[BoxData[{ \(FindRoot[{f[x, y]\ == \ 0, \ g[x, y]\ == \ 0}, \ {x, .4}, {y, .5}]\ \), \(FindRoot[{f[x, y]\ == \ 0, \ g[x, y]\ == \ 0}, \ {x, .9}, {y, 0}]\ \), \(FindRoot[{f[x, y]\ == \ 0, \ g[x, y]\ == \ 0}, \ {x, 0}, {y, 1.75}]\ \n\)}], "Input"], Cell["\<\ That is, (1/3, 2/3), (1,0), and (0,2) are the critical points. \ Note that we missed the critical point (x,y) = (0,0). \t Now we want to examine the behavior of solutions near each critical point in turn. First we pick on (1/3,2/3). The direction field nears this \ point looks like:\ \>", "Text"], Cell[BoxData[ \(\(PlotVectorField[{f[x, y], g[x, y]}, {x, 1/3 - .01, 1/3\ + .01}, { y, 2/3 - .01, 2/3 + .01}, \n\tAxesOrigin -> {1/3, 2/3}, \n\t Axes -> \ True, \n\tScaleFunction \[Rule] \((1&)\), Ticks \[Rule] None, Frame \[Rule] True, AspectRatio \[Rule] 1, \ PlotPoints\ -> \ 20]; \)\)], "Input"], Cell["\<\ This looks a bit like the vector field of a linear homogeneous constant coefficient system with one positive and one negative eigenvalue. Now we look at a phase portrait. Since the system is non-linear, we must use NDSolve to generate solution curves. We define a function to produce these solution given (in order) starting time t1 stopping time t2 x(0) a y(0) b Note that this will be most meaningful if t1<0", "Text"], Cell[BoxData[ \(\(soln[t1_, t2_, a_, b_]\ := \ {x[t], y[t]} /. First[\n\t\t\t NDSolve[\ {\(x'\)[t] == f[x[t], y[t]], \(y'\)[t] == g[x[t], y[t]], \n\t\t\t\t\t\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ x[0]\ == \ a, \ y[0]\ == \ b}, \n \t\t\t\t\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ {x[t], y[t]}, \n \t\t\t\t\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ {t, t1, t2}]\n\t\t\t] \n\)\)], "Input"], Cell[BoxData[ \(\(\n\(Show[\n\n ParametricPlot[\n\t\ \ Evaluate[ Table[\n\t\t\t soln[\(-4\), 4, 1/3 + s, 2/3 + .01], {s, \(- .01\), .01, .001} \n\t\t]], \n\t\ \ \ {t, \(-4\), 4}\n], \n ParametricPlot[\n\t\ \ Evaluate[ Table[\n\t\t\t soln[\(-4\), 4, 1/3 + s, 2/3 - .01], {s, \(- .01\), .01, .001} \n\t\t]], \n\t\ \ \ {t, \(-4\), 4}\n], \n\n\t AspectRatio -> Automatic, \n\tAxesOrigin -> {1/3, 2/3}, \n\t PlotRange -> {{1/3 - .01, 1/3 + .01}, {2/3 - .01, 2/3 + .01}}, \n\t Ticks \[Rule] None, \n\tFrame \[Rule] True\t\ \ \ \n]; \)\t\t\t\)\)], "Input"], Cell[BoxData[{ FormBox[ RowBox[{ "Again", ",", " ", \(this\ looks\ very\ much\ like\ the\ picture\ of\ linear\ homogeneous \ system\ of\ saddle\ type . \ \ In\ particular\), ",", " ", \(solutions\ that\ begin\ close\ to\ \((1/3, 2/3)\)\ tend\ to\ move\ away\ from\ this\ point\ when\ t\ gets\ large . \ \ For\ this\ reason\), ",", " ", RowBox[{ "we", " ", "refer", " ", "to", " ", \((1/3, 2/3)\), " ", "as", " ", "an", " ", StyleBox["unstable", FontSlant->"Italic"], StyleBox[" ", FontSlant->"Italic"], "critical", " ", \(point . \ \ To\), " ", "see", " ", "why", " ", "the"}]}], TextForm], FormBox[ \(phase\ portrait\ near\ this\ point\ looks\ the\ way\ it\ does, \ we\ compute\ a\ linearization\ of\ the\ \ system\ about\ the\ point\ \((1/3, 2/3)\) . \ That\ is, \ near\ this\ point\ we\ \(have : \n\t\t\n \((x - 1/3)\)'\ \[TildeTilde] \ \(f\_x\) \((x - 1/3)\)\ + \ \(f\_y\) \((y - 2/3)\)\)\), TextForm], FormBox[ RowBox[{ \(\((y - 2/3)\)'\ \[TildeTilde] \ \(g\_x\) \((x - 1/3)\)\ + \ \(g\_y\) \((y - 2/3)\)\), "\n"}], TextForm], FormBox[ RowBox[{ \(where\ all\ derivatives\ on\ the\ right\ side\ are\ evaluated\ at\ the\ point\ \((1/3, 2/3)\) . \ \ In\ matrix\ form, \ this\ is\ written\), "\n"}], TextForm], FormBox[ RowBox[{ RowBox[{"(", "\[NegativeThinSpace]", GridBox[{ {\(x' \((t)\) - 1/3\)}, {\(y' \((t)\) - 2/3\)} }], "\[NegativeThinSpace]", ")"}], " ", "=", " ", RowBox[{ RowBox[{"(", "\[NegativeThinSpace]", GridBox[{ {\(f\_x\), \(f\_y\)}, {\(g\_x\), \(g\_y\)} }], "\[NegativeThinSpace]", ")"}], RowBox[{ RowBox[{"(", "\[NegativeThinSpace]", GridBox[{ {\(x \((t)\) - 1/3\)}, {\(y \((t)\) - 2/3\)} }], "\[NegativeThinSpace]", ")"}], ".", "\n", "\n", "The"}], " ", "matrix", " ", "on", " ", "the", " ", "right", " ", "side", " ", "is", " ", "the", " ", "Jacobian", " ", "matrix", " ", "of", " ", "the", " ", "vector", " ", "function", " ", "f", \(\((x, y)\) . \ We\), " ", "compute", " ", "this", " ", "and", " ", "examine", " ", "the", " ", "corresponding", " ", "linear", " ", \(system . \)}]}], TextForm]}], "Text"], Cell[BoxData[ \(Jac[x_, y_]\ = \ {{D[f[x, y], x], D[f[x, y], y]}, \n\t\t{D[g[x, y], x], D[g[x, y], y]}} \)], "Input"], Cell[BoxData[ \(MatrixForm[%]\)], "Input"], Cell[BoxData[ \(A\ = \ Jac[1/3, 2/3]\)], "Input"], Cell[BoxData[ \(\(PlotVectorField[ A . {x, y}, {x, \(- .01\), .01}, {y, \(- .01\), .01}, \n\t Axes -> \ True, \n\tScaleFunction \[Rule] \((1&)\), Ticks \[Rule] None, Frame \[Rule] True, AspectRatio \[Rule] 1, \ PlotPoints\ -> \ 20]; \)\)], "Input"], Cell["\<\ This looks exactly like the direction field picture for the orginal \ system near (1/3,2/3). \ \>", "Text"], Cell[BoxData[ \(rhs = \ A . {x[t], y[t]}\)], "Input"], Cell[BoxData[ \(system\ = \ {\(x'\)[t]\ == \ Part[rhs, 1], \ \(y'\)[t]\ == \n\t\t\t\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ Part[rhs, 2], \ x[0] == a, y[0]\ == \ b}\)], "Input"], Cell[BoxData[ \(linsoln[a_, b_]\ = \ Simplify[{x[t], y[t]} /. First[\n\t\t\ DSolve[system, {x[t], y[t]}, t]\n\t\t]]\)], "Input"], Cell[BoxData[""], "Input"], Cell[BoxData[ \(\(\n\(Show[\n\n ParametricPlot[\n\t\ \ Evaluate[ Table[\n\t\t\tlinsoln[s, .01], {s, \(- .01\), .01, .001}\n \t\t]], \n\t\ \ \ {t, \(-4\), 4}\n], \n ParametricPlot[\n\t\ \ Evaluate[ Table[\n\t\t\tlinsoln[s, \(- .01\)], {s, \(- .01\), .01, .001}\n \t\t]], \n\t\ \ \ {t, \(-4\), 4}\n], \n\t\t AspectRatio -> Automatic, \n\tAxesOrigin -> {0, 0}, \n\t PlotRange -> {{\(- .01\), .01}, {\(- .01\), .01}}, \n\t Ticks \[Rule] None, \n\tFrame \[Rule] True\t\ \ \ \n]; \)\t\t\t\)\)], "Input"], Cell["\<\ The phase portrait also matches with that of the original system.\ \ \>", "Text"], Cell[BoxData[ \(Now\ we\ turn\ to\ the\ other\ critical\ points\ of\ our\ example, \ examining\ these\ in\ somewhat\ less\ detail\ than\ the\ first\ \(one . \)\)], "Input"], Cell[CellGroupData[{ Cell["(x,y) = (0,0).", "Subsubsection"], Cell["The Jacobian matrix of (f,g) at this point is ", "Text"], Cell[BoxData[ \(A\ = \ Jac[0, 0]\)], "Input"], Cell["If we look at the eigenvalues of A", "Text"], Cell[BoxData[ \(Eigenvalues[A]\)], "Input"], Cell["\<\ we see that the linear system associated to the point (0,0) has a \ source at the origin. In particular, all solutions that begin near the \ origin move away as t increases and (0,0) is an unstable critical point of \ the orginal system. This can be seen by looking at a direction field near \ (0,0):\ \>", "Text"], Cell[BoxData[ \(\(PlotVectorField[{f[x, y], g[x, y]}, {x, \(- .01\), .01}, {y, \(- .01\), .01}, \n\tAxesOrigin -> {0, 0}, \n\tAxes -> \ True, \n\t ScaleFunction \[Rule] \((1&)\), Ticks \[Rule] None, Frame \[Rule] True, AspectRatio \[Rule] 1, \ PlotPoints\ -> \ 20]; \)\)], "Input"] }, Open ]], Cell[CellGroupData[{ Cell["(x,y) = (1,0)", "Subsubsection"], Cell[BoxData[ \(A\ = \ Jac[1, 0]\)], "Input"], Cell[BoxData[ \(Eigenvalues[A]\)], "Input"], Cell["\<\ This time we have a sink in the associated linear system. Thus \ (1,0) is a stable critical point.\ \>", "Text"], Cell[BoxData[ \(\(PlotVectorField[{f[x, y], g[x, y]}, {x, 1 - .01, 1\ + .01}, {y, \(- .01\), .01}, \n\tAxesOrigin -> {1, 0}, \n\tAxes -> \ True, \n\t ScaleFunction \[Rule] \((1&)\), Ticks \[Rule] None, Frame \[Rule] True, AspectRatio \[Rule] 1, \ PlotPoints\ -> \ 20]; \)\)], "Input"] }, Open ]], Cell[CellGroupData[{ Cell["(x,y) =(0,2)", "Subsubsection"], Cell[BoxData[ \(A\ = \ Jac[0, 2]\)], "Input"], Cell[BoxData[ \(Eigenvalues[A]\)], "Input"], Cell["\<\ Again, a sink. The point (0,2) is also a stable critical \ point.\ \>", "Text"], Cell["\<\ Now we know more or less how solutions of our system behave near \ each critical point. It remains to understand the global behavior of the system. To this end we plot some trajectories on a larger scale. We will \ take our initial conditions in the first quadrant along the line 2x + y = \ 1.\ \>", "Text"], Cell[BoxData[ \(\(Show[\n\t\n ParametricPlot[\n\t\ \ Evaluate[ Table[\n\t\t\tsoln[\(-2\), 3, s, 1 - 2 s], {s, 0, .5, .025}\n \t\t]], \n\t\ \ \ {t, \(-2\), 3}\n], \n ParametricPlot[\n\t\ \ Evaluate[ Table[\n\t\t\tsoln[\(-2\), 3, s, 4 - 2 s], {s, 0, 2, .05}\n \t\t]], \n\t\ \ \ {t, \(-2\), 3}\n], \n\tAspectRatio -> 1, \n\t PlotRange -> {{0, 1}, {0, 2}}, \n\tTicks \[Rule] None, \n\t Frame \[Rule] True\t\ \ \ \n]; \)\)], "Input"], Cell[TextData[{ "Notice that there are two distinguished solution curves implied in this \ picture--both passing through the saddle point at (1/3,2/3). One of the \ curves joins the two sinks (1,0) and(0,2). The other joins the source (0,0) \ to the saddle (1/3,2/3) and seems to separate solutions that converge to \ (1,0) as t goes to infinity from those that converge to(0,2). These curves \ are called ", StyleBox["separatrices", FontSlant->"Italic"], " for the system. There is a general theorem due to Poincare\nand \ Bendixson that describes the possible limiting behaviors of a 2 x 2\nsystem \ in terms of separatrices and critical points. This example illustrates\nsome \ of the flavor of that theorem." }], "Text"] }, Open ]] }, Open ]] }, FrontEndVersion->"X 3.0", ScreenRectangle->{{0, 1280}, {0, 1024}}, ScreenStyleEnvironment->"Presentation", WindowSize->{565, 559}, WindowMargins->{{Automatic, 285}, {Automatic, 150}} ] (*********************************************************************** 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[1731, 51, 101, 3, 97, "Section"], Cell[1835, 56, 817, 17, 388, "Text"], Cell[2655, 75, 115, 2, 63, "Input"], Cell[2773, 79, 122, 2, 63, "Input"], Cell[2898, 83, 258, 4, 135, "Input"], Cell[3159, 89, 475, 9, 204, "Text"], Cell[3637, 100, 287, 6, 183, "Input"], Cell[3927, 108, 310, 7, 158, "Text"], Cell[4240, 117, 335, 5, 207, "Input"], Cell[4578, 124, 730, 17, 388, "Text"], Cell[5311, 143, 466, 9, 207, "Input"], Cell[5780, 154, 686, 15, 615, "Input"], Cell[6469, 171, 2606, 57, 443, "Text"], Cell[9078, 230, 137, 3, 63, "Input"], Cell[9218, 235, 46, 1, 39, "Input"], Cell[9267, 238, 54, 1, 39, "Input"], Cell[9324, 241, 279, 5, 159, "Input"], Cell[9606, 248, 118, 3, 66, "Text"], Cell[9727, 253, 57, 1, 39, "Input"], Cell[9787, 256, 201, 4, 63, "Input"], Cell[9991, 262, 151, 3, 111, "Input"], Cell[10145, 267, 26, 0, 39, "Input"], Cell[10174, 269, 603, 13, 519, "Input"], Cell[10780, 284, 91, 3, 43, "Text"], Cell[10874, 289, 188, 3, 87, "Input"], Cell[CellGroupData[{ Cell[11087, 296, 39, 0, 56, "Subsubsection"], Cell[11129, 298, 62, 0, 43, "Text"], Cell[11194, 300, 50, 1, 39, "Input"], Cell[11247, 303, 50, 0, 43, "Text"], Cell[11300, 305, 47, 1, 39, "Input"], Cell[11350, 308, 327, 6, 112, "Text"], Cell[11680, 316, 310, 4, 183, "Input"] }, Open ]], Cell[CellGroupData[{ Cell[12027, 325, 38, 0, 56, "Subsubsection"], Cell[12068, 327, 50, 1, 39, "Input"], Cell[12121, 330, 47, 1, 39, "Input"], Cell[12171, 333, 123, 3, 66, "Text"], Cell[12297, 338, 315, 4, 183, "Input"] }, Open ]], Cell[CellGroupData[{ Cell[12649, 347, 37, 0, 56, "Subsubsection"], Cell[12689, 349, 50, 1, 39, "Input"], Cell[12742, 352, 47, 1, 39, "Input"], Cell[12792, 355, 90, 3, 43, "Text"], Cell[12885, 360, 320, 6, 112, "Text"], Cell[13208, 368, 523, 11, 471, "Input"], Cell[13734, 381, 740, 13, 227, "Text"] }, Open ]] }, Open ]] } ] *) (*********************************************************************** End of Mathematica Notebook file. ***********************************************************************)