(* Content-type: application/vnd.wolfram.mathematica *) (*** Wolfram Notebook File ***) (* http://www.wolfram.com/nb *) (* CreatedBy='Wolfram 14.3' *) (*CacheID: 234*) (* Internal cache information: NotebookFileLineBreakTest NotebookFileLineBreakTest NotebookDataPosition[ 154, 7] NotebookDataLength[ 137442, 2996] NotebookOptionsPosition[ 133583, 2928] NotebookOutlinePosition[ 134028, 2946] CellTagsIndexPosition[ 133985, 2943] WindowFrame->Normal*) (* Beginning of Notebook Content *) Notebook[{ Cell["\<\ (*p3[N_, A_, B_] := (B*N^2)/(A^2 + N^2) p2[N_, A_, B_] := (B*N)/(A + N)*)\ \>", "CodeText", CellChangeTimes->{{3.985818952929174*^9, 3.985819052650008*^9}, 3.985819097783641*^9, {3.985819313106573*^9, 3.9858193144312563`*^9}, { 3.985819380569413*^9, 3.985819392275222*^9}, {3.985819926166575*^9, 3.985819927591164*^9}, {3.985820466970293*^9, 3.985820470960685*^9}, { 3.985820775159882*^9, 3.985820852843687*^9}, 3.985820886113346*^9, { 3.985821204346756*^9, 3.985821231874576*^9}, {3.985821265694471*^9, 3.9858212717813473`*^9}, {3.985831265902404*^9, 3.985831289946179*^9}},ExpressionUUID->"5e0598e5-2500-4adc-8464-\ cff05975d699"], Cell[BoxData[ FormBox[ RowBox[{ FractionBox[ RowBox[{"\[DifferentialD]", "N"}], RowBox[{"\[DifferentialD]", "t"}]], "=", RowBox[{ RowBox[{"N", " ", "R", " ", RowBox[{"(", RowBox[{"1", "-", FractionBox["N", "K"]}], ")"}]}], "-", RowBox[{ SubscriptBox["p", "2"], "(", "N", ")"}]}]}], TraditionalForm]], "Input", CellChangeTimes->{{3.9858208785707827`*^9, 3.9858208941383266`*^9}, { 3.985820946232589*^9, 3.985820946302106*^9}, {3.985820981622471*^9, 3.985820982238865*^9}, {3.9858210799978857`*^9, 3.9858210805495*^9}, { 3.9858317221010227`*^9, 3.985831723507629*^9}},ExpressionUUID->"9f0e66a3-6155-4b5c-a4c0-\ 256018bb6203"], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"Manipulate", "[", RowBox[{ RowBox[{"Show", "[", "\[IndentingNewLine]", RowBox[{ RowBox[{"Plot", "[", RowBox[{ RowBox[{"p2", "[", RowBox[{"x", ",", "A", ",", "B"}], "]"}], ",", RowBox[{"{", RowBox[{"x", ",", "0", ",", "100"}], "}"}], ",", RowBox[{"PlotRange", "->", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"0", ",", "100"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "10"}], "}"}]}], "}"}]}], ",", "\[IndentingNewLine]", RowBox[{"Epilog", "->", RowBox[{"{", "\[IndentingNewLine]", RowBox[{"Blue", ",", "Dashed", ",", RowBox[{"Line", "[", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"0", ",", "B"}], "}"}], ",", RowBox[{"{", RowBox[{"100", ",", "B"}], "}"}]}], "}"}], "]"}], ",", "\[IndentingNewLine]", RowBox[{"Text", "[", RowBox[{ RowBox[{"Style", "[", RowBox[{ RowBox[{"\"\\"", "<>", RowBox[{"ToString", "[", "B", "]"}]}], ",", "Blue"}], "]"}], ",", RowBox[{"{", RowBox[{"98", ",", "B"}], "}"}], ",", RowBox[{"{", RowBox[{"2", ",", RowBox[{"-", "1"}]}], "}"}]}], "]"}], ",", "\[IndentingNewLine]", "Red", ",", " ", "Dashed", ",", " ", RowBox[{"Line", "[", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"A", ",", "0"}], "}"}], ",", RowBox[{"{", RowBox[{"A", ",", "9"}], "}"}]}], "}"}], "]"}], ",", "\[IndentingNewLine]", RowBox[{"Text", "[", RowBox[{ RowBox[{"Style", "[", RowBox[{ RowBox[{"\"\\"", "<>", RowBox[{"ToString", "[", "A", "]"}]}], ",", "Red"}], "]"}], ",", RowBox[{"{", RowBox[{"A", ",", "10"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "1"}], "}"}]}], "]"}]}], "\[IndentingNewLine]", "}"}]}]}], "\[IndentingNewLine]", "]"}], ",", "\[IndentingNewLine]", RowBox[{"Plot", "[", RowBox[{ RowBox[{"p3", "[", RowBox[{"x", ",", "A", ",", "B"}], "]"}], ",", RowBox[{"{", RowBox[{"x", ",", "0", ",", "1000"}], "}"}], ",", RowBox[{"PlotRange", "->", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"0", ",", "100"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "10"}], "}"}]}], "}"}]}], ",", RowBox[{"PlotStyle", "->", "Green"}]}], "]"}], ",", "\[IndentingNewLine]", RowBox[{"ListPlot", "[", RowBox[{ RowBox[{"{", RowBox[{"Callout", "[", RowBox[{"{", RowBox[{"A", ",", RowBox[{"p2", "[", RowBox[{"A", ",", "A", ",", "B"}], "]"}]}], "}"}], "]"}], "}"}], ",", RowBox[{"PlotStyle", "->", "Red"}]}], "]"}]}], "\n", "]"}], ",", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{ "A", ",", "5", ",", " ", "\"\\""}], "}"}], ",", "0", ",", "10"}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"B", ",", "5", ",", " ", "\"\\""}], "}"}], ",", "0", ",", "20"}], "}"}]}], "]"}]], "Input", CellChangeTimes->{{3.985821040263514*^9, 3.9858211596105022`*^9}, { 3.98582124657544*^9, 3.985821340294147*^9}, {3.985821410997641*^9, 3.9858214461185617`*^9}, {3.985821628773389*^9, 3.9858216890110903`*^9}, { 3.98582173037316*^9, 3.9858218467619658`*^9}, {3.98582191827089*^9, 3.985821955547806*^9}, {3.985822078279787*^9, 3.985822428086402*^9}, { 3.985822459654554*^9, 3.985822469192135*^9}, {3.985822555975613*^9, 3.9858226867398767`*^9}, {3.9858227221723557`*^9, 3.9858228524149427`*^9}, { 3.98582289304064*^9, 3.985822946733088*^9}, {3.985822988619626*^9, 3.985823100758049*^9}, {3.985826956528822*^9, 3.985826968340103*^9}, { 3.985827017443091*^9, 3.9858270198901*^9}, {3.985827075967404*^9, 3.985827109424631*^9}, {3.9858317347104063`*^9, 3.985831749512567*^9}}, CellLabel-> "In[122]:=",ExpressionUUID->"93343324-5287-4ca6-aa69-d8e83459879e"], Cell[BoxData[ TagBox[ StyleBox[ DynamicModuleBox[{$CellContext`A$$ = 3.7, $CellContext`B$$ = 15.700000000000001`, Typeset`show$$ = True, Typeset`bookmarkList$$ = {}, Typeset`bookmarkMode$$ = "Menu", Typeset`animator$$, Typeset`animvar$$ = 1, Typeset`name$$ = "\"untitled\"", Typeset`specs$$ = {{{ Hold[$CellContext`A$$], 5, "Population at Critical Predation (A)"}, 0, 10, ControlType -> Manipulator}, {{ Hold[$CellContext`B$$], 5, "Maximum Predation (B)"}, 0, 20, ControlType -> Manipulator}}, Typeset`size$$ = { 360., {111.50787105179899`, 117.23980464554899`}}, Typeset`update$$ = 0, Typeset`initDone$$, Typeset`skipInitDone$$ = True, Typeset`keyframeActionsQ$$ = False, Typeset`keyframeList$$ = {}}, DynamicBox[Manipulate`ManipulateBoxes[ 1, StandardForm, "Variables" :> {$CellContext`A$$ = 5, $CellContext`B$$ = 5}, "ControllerVariables" :> {}, "OtherVariables" :> { Typeset`show$$, Typeset`bookmarkList$$, Typeset`bookmarkMode$$, Typeset`animator$$, Typeset`animvar$$, Typeset`name$$, Typeset`specs$$, Typeset`size$$, Typeset`update$$, Typeset`initDone$$, Typeset`skipInitDone$$, Typeset`keyframeActionsQ$$, Typeset`keyframeList$$}, "Body" :> Show[ Plot[ $CellContext`p2[$CellContext`x, $CellContext`A$$, $CellContext`B$$], \ {$CellContext`x, 0, 100}, PlotRange -> {{0, 100}, {0, 10}}, Epilog -> {Blue, Dashed, Line[{{0, $CellContext`B$$}, {100, $CellContext`B$$}}], Text[ Style["B=" <> ToString[$CellContext`B$$], Blue], { 98, $CellContext`B$$}, {2, -1}], Red, Dashed, Line[{{$CellContext`A$$, 0}, {$CellContext`A$$, 9}}], Text[ Style[ "A=" <> ToString[$CellContext`A$$], Red], {$CellContext`A$$, 10}, {0, 1}]}], Plot[ $CellContext`p3[$CellContext`x, $CellContext`A$$, $CellContext`B$$], \ {$CellContext`x, 0, 1000}, PlotRange -> {{0, 100}, {0, 10}}, PlotStyle -> Green], ListPlot[{ Callout[{$CellContext`A$$, $CellContext`p2[$CellContext`A$$, $CellContext`A$$, \ $CellContext`B$$]}]}, PlotStyle -> Red]], "Specifications" :> {{{$CellContext`A$$, 5, "Population at Critical Predation (A)"}, 0, 10}, {{$CellContext`B$$, 5, "Maximum Predation (B)"}, 0, 20}}, "Options" :> {}, "DefaultOptions" :> {}], ImageSizeCache->{409.1, {173.97829646683806`, 179.71023006058806`}}, SingleEvaluation->True], Deinitialization:>None, DynamicModuleValues:>{}, SynchronousInitialization->True, UndoTrackedVariables:>{Typeset`show$$, Typeset`bookmarkMode$$}, UnsavedVariables:>{Typeset`initDone$$}, UntrackedVariables:>{Typeset`size$$}], "Manipulate", Deployed->True, StripOnInput->False], Manipulate`InterpretManipulate[1]]], "Output", CellChangeTimes->{3.985834224914112*^9}, CellLabel-> "Out[122]=",ExpressionUUID->"44f6e945-f1e3-4d6a-bd81-6cb8f1e7f6d1"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"Manipulate", "[", RowBox[{ RowBox[{"Module", "[", RowBox[{ RowBox[{"{", RowBox[{"growth", ",", "sol"}], "}"}], ",", "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"growth", "[", "n_", "]"}], ":=", RowBox[{ RowBox[{"n", "[", "t", "]"}], "*", "r", "*", RowBox[{"(", RowBox[{"1", "-", RowBox[{ RowBox[{"n", "[", "t", "]"}], "/", "k"}]}], ")"}]}]}], ";", "\[IndentingNewLine]", RowBox[{ RowBox[{"p2", "[", "x_", "]"}], ":=", RowBox[{ RowBox[{"(", RowBox[{"b", "*", "x"}], ")"}], "/", RowBox[{"(", RowBox[{"a", "+", "x"}], ")"}]}]}], ";", "\[IndentingNewLine]", RowBox[{ RowBox[{"p3", "[", "x_", "]"}], ":=", RowBox[{ RowBox[{"(", RowBox[{"b", "*", RowBox[{"x", "^", "2"}]}], ")"}], "/", RowBox[{"(", RowBox[{ RowBox[{"a", "^", "2"}], "+", RowBox[{"x", "^", "2"}]}], ")"}]}]}], ";", "\[IndentingNewLine]", RowBox[{"sol", "=", RowBox[{ RowBox[{ RowBox[{"NDSolve", "[", RowBox[{ RowBox[{"{", RowBox[{"#", ",", RowBox[{ RowBox[{"n", "[", "0", "]"}], "==", "n0"}]}], "}"}], ",", RowBox[{"n", "[", "t", "]"}], ",", RowBox[{"{", RowBox[{"t", ",", "0", ",", "15"}], "}"}]}], "]"}], "&"}], "/@", RowBox[{"{", RowBox[{ RowBox[{ RowBox[{ RowBox[{"n", "'"}], "[", "t", "]"}], "==", RowBox[{ RowBox[{"growth", "[", "n", "]"}], "-", RowBox[{"predate", "*", RowBox[{"p2", "[", RowBox[{"n", "[", "t", "]"}], "]"}]}]}]}], ",", RowBox[{ RowBox[{ RowBox[{"n", "'"}], "[", "t", "]"}], "==", RowBox[{ RowBox[{"growth", "[", "n", "]"}], "-", RowBox[{"predate", "*", RowBox[{"p3", "[", RowBox[{"n", "[", "t", "]"}], "]"}]}]}]}]}], "}"}]}]}], ";", "\[IndentingNewLine]", RowBox[{"(*", " ", "plots", " ", "*)"}], "\[IndentingNewLine]", RowBox[{"Column", "[", RowBox[{"{", "\[IndentingNewLine]", RowBox[{"(*", " ", "top", " ", "*)"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"Show", "[", "\[IndentingNewLine]", RowBox[{ RowBox[{"Plot", "[", RowBox[{ RowBox[{"Evaluate", "[", RowBox[{ RowBox[{"n", "[", "t", "]"}], "/.", " ", RowBox[{"sol", "[", RowBox[{"[", "2", "]"}], "]"}]}], "]"}], ",", RowBox[{"{", RowBox[{"t", ",", "0", ",", "15"}], "}"}], ",", RowBox[{"PlotRange", "->", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"0", ",", "15"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "2000"}], "}"}]}], "}"}]}], ",", RowBox[{"ImageSize", "->", "Medium"}], ",", RowBox[{"PlotStyle", "->", "Green"}], ",", RowBox[{"Frame", "->", "True"}], ",", RowBox[{"FrameLabel", "->", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"\"\