(* Content-type: application/vnd.wolfram.cdf.text *) (*** Wolfram CDF File ***) (* http://www.wolfram.com/cdf *) (* CreatedBy='Mathematica 11.0' *) (*************************************************************************) (* *) (* The Mathematica License under which this file was created prohibits *) (* restricting third parties in receipt of this file from republishing *) (* or redistributing it by any means, including but not limited to *) (* rights management or terms of use, without the express consent of *) (* Wolfram Research, Inc. For additional information concerning CDF *) (* licensing and redistribution see: *) (* *) (* www.wolfram.com/cdf/adopting-cdf/licensing-options.html *) (* *) (*************************************************************************) (*CacheID: 234*) (* Internal cache information: NotebookFileLineBreakTest NotebookFileLineBreakTest NotebookDataPosition[ 1064, 20] NotebookDataLength[ 35663, 765] NotebookOptionsPosition[ 36218, 760] NotebookOutlinePosition[ 36573, 776] CellTagsIndexPosition[ 36530, 773] WindowFrame->Normal*) (* Beginning of Notebook Content *) Notebook[{ Cell[CellGroupData[{ Cell[BoxData[{ RowBox[{ RowBox[{ RowBox[{"LV", "[", RowBox[{ RowBox[{"{", RowBox[{ "r1_", ",", "r2_", ",", "K1_", ",", "K2_", ",", "\[Alpha]_", ",", "\[Beta]_", ",", "startpt_"}], "}"}], ",", "tmax_"}], "]"}], ":=", RowBox[{"Module", "[", RowBox[{ RowBox[{"{", RowBox[{"N1", ",", "N2", ",", "t"}], "}"}], ",", RowBox[{ RowBox[{ RowBox[{"{", RowBox[{"N1", ",", "N2"}], "}"}], "/.", RowBox[{"Quiet", "[", RowBox[{"NDSolve", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{ RowBox[{ RowBox[{"N1", "'"}], "[", "t", "]"}], "\[Equal]", RowBox[{"r1", "*", RowBox[{"N1", "[", "t", "]"}], "*", RowBox[{"(", RowBox[{"1", "-", RowBox[{ RowBox[{"(", RowBox[{ RowBox[{"N1", "[", "t", "]"}], "+", RowBox[{"\[Alpha]", "*", RowBox[{"N2", "[", "t", "]"}]}]}], ")"}], "/", "K1"}]}], ")"}]}]}], ",", RowBox[{ RowBox[{ RowBox[{"N2", "'"}], "[", "t", "]"}], "\[Equal]", RowBox[{"r2", "*", RowBox[{"N2", "[", "t", "]"}], "*", RowBox[{"(", RowBox[{"1", "-", RowBox[{ RowBox[{"(", RowBox[{ RowBox[{"N2", "[", "t", "]"}], "+", RowBox[{"\[Beta]", "*", RowBox[{"N1", "[", "t", "]"}]}]}], ")"}], "/", "K2"}]}], ")"}]}]}], ",", RowBox[{"Thread", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"N1", "[", "0", "]"}], ",", RowBox[{"N2", "[", "0", "]"}]}], "}"}], "\[Equal]", "startpt"}], "]"}]}], "}"}], ",", RowBox[{"{", RowBox[{"N1", ",", "N2"}], "}"}], ",", RowBox[{"{", RowBox[{"t", ",", "0", ",", "tmax"}], "}"}]}], "]"}], "]"}]}], "//", "Flatten"}]}], "]"}]}], ";"}], "\[IndentingNewLine]", RowBox[{"Manipulate", "[", "\[IndentingNewLine]", RowBox[{ RowBox[{"Module", "[", RowBox[{ RowBox[{"{", RowBox[{ "soln", ",", "MaxN1", ",", "MaxN2", ",", "b", ",", "c", ",", "d"}], "}"}], ",", "\[IndentingNewLine]", RowBox[{ RowBox[{"soln", "=", RowBox[{"Quiet", "@", RowBox[{"LV", "[", RowBox[{ RowBox[{"{", RowBox[{ "r1", ",", "r2", ",", "K1", ",", "K2", ",", "\[Alpha]", ",", "\[Beta]", ",", "startpt"}], "}"}], ",", "tmax"}], "]"}]}]}], ";", "\[IndentingNewLine]", RowBox[{"MaxN1", "=", RowBox[{"1.1", "*", RowBox[{"Max", "[", RowBox[{"K1", ",", RowBox[{"K2", "/", "\[Beta]"}]}], "]"}]}]}], ";", "\[IndentingNewLine]", RowBox[{"MaxN2", "=", RowBox[{"1.1", "*", RowBox[{"Max", "[", RowBox[{"K2", ",", RowBox[{"K1", "/", "\[Alpha]"}]}], "]"}]}]}], ";", "\[IndentingNewLine]", RowBox[{"b", "=", RowBox[{"Plot", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"Tooltip", "[", RowBox[{ RowBox[{ RowBox[{"(", RowBox[{"K1", "-", "N1"}], ")"}], "/", "\[Alpha]"}], ",", "\"\\""}], "]"}], ",", RowBox[{"Tooltip", "[", RowBox[{ RowBox[{"K2", "-", RowBox[{"\[Beta]", "*", "N1"}]}], ",", "\"\\""}], "]"}]}], "}"}], ",", RowBox[{"{", RowBox[{"N1", ",", "0", ",", "MaxN1"}], "}"}], ",", RowBox[{"PlotStyle", "\[Rule]", "Thick"}], ",", RowBox[{"ImageSize", "\[Rule]", RowBox[{"{", RowBox[{"400", ",", "400"}], "}"}]}], ",", RowBox[{"AspectRatio", "\[Rule]", "1"}], ",", RowBox[{"PlotRange", "\[Rule]", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"0", ",", "MaxN1"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "MaxN2"}], "}"}]}], "}"}]}], ",", RowBox[{"Axes", "\[Rule]", "False"}], ",", RowBox[{"Frame", "\[Rule]", "True"}], ",", RowBox[{"FrameLabel", "\[Rule]", RowBox[{"{", RowBox[{ RowBox[{"Style", "[", RowBox[{ "\"\\"", ",", "14", ",", RowBox[{"FontFamily", "\[Rule]", "\"\\""}]}], "]"}], ",", RowBox[{"Style", "[", RowBox[{ "\"\\"", ",", "14", ",", RowBox[{"FontFamily", "\[Rule]", "\"\\""}]}], "]"}]}], "}"}]}]}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"If", "[", RowBox[{ RowBox[{"streams", "\[Equal]", "1"}], ",", "\[IndentingNewLine]", RowBox[{"c", "=", RowBox[{"StreamPlot", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"r1", "*", "N1", "*", RowBox[{"(", RowBox[{"1", "-", RowBox[{ RowBox[{"(", RowBox[{"N1", "+", RowBox[{"\[Alpha]", "*", "N2"}]}], ")"}], "/", "K1"}]}], ")"}]}], ",", RowBox[{"r2", "*", "N2", "*", RowBox[{"(", RowBox[{"1", "-", RowBox[{ RowBox[{"(", RowBox[{"N2", "+", RowBox[{"\[Beta]", "*", "N1"}]}], ")"}], "/", "K2"}]}], ")"}]}]}], "}"}], ",", RowBox[{"{", RowBox[{"N1", ",", "0", ",", "MaxN1"}], "}"}], ",", RowBox[{"{", RowBox[{"N2", ",", "0", ",", "MaxN2"}], "}"}], ",", RowBox[{"StreamColorFunction", "\[Rule]", "\"\\""}], ",", RowBox[{"StreamPoints", "\[Rule]", "10"}], ",", RowBox[{"StreamStyle", "\[Rule]", "Dashed"}], ",", RowBox[{"PerformanceGoal", "\[Rule]", "\"\\""}]}], "]"}]}], ",", RowBox[{"c", "=", RowBox[{"Plot", "[", RowBox[{"Null", ",", RowBox[{"{", RowBox[{"x", ",", "0", ",", "1"}], "}"}]}], "]"}]}]}], "]"}], ";", "\[IndentingNewLine]", RowBox[{"d", "=", RowBox[{"ParametricPlot", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"Evaluate", "[", RowBox[{ RowBox[{ RowBox[{ RowBox[{"#", "[", RowBox[{"[", "1", "]"}], "]"}], "[", "t", "]"}], "&"}], "[", "soln", "]"}], "]"}], ",", RowBox[{"Evaluate", "[", RowBox[{ RowBox[{ RowBox[{ RowBox[{"#", "[", RowBox[{"[", "2", "]"}], "]"}], "[", "t", "]"}], "&"}], "[", "soln", "]"}], "]"}]}], "}"}], ",", RowBox[{"{", RowBox[{"t", ",", "0", ",", "tmax"}], "}"}], ",", RowBox[{"PlotStyle", "\[Rule]", RowBox[{"{", RowBox[{"Thick", ",", "Black"}], "}"}]}]}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"Row", "@", RowBox[{"{", RowBox[{ RowBox[{"LocatorPane", "[", RowBox[{ RowBox[{"Dynamic", "@", "startpt"}], ",", RowBox[{"Show", "[", RowBox[{"b", ",", "c", ",", "d"}], "]"}]}], "]"}], ",", "\[IndentingNewLine]", RowBox[{"Plot", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"Tooltip", "[", RowBox[{ RowBox[{"Evaluate", "[", RowBox[{ RowBox[{ RowBox[{ RowBox[{"#", "[", RowBox[{"[", "1", "]"}], "]"}], "[", "t", "]"}], "&"}], "[", "soln", "]"}], "]"}], ",", "\"\<\!\(\*SubscriptBox[\(N\), \(1\)]\)\>\""}], "]"}], ",", RowBox[{"Tooltip", "[", RowBox[{ RowBox[{"Evaluate", "[", RowBox[{ RowBox[{ RowBox[{ RowBox[{"#", "[", RowBox[{"[", "2", "]"}], "]"}], "[", "t", "]"}], "&"}], "[", "soln", "]"}], "]"}], ",", "\"\<\!\(\*SubscriptBox[\(N\), \(1\)]\)\>\""}], "]"}]}], "}"}], ",", RowBox[{"{", RowBox[{"t", ",", "0", ",", "tmax"}], "}"}], ",", RowBox[{"PlotRange", "\[Rule]", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"0", ",", "tmax"}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"-", "1"}], ",", RowBox[{"Max", "[", RowBox[{"MaxN1", ",", "MaxN2"}], "]"}]}], "}"}]}], "}"}]}], ",", RowBox[{"Frame", "\[Rule]", "True"}], ",", RowBox[{"PlotStyle", "\[Rule]", "Thick"}], ",", RowBox[{"ImageSize", "\[Rule]", RowBox[{"{", RowBox[{"600", ",", "400"}], "}"}]}], ",", RowBox[{"FrameLabel", "\[Rule]", RowBox[{"{", RowBox[{ RowBox[{"Style", "[", RowBox[{"\"\\"", ",", "14", ",", RowBox[{"FontFamily", "\[Rule]", "\"\\""}]}], "]"}], ",", RowBox[{"Style", "[", RowBox[{"\"\\"", ",", "14", ",", RowBox[{"FontFamily", "\[Rule]", "\"\\""}]}], "]"}]}], "}"}]}]}], "]"}]}], "}"}]}]}]}], "]"}], ",", "\[IndentingNewLine]", RowBox[{"Style", "[", RowBox[{ "\"\\"", ",", "14", ",", "Bold"}], "]"}], ",", "\[IndentingNewLine]", RowBox[{"Style", "[", RowBox[{ "\"\<\[Copyright] David A. Vasseur\\n\>\"", ",", "12", ",", " ", "Italic"}], "]"}], ",", "\[IndentingNewLine]", RowBox[{"Style", "[", RowBox[{ "\"\\"", ",", "10", ",", " ", "Italic"}], "]"}], ",", "\[IndentingNewLine]", "\[IndentingNewLine]", "Delimiter", ",", "\[IndentingNewLine]", RowBox[{"Style", "[", RowBox[{ "\"\<\!\(\*FractionBox[SubscriptBox[\(dN\), \(1\)], \ \(dt\)]\)=\!\(\*SubscriptBox[\(r\), \(1\)]\)\!\(\*SubscriptBox[\(N\), \ \(1\)]\) (1-\!\(\*FractionBox[SubscriptBox[\(N\), \(1\)], SubscriptBox[\(K\), \ \(1\)]]\)-\!\(\*FractionBox[SubscriptBox[\(\[Alpha]N\), \(2\)], SubscriptBox[\ \(K\), \(1\)]]\)) \!\(\*FractionBox[SubscriptBox[\(dN\), \(2\)], \ \(dt\)]\)=\!\(\*SubscriptBox[\(r\), \(2\)]\)\!\(\*SubscriptBox[\(N\), \ \(2\)]\) (1-\!\(\*FractionBox[SubscriptBox[\(N\), \(2\)], SubscriptBox[\(K\), \ \(2\)]]\)-\!\(\*FractionBox[SubscriptBox[\(\[Beta]N\), \(1\)], \ SubscriptBox[\(K\), \(2\)]]\)) \>\"", ",", "18", ",", "Italic"}], "]"}], ",", "\[IndentingNewLine]", "Delimiter", ",", "\[IndentingNewLine]", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"tmax", ",", "25", ",", "\"\\""}], "}"}], ",", "10", ",", "100", ",", RowBox[{"Appearance", "\[Rule]", "\"\\""}]}], "}"}], ",", "\[IndentingNewLine]", "Delimiter", ",", "\[IndentingNewLine]", RowBox[{"Style", "[", RowBox[{"\"\\"", ",", "12"}], "]"}], ",", "\[IndentingNewLine]", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"r1", ",", "1", ",", "\"\\""}], "}"}], ",", "0.1", ",", "2", ",", RowBox[{"Appearance", "\[Rule]", "\"\\""}]}], "}"}], ",", "\[IndentingNewLine]", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"r2", ",", "1", ",", "\"\\""}], "}"}], ",", "0.1", ",", "2", ",", RowBox[{"Appearance", "\[Rule]", "\"\\""}]}], "}"}], ",", "\[IndentingNewLine]", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"K1", ",", "100", ",", "\"\\""}], "}"}], ",", "10", ",", "200", ",", RowBox[{"Appearance", "\[Rule]", "\"\\""}]}], "}"}], ",", "\[IndentingNewLine]", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"K2", ",", "100", ",", "\"\\""}], "}"}], ",", "10", ",", "200", ",", RowBox[{"Appearance", "\[Rule]", "\"\\""}]}], "}"}], ",", "\[IndentingNewLine]", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{ "\[Alpha]", ",", "0.5", ",", "\"\\""}], "}"}], ",", "0.1", ",", "2", ",", "0.01", ",", RowBox[{"Appearance", "\[Rule]", "\"\\""}]}], "}"}], ",", "\[IndentingNewLine]", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{ "\[Beta]", ",", "0.5", ",", "\"\\""}], "}"}], ",", "0.1", ",", "2", ",", "0.01", ",", RowBox[{"Appearance", "\[Rule]", "\"\\""}]}], "}"}], ",", "\[IndentingNewLine]", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"streams", ",", "0"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "1"}], "}"}], ",", RowBox[{"ControlType", "\[Rule]", "Checkbox"}]}], "}"}], ",", "\[IndentingNewLine]", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"startpt", ",", RowBox[{"{", RowBox[{"20", ",", "25"}], "}"}]}], "}"}], ",", RowBox[{"ControlType", "\[Rule]", "None"}]}], "}"}], ",", RowBox[{"SaveDefinitions", "\[Rule]", "True"}], ",", RowBox[{"ContinuousAction", "\[Rule]", "False"}], ",", RowBox[{"SynchronousUpdating", "\[Rule]", "False"}], ",", RowBox[{"ControlPlacement", "\[Rule]", "Left"}]}], "\[IndentingNewLine]", "]"}]}], "Input", CellOpen->False, CellChangeTimes->{{3.526637530454756*^9, 3.5266377106548758`*^9}, { 3.5266377567453804`*^9, 3.52663777180682*^9}, {3.5266378217720523`*^9, 3.5266378223813844`*^9}, {3.526638213620933*^9, 3.526638267273062*^9}, { 3.526638298755019*^9, 3.526638360547148*^9}, {3.526638403404071*^9, 3.526638439277234*^9}, {3.5266384986023216`*^9, 3.526638536944108*^9}, { 3.5266385759577355`*^9, 3.52663861269023*^9}, {3.526638657641053*^9, 3.526638710122994*^9}, {3.5266387507149253`*^9, 3.5266388359767303`*^9}, 3.5266388815059404`*^9, {3.526639062857191*^9, 3.5266390688881702`*^9}, { 3.5266391131668444`*^9, 3.526639118103965*^9}, {3.5266481556057315`*^9, 3.5266482690254164`*^9}, {3.526648327829259*^9, 3.5266483931633906`*^9}, { 3.526648483541206*^9, 3.5266486651517715`*^9}, {3.526648813489394*^9, 3.5266488365471363`*^9}, {3.5266488683939843`*^9, 3.5266489224850264`*^9}, {3.5266489681841717`*^9, 3.5266490240195947`*^9}, {3.5266490611755304`*^9, 3.5266490653143797`*^9}, {3.526649112059952*^9, 3.5266491588367605`*^9}, { 3.526649253853191*^9, 3.526649576710842*^9}, {3.526649695413378*^9, 3.5266497542511024`*^9}, {3.52664982877472*^9, 3.526649841492168*^9}, 3.5266498796288877`*^9, {3.526649939121772*^9, 3.526649948932828*^9}, { 3.526653461526767*^9, 3.5266534709613075`*^9}, {3.5266535606987815`*^9, 3.526653560964323*^9}, {3.526653610917403*^9, 3.5266536163219576`*^9}, { 3.5266542924692264`*^9, 3.5266542945623198`*^9}, {3.5266543429065294`*^9, 3.526654489563648*^9}, {3.5266768305625*^9, 3.526676855125*^9}, { 3.526676972625*^9, 3.526677008953125*^9}, {3.526677049328125*^9, 3.5266770635625*^9}, {3.526677116609375*^9, 3.526677169421875*^9}, { 3.526677291625*^9, 3.526677302953125*^9}, {3.52667736496875*^9, 3.526677382375*^9}, {3.5267348770262337`*^9, 3.5267349210592957`*^9}, { 3.526735315629449*^9, 3.5267353474991455`*^9}, {3.526735602651188*^9, 3.5267356222270575`*^9}, {3.5267356663938437`*^9, 3.5267357000462165`*^9}, {3.5267363989738803`*^9, 3.526736585133712*^9}, { 3.526739313614612*^9, 3.526739392152941*^9}, {3.5267394509590425`*^9, 3.526739639344794*^9}, {3.526739687542674*^9, 3.5267396893081074`*^9}, 3.5267397958746367`*^9, {3.5267624238125*^9, 3.526762429109375*^9}, { 3.52676382759375*^9, 3.5267638426875*^9}, {3.5268111490300307`*^9, 3.5268111525157394`*^9}, {3.5268186766301174`*^9, 3.526818678131423*^9}, { 3.5568835873934183`*^9, 3.556883604380179*^9}, {3.5568836424772167`*^9, 3.556883740794928*^9}, {3.556883777641285*^9, 3.5568837964009027`*^9}, { 3.556884536090818*^9, 3.556884619507094*^9}, {3.556884670748073*^9, 3.556884671458144*^9}, {3.556884724782762*^9, 3.556884730110058*^9}, { 3.5568847688291893`*^9, 3.556884846923079*^9}, {3.55827228638612*^9, 3.558272287957181*^9}, {3.558276651797667*^9, 3.5582766537936172`*^9}, { 3.558277011508994*^9, 3.558277015221158*^9}, {3.558277058833716*^9, 3.5582771171377783`*^9}, {3.5582771507092867`*^9, 3.5582771768979263`*^9}, {3.558277225558259*^9, 3.558277226174405*^9}, { 3.558277274779665*^9, 3.558277282686789*^9}, {3.558277319217414*^9, 3.558277320431127*^9}, {3.558277421343369*^9, 3.558277485474339*^9}, { 3.5582775267752047`*^9, 3.5582775634024897`*^9}, {3.558348144959881*^9, 3.558348221092177*^9}, {3.5583590541698723`*^9, 3.558359094720894*^9}, { 3.558359127515733*^9, 3.558359165143428*^9}, {3.558359204351355*^9, 3.558359285804335*^9}, 3.5583593441025677`*^9, {3.558359391963076*^9, 3.5583593945244007`*^9}, {3.5583594308489103`*^9, 3.558359458138844*^9}, { 3.5583595242894382`*^9, 3.558359551845487*^9}, {3.5583596062157507`*^9, 3.558359617183951*^9}, {3.55835974405932*^9, 3.558359750232489*^9}, { 3.558359846419364*^9, 3.5583598528677387`*^9}, {3.558359984770945*^9, 3.5583600231963663`*^9}, {3.558360054035452*^9, 3.5583600549948473`*^9}, 3.558360097004987*^9, {3.558360128206355*^9, 3.5583601298774853`*^9}, { 3.558360298190072*^9, 3.558360302397155*^9}, {3.558360343003304*^9, 3.558360346239503*^9}, {3.558360421827323*^9, 3.558360452575877*^9}, { 3.558360635303541*^9, 3.558360777717104*^9}, {3.55836085818237*^9, 3.5583608751583*^9}, {3.5892798460642*^9, 3.589279955616644*^9}, { 3.589279995675803*^9, 3.589280034990981*^9}, {3.589280405524674*^9, 3.5892804491095333`*^9}, {3.589443907265437*^9, 3.589443919458084*^9}, { 3.5894439573931713`*^9, 3.58944395760023*^9}, {3.589444078655738*^9, 3.589444105668911*^9}, {3.5894441374003887`*^9, 3.589444146457473*^9}, { 3.589444179382703*^9, 3.5894441813215027`*^9}, {3.589444237093541*^9, 3.589444257167132*^9}, {3.5894442924229603`*^9, 3.589444292997592*^9}, { 3.589444362585634*^9, 3.589444366416576*^9}, 3.589486054826336*^9, { 3.58979849040939*^9, 3.589798493305043*^9}, {3.589798567781271*^9, 3.5897986557324963`*^9}, {3.589798731036832*^9, 3.589798840448498*^9}, { 3.589799016450807*^9, 3.5897990602550592`*^9}, {3.58979918262591*^9, 3.589799182819091*^9}, {3.589799225714405*^9, 3.5897992376643877`*^9}, { 3.589799279557629*^9, 3.589799312583338*^9}, {3.589799350443076*^9, 3.589799372304388*^9}, 3.5897994762324877`*^9, {3.589799508043921*^9, 3.589799520317665*^9}, {3.5897996063978643`*^9, 3.58979961063026*^9}, { 3.589799726025364*^9, 3.589799727227313*^9}, {3.5897997781450033`*^9, 3.5897998050141973`*^9}, {3.589799851898656*^9, 3.589799873327648*^9}, { 3.589799943076481*^9, 3.58979994783694*^9}, {3.589800001945372*^9, 3.589800008908465*^9}, 3.589800052201455*^9, {3.5898001158485603`*^9, 3.589800122094222*^9}, {3.589800204551228*^9, 3.589800210030954*^9}, { 3.589800466179947*^9, 3.5898004892964363`*^9}, {3.589800587769066*^9, 3.589800662948409*^9}, {3.5898007204451*^9, 3.589800744805462*^9}, { 3.5898009497840137`*^9, 3.589800988679513*^9}, {3.589801051318984*^9, 3.589801199314254*^9}, {3.6852053375645523`*^9, 3.6852053544085207`*^9}, { 3.685369214314756*^9, 3.685369234221285*^9}, {3.685369266308547*^9, 3.685369276208477*^9}, {3.68536933372094*^9, 3.6853693342288017`*^9}, { 3.685369410436808*^9, 3.685369503628623*^9}, {3.685369537634149*^9, 3.6853695381363163`*^9}}], Cell[BoxData[ TagBox[ StyleBox[ DynamicModuleBox[{$CellContext`K1$$ = 100, $CellContext`K2$$ = 100, $CellContext`r1$$ = 1, $CellContext`r2$$ = 1, $CellContext`startpt$$ = {20, 25}, $CellContext`streams$$ = 0, $CellContext`tmax$$ = 25, $CellContext`\[Alpha]$$ = 0.5, $CellContext`\[Beta]$$ = 0.5, Typeset`show$$ = True, Typeset`bookmarkList$$ = {}, Typeset`bookmarkMode$$ = "Menu", Typeset`animator$$, Typeset`animvar$$ = 1, Typeset`name$$ = "\"untitled\"", Typeset`specs$$ = {{ Hold[ Style[ "Lotka-Volterra Competition in the phase-plane and over time", 14, Bold]], Manipulate`Dump`ThisIsNotAControl}, { Hold[ Style["\[Copyright] David A. Vasseur\n", 12, Italic]], Manipulate`Dump`ThisIsNotAControl}, { Hold[ Style[ "Click in the phase plane to set initial conditions.", 10, Italic]], Manipulate`Dump`ThisIsNotAControl}, { Hold[ Style[ "\!\(\*FractionBox[SubscriptBox[\(dN\), \(1\)], \ \(dt\)]\)=\!\(\*SubscriptBox[\(r\), \(1\)]\)\!\(\*SubscriptBox[\(N\), \ \(1\)]\) (1-\!\(\*FractionBox[SubscriptBox[\(N\), \(1\)], SubscriptBox[\(K\), \ \(1\)]]\)-\!\(\*FractionBox[SubscriptBox[\(\[Alpha]N\), \(2\)], SubscriptBox[\ \(K\), \(1\)]]\)) \!\(\*FractionBox[SubscriptBox[\(dN\), \(2\)], \ \(dt\)]\)=\!\(\*SubscriptBox[\(r\), \(2\)]\)\!\(\*SubscriptBox[\(N\), \ \(2\)]\) (1-\!\(\*FractionBox[SubscriptBox[\(N\), \(2\)], SubscriptBox[\(K\), \ \(2\)]]\)-\!\(\*FractionBox[SubscriptBox[\(\[Beta]N\), \(1\)], \ SubscriptBox[\(K\), \(2\)]]\)) ", 18, Italic]], Manipulate`Dump`ThisIsNotAControl}, {{ Hold[$CellContext`tmax$$], 25, "Length of Simulation"}, 10, 100}, { Hold[ Style["Model Parameters\n", 12]], Manipulate`Dump`ThisIsNotAControl}, {{ Hold[$CellContext`r1$$], 1, "Intrinsic Growth Rate r1"}, 0.1, 2}, {{ Hold[$CellContext`r2$$], 1, "Intrinsic Growth Rate r2"}, 0.1, 2}, {{ Hold[$CellContext`K1$$], 100, "Carrying Capacity K1"}, 10, 200}, {{ Hold[$CellContext`K2$$], 100, "Carrying Capcaity K2"}, 10, 200}, {{ Hold[$CellContext`\[Alpha]$$], 0.5, "Competition Coefficient \[Alpha]"}, 0.1, 2, 0.01}, {{ Hold[$CellContext`\[Beta]$$], 0.5, "Competition Coefficient \[Beta]"}, 0.1, 2, 0.01}, {{ Hold[$CellContext`streams$$], 0}, {0, 1}}, {{ Hold[$CellContext`startpt$$], {20, 25}}}}, Typeset`size$$ = { 1006., {200., 206.}}, Typeset`update$$ = 0, Typeset`initDone$$, Typeset`skipInitDone$$ = False, $CellContext`tmax$6761$$ = 0, $CellContext`r1$6762$$ = 0, $CellContext`r2$6763$$ = 0, $CellContext`K1$6764$$ = 0, $CellContext`K2$6765$$ = 0, $CellContext`\[Alpha]$6766$$ = 0, $CellContext`\[Beta]$6767$$ = 0, $CellContext`streams$6768$$ = False}, DynamicBox[Manipulate`ManipulateBoxes[ 1, StandardForm, "Variables" :> {$CellContext`K1$$ = 100, $CellContext`K2$$ = 100, $CellContext`r1$$ = 1, $CellContext`r2$$ = 1, $CellContext`startpt$$ = {20, 25}, $CellContext`streams$$ = 0, $CellContext`tmax$$ = 25, $CellContext`\[Alpha]$$ = 0.5, $CellContext`\[Beta]$$ = 0.5}, "ControllerVariables" :> { Hold[$CellContext`tmax$$, $CellContext`tmax$6761$$, 0], Hold[$CellContext`r1$$, $CellContext`r1$6762$$, 0], Hold[$CellContext`r2$$, $CellContext`r2$6763$$, 0], Hold[$CellContext`K1$$, $CellContext`K1$6764$$, 0], Hold[$CellContext`K2$$, $CellContext`K2$6765$$, 0], Hold[$CellContext`\[Alpha]$$, $CellContext`\[Alpha]$6766$$, 0], Hold[$CellContext`\[Beta]$$, $CellContext`\[Beta]$6767$$, 0], Hold[$CellContext`streams$$, $CellContext`streams$6768$$, False]}, "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`MaxN1$, $CellContext`MaxN2$, \ $CellContext`b$, $CellContext`c$, $CellContext`d$}, $CellContext`soln$ = Quiet[ $CellContext`LV[{$CellContext`r1$$, $CellContext`r2$$, \ $CellContext`K1$$, $CellContext`K2$$, $CellContext`\[Alpha]$$, $CellContext`\ \[Beta]$$, $CellContext`startpt$$}, $CellContext`tmax$$]]; \ $CellContext`MaxN1$ = 1.1 Max[$CellContext`K1$$, $CellContext`K2$$/$CellContext`\[Beta]$$]; \ $CellContext`MaxN2$ = 1.1 Max[$CellContext`K2$$, \ $CellContext`K1$$/$CellContext`\[Alpha]$$]; $CellContext`b$ = Plot[{ Tooltip[($CellContext`K1$$ - $CellContext`N1)/$CellContext`\ \[Alpha]$$, "dN1/dt=0"], Tooltip[$CellContext`K2$$ - $CellContext`\[Beta]$$ \ $CellContext`N1, "dN2/dt=0"]}, {$CellContext`N1, 0, $CellContext`MaxN1$}, PlotStyle -> Thick, ImageSize -> {400, 400}, AspectRatio -> 1, PlotRange -> {{0, $CellContext`MaxN1$}, {0, $CellContext`MaxN2$}}, Axes -> False, Frame -> True, FrameLabel -> { Style[ "Population Density \!\(\*SubscriptBox[\(N\), \(1\)]\)", 14, FontFamily -> "Helvetica"], Style[ "Population Density \!\(\*SubscriptBox[\(N\), \(2\)]\)", 14, FontFamily -> "Helvetica"]}]; If[$CellContext`streams$$ == 1, $CellContext`c$ = StreamPlot[{$CellContext`r1$$ $CellContext`N1 ( 1 - ($CellContext`N1 + $CellContext`\[Alpha]$$ \ $CellContext`N2)/$CellContext`K1$$), $CellContext`r2$$ $CellContext`N2 ( 1 - ($CellContext`N2 + $CellContext`\[Beta]$$ \ $CellContext`N1)/$CellContext`K2$$)}, {$CellContext`N1, 0, $CellContext`MaxN1$}, {$CellContext`N2, 0, $CellContext`MaxN2$}, StreamColorFunction -> "Rainbow", StreamPoints -> 10, StreamStyle -> Dashed, PerformanceGoal -> "Speed"], $CellContext`c$ = Plot[Null, {$CellContext`x, 0, 1}]]; $CellContext`d$ = ParametricPlot[{ Evaluate[ (Part[#, 1][$CellContext`t]& )[$CellContext`soln$]], Evaluate[ ( Part[#, 2][$CellContext`t]& )[$CellContext`soln$]]}, \ {$CellContext`t, 0, $CellContext`tmax$$}, PlotStyle -> {Thick, Black}]; Row[{ LocatorPane[ Dynamic[$CellContext`startpt$$], Show[$CellContext`b$, $CellContext`c$, $CellContext`d$]], Plot[{ Tooltip[ Evaluate[ (Part[#, 1][$CellContext`t]& )[$CellContext`soln$]], "\!\(\*SubscriptBox[\(N\), \(1\)]\)"], Tooltip[ Evaluate[ (Part[#, 2][$CellContext`t]& )[$CellContext`soln$]], "\!\(\*SubscriptBox[\(N\), \(1\)]\)"]}, {$CellContext`t, 0, $CellContext`tmax$$}, PlotRange -> {{0, $CellContext`tmax$$}, {-1, Max[$CellContext`MaxN1$, $CellContext`MaxN2$]}}, Frame -> True, PlotStyle -> Thick, ImageSize -> {600, 400}, FrameLabel -> { Style["Time", 14, FontFamily -> "Helvetica"], Style[ "Population Density)", 14, FontFamily -> "Helvetica"]}]}]], "Specifications" :> { Style[ "Lotka-Volterra Competition in the phase-plane and over time", 14, Bold], Style["\[Copyright] David A. Vasseur\n", 12, Italic], Style[ "Click in the phase plane to set initial conditions.", 10, Italic], Delimiter, Style[ "\!\(\*FractionBox[SubscriptBox[\(dN\), \(1\)], \ \(dt\)]\)=\!\(\*SubscriptBox[\(r\), \(1\)]\)\!\(\*SubscriptBox[\(N\), \ \(1\)]\) (1-\!\(\*FractionBox[SubscriptBox[\(N\), \(1\)], SubscriptBox[\(K\), \ \(1\)]]\)-\!\(\*FractionBox[SubscriptBox[\(\[Alpha]N\), \(2\)], SubscriptBox[\ \(K\), \(1\)]]\)) \!\(\*FractionBox[SubscriptBox[\(dN\), \(2\)], \ \(dt\)]\)=\!\(\*SubscriptBox[\(r\), \(2\)]\)\!\(\*SubscriptBox[\(N\), \ \(2\)]\) (1-\!\(\*FractionBox[SubscriptBox[\(N\), \(2\)], SubscriptBox[\(K\), \ \(2\)]]\)-\!\(\*FractionBox[SubscriptBox[\(\[Beta]N\), \(1\)], \ SubscriptBox[\(K\), \(2\)]]\)) ", 18, Italic], Delimiter, {{$CellContext`tmax$$, 25, "Length of Simulation"}, 10, 100, Appearance -> "Labeled"}, Delimiter, Style[ "Model Parameters\n", 12], {{$CellContext`r1$$, 1, "Intrinsic Growth Rate r1"}, 0.1, 2, Appearance -> "Labeled"}, {{$CellContext`r2$$, 1, "Intrinsic Growth Rate r2"}, 0.1, 2, Appearance -> "Labeled"}, {{$CellContext`K1$$, 100, "Carrying Capacity K1"}, 10, 200, Appearance -> "Labeled"}, {{$CellContext`K2$$, 100, "Carrying Capcaity K2"}, 10, 200, Appearance -> "Labeled"}, {{$CellContext`\[Alpha]$$, 0.5, "Competition Coefficient \[Alpha]"}, 0.1, 2, 0.01, Appearance -> "Labeled"}, {{$CellContext`\[Beta]$$, 0.5, "Competition Coefficient \[Beta]"}, 0.1, 2, 0.01, Appearance -> "Labeled"}, {{$CellContext`streams$$, 0}, {0, 1}, ControlType -> Checkbox}, {{$CellContext`startpt$$, {20, 25}}, ControlType -> None}}, "Options" :> { ContinuousAction -> False, SynchronousUpdating -> False, ControlPlacement -> Left}, "DefaultOptions" :> {}], ImageSizeCache->{1487., {230., 236.}}, SingleEvaluation->True], Deinitialization:>None, DynamicModuleValues:>{}, Initialization:>({$CellContext`soln = NDSolve[{ Derivative[1][{}][$CellContext`t] == 0.5 (1 - {}[$CellContext`t]) {}[$CellContext`t] - \ ($CellContext`y[$CellContext`t] {}[$CellContext`t])/(1 + 2 {}[$CellContext`t]), Derivative[1][$CellContext`y][$CellContext`t] == -(Graphics[ GraphicsComplex[CompressedData[" 1:eJxTTMoPSmViYGAwAmIQPQpGwSjADQD2ewHg "], {}], { Axes -> True, AxesOrigin -> {0, 0}, PlotRange -> {{0., 1.}, {0., 1.}}, PlotRangeClipping -> True, PlotRangePadding -> { Scaled[0.02], Scaled[0.02]}}] $CellContext`y[$CellContext`t]) + ( 0.5 $CellContext`y[$CellContext`t] {}[$CellContext`t])/(1 + 2 {}[$CellContext`t]), {{}[0] == 0.435, $CellContext`y[0] == 0.56}}, {{}, $CellContext`y}, {$CellContext`t, 0, 500}], Attributes[Derivative] = {NHoldAll, ReadProtected}, $CellContext`LV[{ Pattern[$CellContext`r1, Blank[]], Pattern[$CellContext`r2, Blank[]], Pattern[$CellContext`K1, Blank[]], Pattern[$CellContext`K2, Blank[]], Pattern[$CellContext`\[Alpha], Blank[]], Pattern[$CellContext`\[Beta], Blank[]], Pattern[$CellContext`startpt, Blank[]]}, Pattern[$CellContext`tmax, Blank[]]] := Module[{$CellContext`N1, $CellContext`N2, $CellContext`t}, Flatten[ ReplaceAll[{$CellContext`N1, $CellContext`N2}, Quiet[ NDSolve[{ Derivative[ 1][$CellContext`N1][$CellContext`t] == $CellContext`r1 \ $CellContext`N1[$CellContext`t] ( 1 - ($CellContext`N1[$CellContext`t] + $CellContext`\[Alpha] \ $CellContext`N2[$CellContext`t])/$CellContext`K1), Derivative[ 1][$CellContext`N2][$CellContext`t] == $CellContext`r2 \ $CellContext`N2[$CellContext`t] ( 1 - ($CellContext`N2[$CellContext`t] + $CellContext`\[Beta] \ $CellContext`N1[$CellContext`t])/$CellContext`K2), Thread[{ $CellContext`N1[0], $CellContext`N2[ 0]} == $CellContext`startpt]}, {$CellContext`N1, \ $CellContext`N2}, {$CellContext`t, 0, $CellContext`tmax}]]]]]}; Typeset`initDone$$ = True), SynchronousInitialization->True, UndoTrackedVariables:>{Typeset`show$$, Typeset`bookmarkMode$$}, UnsavedVariables:>{Typeset`initDone$$}, UntrackedVariables:>{Typeset`size$$}], "Manipulate", Deployed->True, StripOnInput->False], Manipulate`InterpretManipulate[1]]], "Output", CellChangeTimes->{ 3.558360354195383*^9, {3.558360433300818*^9, 3.558360458921791*^9}, { 3.558360642533277*^9, 3.5583608761438427`*^9}, {3.58927994564704*^9, 3.5892799562233343`*^9}, 3.5892800361158857`*^9, {3.589280275158842*^9, 3.5892802978616123`*^9}, {3.5892804233678207`*^9, 3.589280450348918*^9}, 3.589443921281992*^9, 3.5894439587701483`*^9, 3.589444022950231*^9, { 3.589444088602284*^9, 3.5894441065611277`*^9}, 3.589444147251563*^9, 3.5894441821205797`*^9, {3.589444238761725*^9, 3.589444257769919*^9}, 3.589444367656087*^9, {3.5894860410150146`*^9, 3.589486056230363*^9}, 3.589798429230319*^9, 3.589798494803383*^9, {3.5897985684232063`*^9, 3.58979859593055*^9}, {3.5897986289543552`*^9, 3.5897986565807753`*^9}, { 3.589798751296332*^9, 3.58979882042975*^9}, 3.5897988581278677`*^9, 3.5897989267948837`*^9, {3.58979904831775*^9, 3.589799060979971*^9}, 3.589799118765068*^9, 3.589799183339841*^9, {3.589799226146214*^9, 3.589799238416751*^9}, {3.5897992811914387`*^9, 3.58979931306363*^9}, { 3.589799367300523*^9, 3.5897993727275677`*^9}, 3.58979947690751*^9, 3.589799509007824*^9, 3.589799640858225*^9, {3.589799720110319*^9, 3.5897997424893427`*^9}, 3.589799814940782*^9, {3.589799853815549*^9, 3.58979987413533*^9}, 3.589799949354994*^9, 3.5898000098236313`*^9, 3.58980005661981*^9, 3.589800123035934*^9, 3.58980021097855*^9, { 3.589800471390328*^9, 3.589800490616949*^9}, {3.589800604955159*^9, 3.589800630159626*^9}, 3.589800663852783*^9, 3.589800746283626*^9, 3.589800989372643*^9, {3.589801060924403*^9, 3.5898010774089317`*^9}, { 3.589801121025323*^9, 3.589801200021064*^9}, 3.6852053556823063`*^9, { 3.685205389305024*^9, 3.685205392630651*^9}, 3.685369239865121*^9, { 3.685369485411292*^9, 3.685369538955233*^9}}] }, Open ]] }, WindowSize->{1626, 917}, WindowMargins->{{Automatic, 73}, {78, Automatic}}, FrontEndVersion->"11.0 for Mac OS X x86 (32-bit, 64-bit Kernel) (July 28, \ 2016)", StyleDefinitions->"Default.nb" ] (* End of Notebook Content *) (* Internal cache information *) (*CellTagsOutline CellTagsIndex->{} *) (*CellTagsIndex CellTagsIndex->{} *) (*NotebookFileOutline Notebook[{ Cell[CellGroupData[{ Cell[1486, 35, 20594, 453, 19, "Input", CellOpen->False], Cell[22083, 490, 14119, 267, 483, "Output"] }, Open ]] } ] *) (* End of internal cache information *) (* NotebookSignature fx0m2tYHF26Z7AwcP8PZCAkb *)