(* Content-type: application/vnd.wolfram.mathematica *) (*** Wolfram Notebook File ***) (* http://www.wolfram.com/nb *) (* CreatedBy='Mathematica 8.0' *) (*CacheID: 234*) (* Internal cache information: NotebookFileLineBreakTest NotebookFileLineBreakTest NotebookDataPosition[ 157, 7] NotebookDataLength[ 26015, 657] NotebookOptionsPosition[ 24784, 610] NotebookOutlinePosition[ 25429, 635] CellTagsIndexPosition[ 25386, 632] WindowTitle->Predator-Prey Equations - Source WindowFrame->Normal*) (* Beginning of Notebook Content *) Notebook[{ Cell[CellGroupData[{ Cell["Predator-Prey Equations", "Section", CellFrame->{{0, 0}, {0, 0}}, ShowCellBracket->False, FontColor->RGBColor[0.597406, 0, 0.0527047]], Cell[BoxData[ GraphicsBox[RasterBox[CompressedData[" 1:eJztnVuSozgWQDNiPqa3MJ+zpVlCbaB3WlGVNV9dvYH6TQRUph/ZGIHQmwvG xoZzQu3Aku7VfUj4Nk53//fLn//78q+Xl5f/NP/88e+Xl8v154Xj5+fp89y0 4+X63L7VnQu02XqOt9FzjRK5qtRMoYZFpk11/Ji+WDye92+r7+fFfbnGkuu9 eIQ4LBVJ+YRo5DPnRdITDp0TLRg6m/62nY/n08f5+H461G37fWqum57z4Xy2 jby0prMZOh4/jodLOx2bt6fzRSEA3B/KMKGSBy/DSKVcyYOn8krHqajvqed6 G6iol4qkfAIVNQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADsizPA/lj72AEA AMCmWLu0AXh01j6jAAAAcdb+hNwUJ5e1zZnPDEeey/e1jx0AAABsirVLm03x XFVlhs1X1JNY+4wCAAB02B9PJ4BdsvYpBAAAgOeGihpADo9GAUDIr+Lnr7ef a9vw16/i73VtMPx6+2v1gGwMijeAE89FAQA2DRW1BxX14lBRA0wi+lx0baMA AAAAAAAAAAAAbkj0uegR4L4cDoe1TYA1YQMAbIaDy9rm3JU9+w4AjwB3np3D BgDYDHuuKu/su3k0ynNRACGLHMy93dm2ijCPpHvD7LliAQAAmA0VNRioqIGK GlYk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C ys+f+tE5aZVoBSU0T87U+sr2emq4Ur7k9eQrhydiaqiF3LqSX4QFfacMk684 yaT7l2GkUr7iJJOoqKMrUlGPritxZ9RyT9aIUFHn133e3IVQUQvVUlHPhor6 1r6r/k9G9X1A/47+dDrZ/9+lb9++vbr8+PHDe7X7w077rafHU+JNTo1GF/Wu U52hhtCjqGEZJVGdoZsp5ZmZoRe2kc3Fd0tnKGKvJQ9UKr8pRh15dY0MZTOO e/pTa43OSUmFpn5Pbzzv7agveTNCJRnZ70FCX4OU5ZWn9KfiELrpLZ3aIZn0 RYmGN+NRPsIpd7y19pa7qIhQZ15coicVmamMLjpb1SLmLUgmzlOtzau6RRAm bYxFTJoh9Vy+U4aNKonqDN1MKc/MDL2wjXydWIaRylElz5LKVExSS2Scigqm HHl1jQxlM457+lNrjc5JSYWmUlF7jqQ2RmqHZNIXJRrejEf5CKfc8dbaW+6i IkKdeXGJnlRkpjK66GxVi5i3IJk4T7U2r+oWQZi0MRYxaYbUZnyPLvH/lte2 FP/69esnAAAAAAAAAAAAwM74B4thROM= "], {{0, 0}, {1800, 25}}, {0, 255}, ColorFunction->RGBColor], ImageSize->{1800, 25}, PlotRange->{{0, 1800}, {0, 25}}]], "Section", CellFrame->{{0, 0}, {0, 0}}, ShowCellBracket->False], Cell[BoxData[ RowBox[{ RowBox[{ RowBox[{"LotkaVolterra", "[", RowBox[{ RowBox[{"{", RowBox[{"a_", ",", "b_", ",", "c_", ",", "d_"}], "}"}], ",", RowBox[{"{", RowBox[{"x0_", ",", "y0_"}], "}"}], ",", "t1_"}], "]"}], ":=", RowBox[{"Module", "[", RowBox[{ RowBox[{"{", RowBox[{"x", ",", "y", ",", "t"}], "}"}], ",", "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"{", RowBox[{"x", ",", "y"}], "}"}], "/.", RowBox[{"Quiet", "[", RowBox[{"NDSolve", "[", RowBox[{ RowBox[{"{", "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{ RowBox[{"x", "'"}], "[", "t", "]"}], "\[Equal]", RowBox[{ RowBox[{"a", " ", RowBox[{"x", "[", "t", "]"}]}], "-", RowBox[{"b", " ", RowBox[{"x", "[", "t", "]"}], " ", RowBox[{"y", "[", "t", "]"}]}]}]}], ",", "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"y", "'"}], "[", "t", "]"}], "\[Equal]", RowBox[{ RowBox[{ RowBox[{"-", "c"}], " ", RowBox[{"y", "[", "t", "]"}]}], "+", RowBox[{"d", " ", RowBox[{"x", "[", "t", "]"}], RowBox[{"y", "[", "t", "]"}]}]}]}], ",", "\[IndentingNewLine]", RowBox[{ RowBox[{"x", "[", "0", "]"}], "\[Equal]", "x0"}], ",", "\[IndentingNewLine]", RowBox[{ RowBox[{"y", "[", "0", "]"}], "\[Equal]", "y0"}]}], "\[IndentingNewLine]", "}"}], ",", RowBox[{"{", RowBox[{"x", ",", "y"}], "}"}], ",", RowBox[{"{", RowBox[{"t", ",", "0", ",", "t1"}], "}"}]}], "]"}], "]"}]}], "//", "Flatten"}]}], "\[IndentingNewLine]", "]"}]}], ";"}]], "Input", CellChangeTimes->{ 3.35696210375764*^9, 3.38849416475426*^9, {3.3885146417023892`*^9, 3.3885146479679737`*^9}}, CellID->1146107253], Cell[BoxData[ RowBox[{"Manipulate", "[", "\[IndentingNewLine]", RowBox[{ RowBox[{"Module", "[", "\[IndentingNewLine]", RowBox[{ RowBox[{"{", RowBox[{"soln", ",", RowBox[{"col1", "=", RowBox[{"RGBColor", "[", RowBox[{"1", ",", ".47", ",", "0"}], "]"}]}], ",", RowBox[{"col2", "=", RowBox[{"ColorData", "[", RowBox[{"\"\\"", ",", "\"\\""}], "]"}]}]}], "}"}], ",", "\[IndentingNewLine]", RowBox[{"Plot", "[", RowBox[{ RowBox[{"Evaluate", "[", RowBox[{ RowBox[{ RowBox[{"{", RowBox[{ RowBox[{ RowBox[{"#", "[", RowBox[{"[", "1", "]"}], "]"}], "[", "t", "]"}], ",", RowBox[{ RowBox[{"#", "[", RowBox[{"[", "2", "]"}], "]"}], "[", "t", "]"}]}], "}"}], "&"}], "[", RowBox[{"soln", "=", RowBox[{"Quiet", "@", RowBox[{"LotkaVolterra", "[", RowBox[{ RowBox[{"{", RowBox[{"a", ",", "b", ",", "c", ",", "d"}], "}"}], ",", RowBox[{"{", RowBox[{"prey0", ",", "predator0"}], "}"}], ",", "tmax"}], "]"}]}]}], "]"}], "]"}], ",", RowBox[{"{", RowBox[{"t", ",", "0", ",", RowBox[{"Min", "[", RowBox[{"tmax", ",", RowBox[{"Min", "[", RowBox[{ RowBox[{ RowBox[{"#", "[", RowBox[{"[", RowBox[{"1", ",", "1", ",", "2"}], "]"}], "]"}], "&"}], "/@", "soln"}], "]"}]}], "]"}]}], "}"}], ",", "\[IndentingNewLine]", RowBox[{"AxesLabel", "\[Rule]", RowBox[{"TraditionalForm", "/@", RowBox[{"{", RowBox[{"t", ",", RowBox[{"{", RowBox[{ RowBox[{"Style", "[", RowBox[{ RowBox[{"prey", "[", "t", "]"}], ",", "col1"}], "]"}], ",", RowBox[{"Style", "[", RowBox[{ RowBox[{"predator", "[", "t", "]"}], ",", "col2"}], "]"}]}], "}"}]}], "}"}]}]}], ",", "\[IndentingNewLine]", RowBox[{"PlotRange", "\[Rule]", "All"}], ",", RowBox[{"AxesOrigin", "\[Rule]", RowBox[{"{", RowBox[{"0", ",", "0"}], "}"}]}], ",", RowBox[{"PlotStyle", "\[Rule]", RowBox[{"{", RowBox[{"col1", ",", "col2"}], "}"}]}], ",", RowBox[{"ImageSize", "\[Rule]", RowBox[{"{", RowBox[{"400", ",", "300"}], "}"}]}], ",", RowBox[{"ImagePadding", "\[Rule]", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"40", ",", "10"}], "}"}], ",", RowBox[{"{", RowBox[{"10", ",", "25"}], "}"}]}], "}"}]}]}], "]"}]}], "\[IndentingNewLine]", "]"}], ",", "\[IndentingNewLine]", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"a", ",", "1", ",", "\"\\""}], "}"}], ",", RowBox[{"-", "5"}], ",", "5", ",", ".01", ",", RowBox[{"ImageSize", "\[Rule]", "Tiny"}], ",", RowBox[{"Appearance", "\[Rule]", "\"\\""}]}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"b", ",", "1", ",", "\"\\""}], "}"}], ",", RowBox[{"-", "5"}], ",", "5", ",", ".01", ",", RowBox[{"ImageSize", "\[Rule]", "Tiny"}], ",", RowBox[{"Appearance", "\[Rule]", "\"\\""}]}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"c", ",", "1", ",", "\"\\""}], "}"}], ",", RowBox[{"-", "5"}], ",", "5", ",", ".01", ",", RowBox[{"ImageSize", "\[Rule]", "Tiny"}], ",", RowBox[{"Appearance", "\[Rule]", "\"\\""}]}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"d", ",", "1", ",", "\"\\""}], "}"}], ",", RowBox[{"-", "5"}], ",", "5", ",", ".01", ",", RowBox[{"ImageSize", "\[Rule]", "Tiny"}], ",", RowBox[{"Appearance", "\[Rule]", "\"\\""}]}], "}"}], ",", "Delimiter", ",", "\[IndentingNewLine]", "\"\\"", ",", "\[IndentingNewLine]", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"prey0", ",", "3", ",", "\"\\""}], "}"}], ",", "0", ",", "20", ",", RowBox[{"ImageSize", "\[Rule]", "Tiny"}]}], "}"}], ",", "\[IndentingNewLine]", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"predator0", ",", "5", ",", "\"\\""}], "}"}], ",", "0", ",", "20", ",", RowBox[{"ImageSize", "\[Rule]", "Tiny"}]}], "}"}], ",", "Delimiter", ",", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"tmax", ",", "40", ",", "\"\\""}], "}"}], ",", ".01", ",", "50", ",", RowBox[{"ImageSize", "\[Rule]", "Tiny"}]}], "}"}], ",", "\[IndentingNewLine]", RowBox[{"SaveDefinitions", "\[Rule]", "True"}], ",", RowBox[{"ControlPlacement", "\[Rule]", "Left"}]}], "]"}]], "Input", CellChangeTimes->{ 3.35696210375764*^9, {3.38849232586578*^9, 3.3884923459083977`*^9}, { 3.3884923791442013`*^9, 3.388492546402371*^9}, {3.388492616771439*^9, 3.388492741548943*^9}, {3.388493491310792*^9, 3.388493502357795*^9}, { 3.3884941734885793`*^9, 3.388494176832308*^9}, {3.3884942502068377`*^9, 3.388494292456568*^9}, {3.388495630838627*^9, 3.3884957947125783`*^9}, 3.388495959383399*^9, {3.3884959991175203`*^9, 3.3884960450703506`*^9}, { 3.3884961857413254`*^9, 3.3884962017255983`*^9}, {3.3887558778098125`*^9, 3.3887558825754375`*^9}, 3.3887559295598125`*^9, {3.3887560458566875`*^9, 3.3887560459348125`*^9}, {3.3887620164858017`*^9, 3.38876202036954*^9}, { 3.3887621202330437`*^9, 3.388762120483029*^9}, {3.389014094913168*^9, 3.389014171069418*^9}, {3.3902380435959325`*^9, 3.3902380436896825`*^9}}] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ TagBox[ StyleBox[ DynamicModuleBox[{$CellContext`a$$ = 1, $CellContext`b$$ = 1, $CellContext`c$$ = 1, $CellContext`d$$ = 1, $CellContext`predator0$$ = 5, $CellContext`prey0$$ = 3, $CellContext`tmax$$ = 40, Typeset`show$$ = True, Typeset`bookmarkList$$ = {}, Typeset`bookmarkMode$$ = "Menu", Typeset`animator$$, Typeset`animvar$$ = 1, Typeset`name$$ = "\"untitled\"", Typeset`specs$$ = {{{ Hold[$CellContext`a$$], 1, "A"}, -5, 5, 0.01}, {{ Hold[$CellContext`b$$], 1, "B"}, -5, 5, 0.01}, {{ Hold[$CellContext`c$$], 1, "C"}, -5, 5, 0.01}, {{ Hold[$CellContext`d$$], 1, "D"}, -5, 5, 0.01}, { Hold["initial populations"], Manipulate`Dump`ThisIsNotAControl}, {{ Hold[$CellContext`prey0$$], 3, "prey"}, 0, 20}, {{ Hold[$CellContext`predator0$$], 5, "predator"}, 0, 20}, {{ Hold[$CellContext`tmax$$], 40, "maximum time"}, 0.01, 50}}, Typeset`size$$ = {400., {148., 152.}}, Typeset`update$$ = 0, Typeset`initDone$$, Typeset`skipInitDone$$ = False, $CellContext`a$638$$ = 0, $CellContext`b$639$$ = 0, $CellContext`c$640$$ = 0, $CellContext`d$641$$ = 0, $CellContext`prey0$642$$ = 0, $CellContext`predator0$643$$ = 0, $CellContext`tmax$644$$ = 0}, DynamicBox[Manipulate`ManipulateBoxes[ 1, StandardForm, "Variables" :> {$CellContext`a$$ = 1, $CellContext`b$$ = 1, $CellContext`c$$ = 1, $CellContext`d$$ = 1, $CellContext`predator0$$ = 5, $CellContext`prey0$$ = 3, $CellContext`tmax$$ = 40}, "ControllerVariables" :> { Hold[$CellContext`a$$, $CellContext`a$638$$, 0], Hold[$CellContext`b$$, $CellContext`b$639$$, 0], Hold[$CellContext`c$$, $CellContext`c$640$$, 0], Hold[$CellContext`d$$, $CellContext`d$641$$, 0], Hold[$CellContext`prey0$$, $CellContext`prey0$642$$, 0], Hold[$CellContext`predator0$$, $CellContext`predator0$643$$, 0], Hold[$CellContext`tmax$$, $CellContext`tmax$644$$, 0]}, "OtherVariables" :> { Typeset`show$$, Typeset`bookmarkList$$, Typeset`bookmarkMode$$, Typeset`animator$$, Typeset`animvar$$, Typeset`name$$, Typeset`specs$$, Typeset`size$$, Typeset`update$$, Typeset`initDone$$, Typeset`skipInitDone$$}, "Body" :> Module[{$CellContext`soln$, $CellContext`col1$ = RGBColor[1, 0.47, 0], $CellContext`col2$ = ColorData["HTML", "SlateBlue"]}, Plot[ Evaluate[ ({ Part[#, 1][$CellContext`t], Part[#, 2][$CellContext`t]}& )[$CellContext`soln$ = Quiet[ $CellContext`LotkaVolterra[{$CellContext`a$$, $CellContext`b$$, \ $CellContext`c$$, $CellContext`d$$}, {$CellContext`prey0$$, \ $CellContext`predator0$$}, $CellContext`tmax$$]]]], {$CellContext`t, 0, Min[$CellContext`tmax$$, Min[ Map[Part[#, 1, 1, 2]& , $CellContext`soln$]]]}, AxesLabel -> Map[TraditionalForm, {$CellContext`t, { Style[ $CellContext`prey[$CellContext`t], $CellContext`col1$], Style[ $CellContext`predator[$CellContext`t], $CellContext`col2$]}}], PlotRange -> All, AxesOrigin -> {0, 0}, PlotStyle -> {$CellContext`col1$, $CellContext`col2$}, ImageSize -> {400, 300}, ImagePadding -> {{40, 10}, {10, 25}}]], "Specifications" :> {{{$CellContext`a$$, 1, "A"}, -5, 5, 0.01, ImageSize -> Tiny, Appearance -> "Labeled"}, {{$CellContext`b$$, 1, "B"}, -5, 5, 0.01, ImageSize -> Tiny, Appearance -> "Labeled"}, {{$CellContext`c$$, 1, "C"}, -5, 5, 0.01, ImageSize -> Tiny, Appearance -> "Labeled"}, {{$CellContext`d$$, 1, "D"}, -5, 5, 0.01, ImageSize -> Tiny, Appearance -> "Labeled"}, Delimiter, "initial populations", {{$CellContext`prey0$$, 3, "prey"}, 0, 20, ImageSize -> Tiny}, {{$CellContext`predator0$$, 5, "predator"}, 0, 20, ImageSize -> Tiny}, Delimiter, {{$CellContext`tmax$$, 40, "maximum time"}, 0.01, 50, ImageSize -> Tiny}}, "Options" :> {ControlPlacement -> Left}, "DefaultOptions" :> {ControllerLinking -> True}], ImageSizeCache->{637., {176., 181.}}, SingleEvaluation->True], Deinitialization:>None, DynamicModuleValues:>{}, Initialization:>(({$CellContext`LotkaVolterra[{ Pattern[$CellContext`a, Blank[]], Pattern[$CellContext`b, Blank[]], Pattern[$CellContext`c, Blank[]], Pattern[$CellContext`d, Blank[]]}, { Pattern[$CellContext`x0, Blank[]], Pattern[$CellContext`y0, Blank[]]}, Pattern[$CellContext`t1, Blank[]]] := Module[{$CellContext`x, $CellContext`y, $CellContext`t}, Flatten[ ReplaceAll[{$CellContext`x, $CellContext`y}, Quiet[ NDSolve[{ Derivative[ 1][$CellContext`x][$CellContext`t] == $CellContext`a \ $CellContext`x[$CellContext`t] - ($CellContext`b \ $CellContext`x[$CellContext`t]) $CellContext`y[$CellContext`t], Derivative[ 1][$CellContext`y][$CellContext`t] == (-$CellContext`c) \ $CellContext`y[$CellContext`t] + ($CellContext`d \ $CellContext`x[$CellContext`t]) $CellContext`y[$CellContext`t], \ $CellContext`x[0] == $CellContext`x0, $CellContext`y[ 0] == $CellContext`y0}, {$CellContext`x, $CellContext`y}, \ {$CellContext`t, 0, $CellContext`t1}]]]]], Attributes[Derivative] = {NHoldAll, ReadProtected}, Attributes[PlotRange] = {ReadProtected}}; Typeset`initDone$$ = True); ReleaseHold[ HoldComplete[{$CellContext`LotkaVolterra[{ Pattern[$CellContext`a, Blank[]], Pattern[$CellContext`b, Blank[]], Pattern[$CellContext`c, Blank[]], Pattern[$CellContext`d, Blank[]]}, { Pattern[$CellContext`x0, Blank[]], Pattern[$CellContext`y0, Blank[]]}, Pattern[$CellContext`t1, Blank[]]] := Module[{$CellContext`x, $CellContext`y, $CellContext`t}, Flatten[ ReplaceAll[{$CellContext`x, $CellContext`y}, Quiet[ NDSolve[{ Derivative[ 1][$CellContext`x][$CellContext`t] == $CellContext`a \ $CellContext`x[$CellContext`t] - $CellContext`b \ $CellContext`x[$CellContext`t] $CellContext`y[$CellContext`t], Derivative[ 1][$CellContext`y][$CellContext`t] == (-$CellContext`c) \ $CellContext`y[$CellContext`t] + $CellContext`d \ $CellContext`x[$CellContext`t] $CellContext`y[$CellContext`t], $CellContext`x[ 0] == $CellContext`x0, $CellContext`y[ 0] == $CellContext`y0}, {$CellContext`x, $CellContext`y}, \ {$CellContext`t, 0, $CellContext`t1}]]]]]; Null}]]; Typeset`initDone$$ = True), SynchronousInitialization->True, UnsavedVariables:>{Typeset`initDone$$}, UntrackedVariables:>{Typeset`size$$}], "Manipulate", Deployed->True, StripOnInput->False], Manipulate`InterpretManipulate[1]]], "Output", CellID->636251345], Cell[CellGroupData[{ Cell["CAPTION", "Section", CellFrame->{{0, 0}, {1, 0}}, CellFrameColor->RGBColor[0.87, 0.87, 0.87], FontFamily->"Helvetica", FontSize->12, FontWeight->"Bold", FontColor->RGBColor[0.597406, 0, 0.0527047]], Cell[TextData[{ "The Lotka\[Dash]Volterra equations describe an ecological predator-prey (or \ parasite-host) model which assumes that, for a set of fixed positive \ constants ", Cell[BoxData[ FormBox["A", TraditionalForm]], "InlineMath"], " (the growth rate of prey), ", Cell[BoxData[ FormBox["B", TraditionalForm]], "InlineMath"], " ", Cell[BoxData[ FormBox[Cell["", "InlineMath"], TraditionalForm]]], "(the rate at which predators destroy prey), ", Cell[BoxData[ FormBox["C", TraditionalForm]], "InlineMath"], " (the death rate of predators), and ", Cell[BoxData[ FormBox["D", TraditionalForm]], "InlineMath"], " (the rate at which predators increase by consuming prey), certain simple \ conditions hold in the population change rates for prey and predator. (from \ Wolfram ", StyleBox["MathWorld", FontSlant->"Italic"], ")" }], "Text"] }, Close]] }, Open ]], Cell[CellGroupData[{ Cell["THIS NOTEBOOK IS THE SOURCE CODE FROM", "Text", CellFrame->{{0, 0}, {0, 0}}, CellMargins->{{48, 10}, {4, 28}}, CellGroupingRules->{"SectionGrouping", 25}, CellFrameMargins->{{48, 48}, {6, 5}}, CellFrameColor->RGBColor[0.87, 0.87, 0.87], FontFamily->"Helvetica", FontSize->10, FontWeight->"Bold", FontColor->RGBColor[0.597406, 0, 0.0527047]], Cell[TextData[{ "\"", ButtonBox["Predator-Prey Equations", BaseStyle->"Hyperlink", ButtonData->{ URL["http://demonstrations.wolfram.com/PredatorPreyEquations/"], None}, ButtonNote->"http://demonstrations.wolfram.com/PredatorPreyEquations/"], "\"", " from ", ButtonBox["the Wolfram Demonstrations Project", BaseStyle->"Hyperlink", ButtonData->{ URL["http://demonstrations.wolfram.com/"], None}, ButtonNote->"http://demonstrations.wolfram.com/"], "\[ParagraphSeparator]\[NonBreakingSpace]", ButtonBox["http://demonstrations.wolfram.com/PredatorPreyEquations/", BaseStyle->"Hyperlink", ButtonData->{ URL["http://demonstrations.wolfram.com/PredatorPreyEquations/"], None}, ButtonNote->"http://demonstrations.wolfram.com/PredatorPreyEquations/"] }], "Text", CellMargins->{{48, Inherited}, {0, Inherited}}, FontFamily->"Verdana", FontSize->10, FontColor->GrayLevel[0.5]], Cell[TextData[{ "Contributed by: ", ButtonBox["Eric W. Weisstein", BaseStyle->"Hyperlink", ButtonData->{ URL["http://demonstrations.wolfram.com/author.html?author=Eric+W.+\ Weisstein"], None}, ButtonNote-> "http://demonstrations.wolfram.com/author.html?author=Eric+W.+Weisstein"] }], "Text", CellDingbat->"\[FilledSmallSquare]", CellMargins->{{66, 48}, {2, 4}}, FontFamily->"Verdana", FontSize->10, FontColor->GrayLevel[0.6]], Cell[CellGroupData[{ Cell[TextData[{ "A full-function Wolfram ", StyleBox["Mathematica", FontSlant->"Italic"], " system (Version 6 or higher) is required to edit this notebook.\n", StyleBox[ButtonBox["GET WOLFRAM MATHEMATICA \[RightGuillemet]", BaseStyle->"Hyperlink", ButtonData->{ URL["http://www.wolfram.com/products/mathematica/"], None}, ButtonNote->"http://www.wolfram.com/products/mathematica/"], FontFamily->"Helvetica", FontWeight->"Bold", FontSlant->"Italic", FontColor->RGBColor[1, 0.42, 0]] }], "Text", CellFrame->True, CellMargins->{{48, 68}, {8, 28}}, CellFrameMargins->12, CellFrameColor->RGBColor[0.87, 0.87, 0.87], CellChangeTimes->{3.3750111182355957`*^9}, ParagraphSpacing->{1., 1.}, FontFamily->"Verdana", FontSize->10, FontColor->GrayLevel[0.411765], Background->RGBColor[1, 1, 1]], Cell[TextData[{ "\[Copyright] ", StyleBox[ButtonBox["Wolfram Demonstrations Project & Contributors", BaseStyle->"Hyperlink", ButtonData->{ URL["http://demonstrations.wolfram.com/"], None}, ButtonNote->"http://demonstrations.wolfram.com/"], FontColor->GrayLevel[0.6]], "\[ThickSpace]\[ThickSpace]\[ThickSpace]|\[ThickSpace]\[ThickSpace]\ \[ThickSpace]", StyleBox[ButtonBox["Terms of Use", BaseStyle->"Hyperlink", ButtonData->{ URL["http://demonstrations.wolfram.com/termsofuse.html"], None}, ButtonNote->"http://demonstrations.wolfram.com/termsofuse.html"], FontColor->GrayLevel[0.6]], "\[ThickSpace]\[ThickSpace]\[ThickSpace]|\[ThickSpace]\[ThickSpace]\ \[ThickSpace]", StyleBox[ButtonBox["Make a new version of this Demonstration \ \[RightGuillemet]", BaseStyle->"Hyperlink", ButtonData->{ URL["http://demonstrations.wolfram.com/participate/upload.jsp?id=\ PredatorPreyEquations"], None}, ButtonNote->None], FontColor->GrayLevel[0.6]] }], "Text", CellFrame->{{0, 0}, {0, 0.5}}, CellMargins->{{48, 10}, {20, 50}}, CellFrameMargins->{{6, 0}, {6, 6}}, CellFrameColor->GrayLevel[0.6], FontFamily->"Verdana", FontSize->9, FontColor->GrayLevel[0.6]] }, Open ]] }, Open ]] }, Editable->True, Saveable->False, ScreenStyleEnvironment->"Working", CellInsertionPointCell->None, WindowSize->{780, 650}, WindowMargins->{{Inherited, Inherited}, {Inherited, 0}}, WindowElements->{ "StatusArea", "MemoryMonitor", "MagnificationPopUp", "VerticalScrollBar", "MenuBar"}, WindowTitle->"Predator-Prey Equations - Source", DockedCells->{}, CellContext->Notebook, FrontEndVersion->"8.0 for Microsoft Windows (32-bit) (November 7, 2010)", StyleDefinitions->"Default.nb" ] (* End of Notebook Content *) (* Internal cache information *) (*CellTagsOutline CellTagsIndex->{} *) (*CellTagsIndex CellTagsIndex->{} *) (*NotebookFileOutline Notebook[{ Cell[CellGroupData[{ Cell[625, 23, 143, 3, 70, "Section"], Cell[771, 28, 3700, 64, 70, "Section"], Cell[4474, 94, 2068, 55, 70, "Input", CellID->1146107253], Cell[6545, 151, 5881, 142, 70, "Input"] }, Open ]], Cell[CellGroupData[{ Cell[12463, 298, 7397, 152, 70, "Output", CellID->636251345], Cell[CellGroupData[{ Cell[19885, 454, 209, 6, 70, "Section"], Cell[20097, 462, 864, 24, 70, "Text"] }, Close]] }, Open ]], Cell[CellGroupData[{ Cell[21009, 492, 355, 9, 70, "Text", CellGroupingRules->{"SectionGrouping", 25}], Cell[21367, 503, 905, 24, 70, "Text"], Cell[22275, 529, 445, 14, 70, "Text"], Cell[CellGroupData[{ Cell[22745, 547, 815, 24, 70, "Text"], Cell[23563, 573, 1193, 33, 70, "Text"] }, Open ]] }, Open ]] } ] *) (* End of internal cache information *) (* NotebookSignature BSjd@s44uLnjWApZoLgahjEH *)