(* Content-type: application/vnd.wolfram.mathematica *) (*** Wolfram Notebook File ***) (* http://www.wolfram.com/nb *) (* CreatedBy='Mathematica 9.0' *) (*CacheID: 234*) (* Internal cache information: NotebookFileLineBreakTest NotebookFileLineBreakTest NotebookDataPosition[ 157, 7] NotebookDataLength[ 144141, 3677] NotebookOptionsPosition[ 138743, 3496] NotebookOutlinePosition[ 140069, 3545] CellTagsIndexPosition[ 139822, 3534] WindowFrame->Normal*) (* Beginning of Notebook Content *) Notebook[{ Cell[CellGroupData[{ Cell["MacDonald MWB and SWB with mating", "Title", CellChangeTimes->{{3.5778901648837805`*^9, 3.577890174128309*^9}, { 3.5825817781928864`*^9, 3.5825817869443865`*^9}, {3.608736566197447*^9, 3.608736570389241*^9}, {3.6156446989359207`*^9, 3.615644699539324*^9}, { 3.6156449803532667`*^9, 3.6156449821294527`*^9}}], Cell["D. Gurarie \[Copyright]", "Subtitle", CellChangeTimes->{{3.5778998722050076`*^9, 3.577899877301299*^9}, { 3.6156448570680256`*^9, 3.6156448585570197`*^9}}], Cell["\<\ Supplement notebook for \[OpenCurlyDoubleQuote]Population biology of Schistosoma mating, aggregation, \ and transmission breakpoints : More reliable model analysis for the end - \ game in communities at risk\[CloseCurlyDoubleQuote] by David Gurarie and Charles H.King\ \>", "Text", CellChangeTimes->{{3.6156719851269526`*^9, 3.6156720473794727`*^9}, 3.6157446214287796`*^9}], Cell[CellGroupData[{ Cell["Codes", "Section", CellChangeTimes->{{3.5779290250599575`*^9, 3.5779290296652207`*^9}, { 3.580919000123471*^9, 3.5809190143282833`*^9}, {3.5851448118576202`*^9, 3.585144815928853*^9}, {3.5853998889587173`*^9, 3.585399891148843*^9}, { 3.6087354062392044`*^9, 3.608735462069846*^9}, {3.608735493649914*^9, 3.60873549366092*^9}, {3.608738818004363*^9, 3.608738876219718*^9}, { 3.6088360155985746`*^9, 3.6088360170525455`*^9}, {3.6088360484614973`*^9, 3.608836172516252*^9}, {3.6092504820542684`*^9, 3.6092506109848022`*^9}, { 3.6156449694169717`*^9, 3.615644969928312*^9}, {3.6156453752213793`*^9, 3.6156453757257175`*^9}, {3.6156455714124937`*^9, 3.6156455724441795`*^9}, 3.6156458964976845`*^9}], Cell[CellGroupData[{ Cell["General codes: convert algebraic system to DS et al", "Subsection", CellChangeTimes->{{3.61564492003703*^9, 3.6156449563372493`*^9}, { 3.6156453355981355`*^9, 3.6156453460380993`*^9}, {3.6156459090330434`*^9, 3.615645912489353*^9}, {3.6157488026526427`*^9, 3.6157488055005445`*^9}, 3.6157488846517477`*^9, {3.6157607973161755`*^9, 3.6157607987631416`*^9}}], Cell[BoxData[ RowBox[{ RowBox[{"(*", RowBox[{ RowBox[{"Rules", ":", " ", "head"}], "\[Rule]", "function"}], "*)"}], "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"InR", ":=", RowBox[{ RowBox[{"InterpolatingFunction", "[", "x__", "]"}], ":>", RowBox[{ RowBox[{"InterpolatingFunction", "[", "x", "]"}], "[", "t", "]"}]}]}], ";"}], "\n", RowBox[{"(*", RowBox[{ RowBox[{"Convert", " ", "AS"}], " ", "->", " ", "DS"}], "*)"}], "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"DSV", "[", RowBox[{"as_", ",", "v_", ",", "iv_", ",", "t0_"}], "]"}], ":=", "\[IndentingNewLine]", RowBox[{"Block", "[", RowBox[{ RowBox[{"{", RowBox[{"ru", ",", "va"}], "}"}], ",", "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"ru", "[", "t_", "]"}], "=", RowBox[{"(", RowBox[{ RowBox[{"x_", "/;", RowBox[{"MemberQ", "[", RowBox[{ RowBox[{"Flatten", "@", "v"}], ",", "x"}], "]"}]}], ":>", RowBox[{"x", "[", "t", "]"}]}], ")"}]}], ";", "\[IndentingNewLine]", RowBox[{ RowBox[{"va", "[", "t_", "]"}], "=", RowBox[{"v", "/.", RowBox[{"ru", "@", "t"}]}]}], ";", "\[IndentingNewLine]", RowBox[{"{", RowBox[{ RowBox[{ RowBox[{ RowBox[{"va", "'"}], "[", "t", "]"}], "\[Equal]", RowBox[{"(", RowBox[{"as", "/.", RowBox[{"ru", "@", "t"}]}], ")"}]}], ",", RowBox[{ RowBox[{"va", "[", "t0", "]"}], "\[Equal]", "iv"}]}], "}"}]}]}], "]"}]}], ";"}]}]}]], "Input", CellChangeTimes->{{3.5778998801974645`*^9, 3.5778998923681602`*^9}, { 3.577902063573346*^9, 3.5779020642243834`*^9}, 3.5779045313724966`*^9, { 3.5779070645123835`*^9, 3.5779070685366135`*^9}, {3.5779077995694265`*^9, 3.577907821504681*^9}, {3.5779790541160493`*^9, 3.577979060358406*^9}, 3.5779806000744734`*^9, 3.577980905229927*^9, {3.577980937255759*^9, 3.577980955726815*^9}, 3.5779813407128353`*^9, 3.5779820713156233`*^9, 3.5779843414084654`*^9, 3.578490250407954*^9, 3.5785174671541557`*^9, { 3.57851753978831*^9, 3.5785175403453417`*^9}, {3.5807430309386325`*^9, 3.580743042349285*^9}, 3.5808271939086456`*^9, {3.5808404139487886`*^9, 3.5808404327088614`*^9}, {3.5809265316342487`*^9, 3.5809265587487993`*^9}, {3.5810184026004486`*^9, 3.5810184042045403`*^9}, 3.581020253799331*^9, 3.581093162019294*^9, {3.5822226390600147`*^9, 3.5822226425832157`*^9}, {3.5822234201864233`*^9, 3.582223423241598*^9}, { 3.5832662068060226`*^9, 3.583266207027035*^9}, 3.583765224115343*^9, 3.583765265636718*^9, 3.5842867251729445`*^9, {3.584405139246133*^9, 3.584405156212104*^9}, {3.5844052019637203`*^9, 3.584405203045782*^9}, 3.585086055331216*^9, 3.585243137802143*^9, 3.5853366352790956`*^9, 3.5872437294706173`*^9, {3.6109086051946187`*^9, 3.61090860790842*^9}, { 3.615645315256566*^9, 3.6156453159130077`*^9}, 3.6157486318056726`*^9, 3.6157488423595376`*^9, {3.6157488928272033`*^9, 3.615748983935976*^9}, { 3.6157608097694845`*^9, 3.6157608366554193`*^9}, {3.615760890360245*^9, 3.6157608909036117`*^9}, {3.615760936476196*^9, 3.6157609385385695`*^9}}, CellTags->"General"] }, Closed]], Cell[CellGroupData[{ Cell["Plotting codes", "Subsection", CellChangeTimes->{{3.5853998728927984`*^9, 3.585399878048094*^9}, { 3.615645424886508*^9, 3.6156454258691635`*^9}}], Cell[BoxData[ RowBox[{ RowBox[{"(*", RowBox[{"Plot", " ", "time", " ", "series"}], "*)"}], "\n", RowBox[{ RowBox[{ RowBox[{ RowBox[{"PTS", "[", RowBox[{"f_", ",", RowBox[{"{", RowBox[{"t1_", ",", "t2_"}], "}"}], ",", "ra_", ",", "st_", ",", "la_", ",", "op___"}], "]"}], ":=", RowBox[{"Plot", "[", RowBox[{ RowBox[{"Evaluate", "@", "f"}], ",", RowBox[{"{", RowBox[{"t", ",", "t1", ",", "t2"}], "}"}], ",", RowBox[{"PlotRange", "\[Rule]", "ra"}], ",", RowBox[{"PlotStyle", "\[Rule]", "st"}], ",", RowBox[{"Frame", "\[Rule]", "True"}], ",", RowBox[{"FrameLabel", "\[Rule]", "la"}], ",", RowBox[{"BaseStyle", "\[Rule]", RowBox[{"{", RowBox[{"12", ",", "Italic"}], "}"}]}], ",", "op"}], "]"}]}], ";"}], "\n", RowBox[{ RowBox[{"Bst", "=", RowBox[{"BaseStyle", "\[Rule]", RowBox[{"{", RowBox[{"12", ",", "Italic"}], "}"}]}]}], ";"}], "\n", RowBox[{ RowBox[{ RowBox[{"FrT", "[", "r_", "]"}], ":=", RowBox[{"FrameTicks", "\[Rule]", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"N", "@", RowBox[{"FindDivisions", "[", RowBox[{"r", ",", "4"}], "]"}]}], ",", RowBox[{"{", "}"}]}], "}"}], ",", RowBox[{"{", RowBox[{"Automatic", ",", RowBox[{"{", "}"}]}], "}"}]}], "}"}]}]}], ";"}], "\[IndentingNewLine]", RowBox[{"(*", RowBox[{"Graphics", " ", "Row"}], "*)"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"GRo", "[", RowBox[{"g_", ",", "op___"}], "]"}], ":=", RowBox[{"GraphicsRow", "[", RowBox[{"g", ",", RowBox[{"ImageSize", "\[Rule]", "Large"}], ",", RowBox[{"Spacings", "\[Rule]", RowBox[{"-", "10"}]}], ",", "op"}], "]"}]}], "\n", RowBox[{"(*", RowBox[{"Legend", " ", "Label"}], "*)"}], RowBox[{ RowBox[{"LaB", "[", RowBox[{"n_", ",", "v_"}], "]"}], ":=", RowBox[{"n", "<>", "\"\< = \>\"", "<>", RowBox[{"ToString", "@", "v"}]}]}], "\[IndentingNewLine]", RowBox[{"SetAttributes", "[", RowBox[{"LaB", ",", "Listable"}], "]"}]}]}]], "Input", CellChangeTimes->{ 3.5870548289133987`*^9, {3.587054864234419*^9, 3.587054876433117*^9}, { 3.587054950572357*^9, 3.587054966597274*^9}, 3.587070828746537*^9, 3.5870708793544316`*^9, {3.587325507535099*^9, 3.5873255174486656`*^9}, { 3.6087418581468563`*^9, 3.608741862297632*^9}, {3.6088183668748627`*^9, 3.6088183768104897`*^9}, 3.608836191538274*^9, {3.6088362844482536`*^9, 3.6088362958758802`*^9}, {3.610317765595285*^9, 3.610317771453169*^9}, 3.6156454615929995`*^9, 3.615645561759055*^9, {3.615646036870321*^9, 3.6156460374847345`*^9}, {3.6156460799480705`*^9, 3.615646080475422*^9}, { 3.615646183785347*^9, 3.615646184408759*^9}, {3.6156462932213736`*^9, 3.6156463090149035`*^9}, {3.6157613958370285`*^9, 3.6157613964214144`*^9}, {3.615761436079873*^9, 3.6157614634431214`*^9}, { 3.615762072713671*^9, 3.6157620730729103`*^9}, {3.6157623267973394`*^9, 3.6157623282853355`*^9}}, CellTags->"Plot"] }, Closed]], Cell[CellGroupData[{ Cell["Macdonald MWB with mating", "Subsection", CellChangeTimes->{{3.586984890101008*^9, 3.5869848984374847`*^9}, { 3.615645077281225*^9, 3.6156450777855635`*^9}, {3.6156454908294992`*^9, 3.615645508885543*^9}, 3.6157489945873013`*^9, {3.6157612478724875`*^9, 3.6157612494955697`*^9}, {3.6157626103814383`*^9, 3.615762618621937*^9}, { 3.6157626831249647`*^9, 3.6157626868844757`*^9}}], Cell[BoxData[ RowBox[{ RowBox[{"(*", RowBox[{ RowBox[{ RowBox[{ RowBox[{"Macdonald", " ", "with", " ", RowBox[{"human", "/", "snail"}], " ", "FOI"}], " ", "=", RowBox[{"(", RowBox[{"Lh", ",", "Ls"}], ")"}]}], ";", " ", RowBox[{"mortalities", " ", "=", RowBox[{"(", RowBox[{"mw", ",", "ms"}], ")"}]}]}], ",", " ", RowBox[{"snail", " ", "pop", " ", "s"}]}], "*)"}], "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{ RowBox[{"MacF", "[", RowBox[{"(*", RowBox[{"H", "-", RowBox[{"S", " ", "FI"}]}], "*)"}], RowBox[{ RowBox[{"{", RowBox[{"Lh_", ",", "Ls_"}], "}"}], ",", RowBox[{"{", RowBox[{"(*", RowBox[{"worm", " ", "mort"}], "*)"}], RowBox[{"mw_", ",", RowBox[{"(*", RowBox[{"snail", " ", "mort"}], "*)"}], "ms_"}], "}"}], ",", RowBox[{"(*", RowBox[{"snail", " ", "pop"}], "*)"}], "s_"}], "]"}], ":=", RowBox[{"{", RowBox[{ RowBox[{"Lh", "-", RowBox[{"mw", " ", "w"}]}], ",", RowBox[{ RowBox[{"Ls", " ", FractionBox["w", "2"], RowBox[{"(", RowBox[{"s", "-", "y"}], ")"}]}], "-", RowBox[{"ms", " ", "y"}]}]}], "}"}]}], ";"}], "\[IndentingNewLine]", RowBox[{"(*", RowBox[{"Monogamous", " ", "NB", " ", "mating", " ", "function"}], "*)"}], "\n", RowBox[{ RowBox[{ RowBox[{"\[Phi]NB", "[", RowBox[{"m_", ",", "k_"}], "]"}], "=", RowBox[{"1", "-", RowBox[{"Hypergeometric2F1", "[", RowBox[{ FractionBox["1", "2"], ",", RowBox[{"1", "+", "k"}], ",", "2", ",", FractionBox[ RowBox[{ RowBox[{"-", "2"}], "m"}], "k"]}], "]"}]}]}], ";"}], "\[IndentingNewLine]", RowBox[{"(*", RowBox[{"NB", " ", "zero", " ", "Prevalence"}], "*)"}], "\n", RowBox[{ RowBox[{ RowBox[{"pNB", "[", RowBox[{"w_", ",", "k_"}], "]"}], "=", RowBox[{"1", "-", RowBox[{ SuperscriptBox[ RowBox[{"(", FractionBox["k", RowBox[{"w", "+", "k"}]], ")"}], "k"], RowBox[{"(", RowBox[{"1", "+", FractionBox[ RowBox[{"k", " ", "w"}], RowBox[{"k", "+", "w"}]]}], ")"}]}]}]}], ";"}], "\[IndentingNewLine]", RowBox[{"(*", RowBox[{"NB", " ", "Mated", " ", "Macd"}], "*)"}], "\n", RowBox[{ RowBox[{ RowBox[{"MdN", "[", RowBox[{ RowBox[{"{", RowBox[{"a_", ",", "b_", ",", "k_", ",", "mw_", ",", "ms_"}], "}"}], ",", "s_"}], "]"}], "=", RowBox[{"MacF", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"a", " ", "y"}], ",", RowBox[{"b", " ", RowBox[{"\[Phi]NB", "[", RowBox[{"w", ",", "k"}], "]"}]}]}], "}"}], ",", RowBox[{"{", RowBox[{"mw", ",", "ms"}], "}"}], ",", "s"}], "]"}]}], ";"}], "\[IndentingNewLine]", RowBox[{"(*", RowBox[{"y", "-", RowBox[{"Equilibria", " ", "F", RowBox[{"(", "y", ")"}], " ", "for", " ", "mated", " ", "Macdonald"}]}], " ", "*)"}], "\n", RowBox[{ RowBox[{ RowBox[{"Eqy", "[", RowBox[{ RowBox[{"{", RowBox[{"a_", ",", "b_", ",", "k_", ",", "mw_", ",", "ms_"}], "}"}], ",", "s_"}], "]"}], "=", RowBox[{ RowBox[{"(", RowBox[{ RowBox[{ FractionBox[ RowBox[{"a", " ", "b"}], RowBox[{"2", " ", "mw", " ", "ms"}]], " ", RowBox[{"\[Phi]NB", "[", RowBox[{ RowBox[{ FractionBox["a", "mw"], " ", "y"}], ",", "k"}], "]"}], RowBox[{"(", RowBox[{"s", "-", "y"}], ")"}]}], "-", "1"}], ")"}], "y"}]}], ";"}]}]}]], "Input", CellChangeTimes->{{3.6087374218618555`*^9, 3.6087374374092298`*^9}, { 3.6087374803848968`*^9, 3.6087375309376187`*^9}, {3.6087375849124603`*^9, 3.6087376438968105`*^9}, {3.608737682465538*^9, 3.6087377197694235`*^9}, 3.6087378064034357`*^9, 3.6087378378904414`*^9, 3.6087381221769867`*^9, { 3.60873831775271*^9, 3.6087383237196903`*^9}, {3.6087384617777824`*^9, 3.6087385257755957`*^9}, 3.6087385564280376`*^9, {3.6087387243839073`*^9, 3.608738733217802*^9}, 3.6087397401666307`*^9, {3.6092789460665536`*^9, 3.609278952157598*^9}, {3.609345665064702*^9, 3.609345672871888*^9}, { 3.6093457244851294`*^9, 3.6093457307342668`*^9}, {3.60995934520601*^9, 3.609959347017205*^9}, 3.6099595884962196`*^9, {3.6099596218563557`*^9, 3.6099596567725153`*^9}, {3.6099599200763483`*^9, 3.609959921779478*^9}, { 3.6099599589841614`*^9, 3.609959999437998*^9}, 3.6099713200387383`*^9, 3.6101092396992464`*^9, {3.6156451768172226`*^9, 3.615645177392606*^9}, { 3.6156452158622646`*^9, 3.6156452164296436`*^9}, {3.615645271031064*^9, 3.6156452921561584`*^9}, {3.6156454888922014`*^9, 3.6156455121407127`*^9}, 3.6156459626658273`*^9, 3.615647095523388*^9, 3.6157487049634767`*^9, { 3.615761039377839*^9, 3.615761052061301*^9}, {3.6157611159084606`*^9, 3.615761116419799*^9}, {3.615761155393797*^9, 3.6157611565225506`*^9}, { 3.615761193082942*^9, 3.6157611964521923`*^9}, 3.6157612411720166`*^9}, CellTags->{"Macd code", "Breakpoint"}] }, Closed]], Cell[CellGroupData[{ Cell["SWB with mating", "Subsection", CellChangeTimes->{{3.5817779450288205`*^9, 3.581777953381298*^9}, { 3.5841050798192825`*^9, 3.5841050935140657`*^9}, {3.5851446275340776`*^9, 3.585144630169228*^9}, 3.588018355546507*^9}], Cell[BoxData[ RowBox[{ RowBox[{"(*", RowBox[{"Host", " ", "system"}], "*)"}], "\n", RowBox[{ RowBox[{ RowBox[{ RowBox[{"HTM", "[", RowBox[{ RowBox[{"{", RowBox[{"\[Lambda]_", ",", "\[Mu]_", ",", "\[Gamma]_"}], "}"}], ",", "n_", ",", "h_"}], "]"}], ":=", "\[IndentingNewLine]", RowBox[{ RowBox[{"Table", "[", RowBox[{ RowBox[{ RowBox[{"\[Lambda]", " ", RowBox[{"h", "[", RowBox[{"k", "-", "1"}], "]"}]}], "-", RowBox[{ RowBox[{"(", RowBox[{ RowBox[{"\[Lambda]", " ", RowBox[{"Sign", "[", RowBox[{"n", "-", "k"}], "]"}]}], "+", RowBox[{"k", " ", "\[Gamma]"}], "+", "\[Mu]"}], ")"}], RowBox[{"h", "[", "k", "]"}]}], "+", RowBox[{ RowBox[{"(", RowBox[{"k", "+", "1"}], ")"}], "\[Gamma]", " ", RowBox[{"h", "[", RowBox[{"k", "+", "1"}], "]"}]}]}], ",", RowBox[{"{", RowBox[{"k", ",", "0", ",", "n"}], "}"}]}], "]"}], "/.", RowBox[{"{", RowBox[{ RowBox[{ RowBox[{"h", "[", RowBox[{"-", "1"}], "]"}], "\[Rule]", "0"}], ",", RowBox[{ RowBox[{"h", "[", RowBox[{"n", "+", "1"}], "]"}], "\[Rule]", "0"}]}], "}"}]}]}], ";"}], "\[IndentingNewLine]", RowBox[{"(*", RowBox[{"Monogamous", " ", "mated", " ", "couples", " ", "count"}], "*)"}], "\n", RowBox[{ RowBox[{ RowBox[{"MC", "[", "n_", "]"}], "=", RowBox[{ FractionBox["n", "2"], RowBox[{"(", RowBox[{"1", "-", RowBox[{ SuperscriptBox["2", RowBox[{ RowBox[{"-", "2"}], RowBox[{"Floor", "[", RowBox[{"n", "/", "2"}], "]"}]}]], RowBox[{"Binomial", "[", RowBox[{ RowBox[{"2", RowBox[{"Floor", "[", RowBox[{"n", "/", "2"}], "]"}]}], ",", RowBox[{"Floor", "[", RowBox[{"n", "/", "2"}], "]"}]}], "]"}]}]}], ")"}]}]}], ";"}], "\n", RowBox[{"(*", RowBox[{"Mated", " ", "Couple", " ", "count", " ", "withAllee"}], "*)"}], "\n", RowBox[{ RowBox[{ RowBox[{"MCa", "[", RowBox[{"n_", ",", "q_"}], "]"}], "=", RowBox[{ RowBox[{"MC", "[", "n", "]"}], RowBox[{"(", RowBox[{"1", "-", SuperscriptBox["q", "n"]}], ")"}]}]}], ";"}], "\n", RowBox[{"(*", RowBox[{ RowBox[{"SWB", " ", "with", " ", "mating"}], " ", "+", " ", RowBox[{"Allee", " ", "q"}]}], "*)"}], "\n", RowBox[{ RowBox[{ RowBox[{"SWA", "[", RowBox[{"(*", "strata", "*)"}], RowBox[{ RowBox[{"{", RowBox[{"n_", ",", "dw_", ",", "q_"}], "}"}], ",", RowBox[{"(*", RowBox[{"Demographics", "/", "biology"}], "*)"}], RowBox[{"{", RowBox[{"\[Mu]_", ",", "\[Gamma]_", ",", "\[Nu]_"}], "}"}], ",", RowBox[{"(*", RowBox[{ RowBox[{ RowBox[{"Absolute", " ", "Transmision", " ", RowBox[{"rates", ":", " ", "a"}]}], "=", RowBox[{"a", "*", "\[Gamma]"}]}], ";", RowBox[{"b", "=", RowBox[{"b", "*", "\[Nu]"}]}]}], "*)"}], RowBox[{"{", RowBox[{"a_", ",", "b_"}], "}"}], ",", RowBox[{"(*", "name", "*)"}], "h_", ",", RowBox[{"(*", "Source", "*)"}], "so_"}], "]"}], ":=", "\[IndentingNewLine]", RowBox[{"{", RowBox[{ RowBox[{"(", RowBox[{ RowBox[{"HTM", "[", RowBox[{ RowBox[{"{", RowBox[{ FractionBox[ RowBox[{"a", " ", "y"}], "dw"], ",", "\[Mu]", ",", "\[Gamma]"}], "}"}], ",", "n", ",", "h"}], "]"}], "+", "so"}], ")"}], ",", RowBox[{ RowBox[{"b", " ", RowBox[{"Sum", "[", " ", RowBox[{ RowBox[{ RowBox[{"MC", "[", RowBox[{"dw", " ", "k"}], "]"}], RowBox[{"(", RowBox[{"1", "-", SuperscriptBox["q", RowBox[{"dw", " ", "k"}]]}], ")"}], RowBox[{"h", "[", "k", "]"}]}], ",", RowBox[{"{", RowBox[{"k", ",", "n"}], "}"}]}], "]"}], RowBox[{"(", RowBox[{"1", "-", "y"}], ")"}]}], "-", " ", RowBox[{"\[Nu]", " ", "y"}]}]}], "}"}]}], ";"}], "\n", RowBox[{"(*", " ", RowBox[{"SWB", " ", "children", " ", "equilibria"}], " ", "*)"}], "\n", RowBox[{ RowBox[{ RowBox[{"SWc", "[", RowBox[{"l_", ",", "m_", ",", "nn_"}], "]"}], ":=", "\[IndentingNewLine]", RowBox[{"Module", "[", RowBox[{ RowBox[{"{", RowBox[{"BaM", ",", "h"}], "}"}], ",", "\[IndentingNewLine]", RowBox[{"(*", RowBox[{"Band", " ", "matrix"}], "*)"}], "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"BaM", "[", RowBox[{"(*", "FI", "*)"}], RowBox[{"L_", ",", RowBox[{"(*", RowBox[{"Host", " ", "turnover"}], "*)"}], "M_", ",", RowBox[{"(*", RowBox[{"Parasite", " ", "mort"}], "*)"}], "\[Gamma]_", ",", RowBox[{"(*", "strata", "*)"}], "n_"}], "]"}], ":=", RowBox[{"SparseArray", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{ RowBox[{"Band", "[", RowBox[{"{", RowBox[{"1", ",", "1"}], "}"}], "]"}], "->", RowBox[{"-", RowBox[{"(", RowBox[{ RowBox[{"L", RowBox[{"(", RowBox[{"1", "-", RowBox[{"UnitVector", "[", RowBox[{"n", ",", "n"}], "]"}]}], ")"}]}], "+", "M", "+", RowBox[{"\[Gamma]", " ", RowBox[{"Range", "[", RowBox[{"0", ",", RowBox[{"n", "-", "1"}]}], "]"}]}]}], ")"}]}]}], ",", RowBox[{ RowBox[{"Band", "[", RowBox[{"{", RowBox[{"2", ",", "1"}], "}"}], "]"}], "\[Rule]", "L"}], ",", RowBox[{ RowBox[{"Band", "[", RowBox[{"{", RowBox[{"1", ",", "2"}], "}"}], "]"}], "\[Rule]", RowBox[{"\[Gamma]", " ", RowBox[{"Range", "[", RowBox[{"n", "-", "1"}], "]"}]}]}]}], "}"}], ",", RowBox[{"{", RowBox[{"n", ",", "n"}], "}"}]}], "]"}]}], ";", RowBox[{"(*", RowBox[{ "H", " ", "equilibrium", " ", "distribution", " ", "with", " ", "source", " ", "so"}], "*)"}], RowBox[{"h", "=", RowBox[{ RowBox[{"(", RowBox[{"Inverse", "@", RowBox[{"BaM", "[", RowBox[{"l", ",", "m", ",", "1", ",", RowBox[{"nn", "+", "1"}]}], "]"}]}], ")"}], ".", " ", RowBox[{"UnitVector", "[", RowBox[{ RowBox[{"nn", "+", "1"}], ",", "1"}], "]"}]}]}], ";", "\[IndentingNewLine]", FractionBox["h", RowBox[{"Total", "@", "h"}]]}]}], "]"}]}], ";"}], "\n", RowBox[{"SetAttributes", "[", RowBox[{"SWc", ",", "Listable"}], "]"}], "\[IndentingNewLine]", RowBox[{"(*", RowBox[{ RowBox[{"Auxiliary", " ", "f"}], "-", RowBox[{"n", " ", "for", " ", "SWB"}], "-", "prevalence"}], "*)"}], "\n", RowBox[{ RowBox[{ RowBox[{"BPS", "[", RowBox[{"n_", ",", "p_"}], "]"}], "=", RowBox[{"Clip", "[", RowBox[{ RowBox[{ RowBox[{"-", "1"}], "+", RowBox[{ SuperscriptBox["2", RowBox[{"1", "-", "n"}]], " ", RowBox[{"Binomial", "[", RowBox[{"n", ",", "p"}], "]"}], " ", RowBox[{"Hypergeometric2F1", "[", RowBox[{"1", ",", RowBox[{ RowBox[{"-", "n"}], "+", "p"}], ",", RowBox[{"1", "+", "p"}], ",", RowBox[{"-", "1"}]}], "]"}]}]}], ",", RowBox[{"{", RowBox[{"0", ",", "1"}], "}"}]}], "]"}]}], ";"}], "\n", RowBox[{"(*", RowBox[{"Infected", " ", "prevalence", " ", "P", RowBox[{"(", RowBox[{ RowBox[{"MC", ">", RowBox[{"1", "/", "p"}]}], "=", RowBox[{"1", "-", SuperscriptBox["q", "n"]}]}], ")"}]}], "*)"}], "\n", RowBox[{ RowBox[{"pSW", "[", RowBox[{ RowBox[{"{", RowBox[{"l_", ",", "m_", ",", "q_"}], "}"}], ",", "n_", ",", "dw_"}], "]"}], ":=", RowBox[{ RowBox[{"(", RowBox[{"Rest", "@", RowBox[{"SWc", "[", RowBox[{ RowBox[{"l", "/", "dw"}], ",", "m", ",", "n"}], "]"}]}], ")"}], ".", RowBox[{"BPS", "[", RowBox[{ RowBox[{"dw", " ", RowBox[{"Range", "@", "n"}]}], ",", RowBox[{"1", "/", RowBox[{"(", RowBox[{"1", "-", SuperscriptBox["q", RowBox[{"dw", " ", RowBox[{"Range", "@", "n"}]}]]}], ")"}]}]}], "]"}]}]}]}]}]], "Input", CellChangeTimes->{{3.6088181241993074`*^9, 3.608818132353747*^9}, 3.60881827944587*^9, {3.608818716523614*^9, 3.6088187243608427`*^9}, 3.608819382435127*^9, 3.608835746709898*^9, {3.608836854373345*^9, 3.608836864118849*^9}, {3.6089987683060727`*^9, 3.608998768880452*^9}, { 3.6091046606307926`*^9, 3.609104664989699*^9}, 3.6092506225234575`*^9, 3.6092514467768493`*^9, {3.6092515454222927`*^9, 3.6092515545268793`*^9}, 3.609982496022972*^9, 3.6100306235620975`*^9, {3.6100306724895554`*^9, 3.6100306728808126`*^9}, 3.6100730858276925`*^9, {3.6102963930296755`*^9, 3.610296411636015*^9}, {3.610297911715812*^9, 3.6102979388084702`*^9}, { 3.6102986570347047`*^9, 3.610298662883586*^9}, 3.6102986971713305`*^9, { 3.610303350657282*^9, 3.6103033586215696`*^9}, 3.610477189182209*^9, 3.6104773121964073`*^9, {3.6104774606152782`*^9, 3.610477460997531*^9}, { 3.610477497718891*^9, 3.6104775095367303`*^9}, 3.6104784458416705`*^9, 3.6104784993363557`*^9, 3.610478626405652*^9, 3.61144400288241*^9, { 3.613849054797989*^9, 3.613849055306328*^9}, {3.6156456311113167`*^9, 3.6156456402103863`*^9}, {3.6156457132080765`*^9, 3.6156457191976366`*^9}, {3.6156457603490887`*^9, 3.6156457644198008`*^9}, {3.6157513127098303`*^9, 3.6157513490313473`*^9}, 3.615761365100526*^9}, CellTags->"SWB"] }, Closed]] }, Open ]], Cell[CellGroupData[{ Cell["NB/Poisson vs SWB distributions", "Section", CellChangeTimes->{{3.609177005599506*^9, 3.6091770094350576`*^9}, { 3.609345880865399*^9, 3.6093458834661293`*^9}, {3.6102293910300894`*^9, 3.610229396916994*^9}, {3.6157419524560146`*^9, 3.615741954639471*^9}}], Cell[BoxData[ RowBox[{ RowBox[{"(*", RowBox[{"NB", RowBox[{"(", RowBox[{"k", ",", "w"}]}]}], "*)"}], RowBox[{ RowBox[{ RowBox[{ RowBox[{"NB", "[", RowBox[{"k_", ",", "m_"}], "]"}], "=", RowBox[{"NegativeBinomialDistribution", "[", RowBox[{"k", ",", FractionBox["k", RowBox[{"k", "+", "m"}]]}], "]"}]}], ";"}], "\[IndentingNewLine]", RowBox[{"(*", RowBox[{"Poisson", " ", "PDF"}], "*)"}], RowBox[{ RowBox[{ RowBox[{"Poi", "[", RowBox[{"m_", ",", "n_"}], "]"}], "=", FractionBox[ RowBox[{ SuperscriptBox["\[ExponentialE]", RowBox[{"-", "m"}]], " ", SuperscriptBox["m", "n"]}], RowBox[{"n", "!"}]]}], ";"}], "\n", RowBox[{"(*", RowBox[{ RowBox[{"Plot", " ", "SWB"}], ",", " ", RowBox[{"data", "-", RowBox[{"range", ":", " ", RowBox[{"normalized", " ", "SWB"}]}]}]}], "*)"}], "\n", RowBox[{ RowBox[{ RowBox[{"dSW", "[", RowBox[{"l_", ",", "m_", ",", "n_"}], "]"}], ":=", RowBox[{"Thread", "@", RowBox[{"{", RowBox[{ RowBox[{"Range", "[", RowBox[{"0", ",", "n"}], "]"}], ",", RowBox[{"SWc", "[", RowBox[{"l", ",", "m", ",", "n"}], "]"}]}], "}"}]}]}], ";"}], "\n", RowBox[{"(*", "Poisson", "*)"}], "\n", RowBox[{ RowBox[{ RowBox[{"NB", "[", RowBox[{"\"\<\[Infinity]\>\"", ",", "m_"}], "]"}], "=", RowBox[{"PoissonDistribution", "[", "m", "]"}]}], ";"}]}]}]], "Input", CellChangeTimes->{ 3.609120870458083*^9, 3.609163850836802*^9, 3.6091641286690707`*^9, 3.609344358887901*^9, 3.6093453341313615`*^9, {3.609345494478422*^9, 3.609345497285287*^9}, 3.609345909090126*^9, 3.6093519164982023`*^9, 3.6093521518267126`*^9, {3.609358753089151*^9, 3.609358765631468*^9}, { 3.615669147225474*^9, 3.6156691934823327`*^9}}], Cell[CellGroupData[{ Cell["Distribution Plots", "Subsection", CellChangeTimes->{{3.6093459201314507`*^9, 3.609345924475333*^9}, { 3.6157490652264233`*^9, 3.6157490730106173`*^9}}], Cell[BoxData[ RowBox[{ RowBox[{"(*", RowBox[{"NB", " ", "with", " ", "different", " ", "k"}], "*)"}], "\[IndentingNewLine]", RowBox[{"Plot", "[", RowBox[{ RowBox[{"Evaluate", "[", RowBox[{"{", RowBox[{"Table", "[", RowBox[{ RowBox[{"PDF", "[", RowBox[{ RowBox[{"NB", "[", RowBox[{"k", ",", "10"}], "]"}], ",", "n"}], "]"}], ",", RowBox[{"{", RowBox[{"k", ",", RowBox[{"(*", RowBox[{"k", "-", "values"}], "*)"}], RowBox[{"kk1", "=", RowBox[{"{", RowBox[{".1", ",", "1", ",", "5", ",", "\"\<\[Infinity]\>\""}], "}"}]}]}], "}"}]}], "]"}], "}"}], "]"}], ",", RowBox[{"{", RowBox[{"n", ",", "0", ",", "25"}], "}"}], ",", RowBox[{"PlotLegends", "\[Rule]", RowBox[{"Placed", "[", RowBox[{ RowBox[{"LaB", "[", RowBox[{"\"\\"", ",", "kk1"}], "]"}], ",", RowBox[{"{", RowBox[{"Right", ",", "Top"}], "}"}]}], "]"}]}], ",", "\[IndentingNewLine]", RowBox[{"PlotRange", "\[Rule]", RowBox[{"{", RowBox[{"0", ",", ".25"}], "}"}]}], ",", RowBox[{"Frame", "\[Rule]", "True"}], ",", RowBox[{"FrameLabel", "\[Rule]", RowBox[{"{", RowBox[{ "\"\\"", ",", "\"\<\!\(\*SubscriptBox[\(h\), \(n\)]\)\>\""}], "}"}]}], ",", RowBox[{"BaseStyle", "\[Rule]", RowBox[{"{", RowBox[{"12", ",", "Italic"}], "}"}]}]}], "]"}]}]], "Input", CellChangeTimes->{{3.6093453629144487`*^9, 3.6093453644904947`*^9}, { 3.6093453952375855`*^9, 3.60934545907894*^9}, {3.609345504666177*^9, 3.609345543438902*^9}, {3.609354378256769*^9, 3.6093543827027187`*^9}, { 3.6093547695040445`*^9, 3.6093547697362003`*^9}, {3.609354889272151*^9, 3.6093548988465023`*^9}, {3.6093587838535614`*^9, 3.6093587934599347`*^9}, {3.6093592931475644`*^9, 3.609359311565781*^9}, 3.615669194840237*^9, {3.6157617801523013`*^9, 3.615761784288066*^9}, 3.615762164335965*^9}], Cell[BoxData[ RowBox[{ RowBox[{"(*", RowBox[{"SWB", " ", "with", " ", "different", " ", "\[Mu]"}], "*)"}], "\[IndentingNewLine]", RowBox[{"ListPlot", "[", RowBox[{ RowBox[{ RowBox[{ RowBox[{"dSW", "[", RowBox[{ StyleBox["10", FontColor->RGBColor[1, 0, 0]], ",", "#", ",", "25"}], "]"}], "&"}], "/@", RowBox[{"(", RowBox[{"mm2", "=", RowBox[{"{", RowBox[{".2", ",", "2", ",", "10"}], "}"}]}], ")"}]}], ",", RowBox[{"PlotMarkers", "\[Rule]", "Automatic"}], ",", RowBox[{"Joined", "\[Rule]", "True"}], ",", RowBox[{"PlotRange", "\[Rule]", RowBox[{"{", RowBox[{"0", ",", ".25"}], "}"}]}], ",", RowBox[{"Frame", "\[Rule]", "True"}], ",", RowBox[{"PlotLegends", "\[Rule]", RowBox[{"Placed", "[", RowBox[{ RowBox[{"LaB", "[", RowBox[{"\"\<\[Mu]\>\"", ",", "mm2"}], "]"}], ",", RowBox[{"{", RowBox[{"Right", ",", "Top"}], "}"}]}], "]"}]}], ",", "Bst", ",", RowBox[{"FrameLabel", "\[Rule]", RowBox[{"{", RowBox[{ "\"\\"", ",", "\"\<\!\(\*SubscriptBox[\(h\), \(n\)]\)\>\""}], "}"}]}]}], "]"}]}]], "Input", CellChangeTimes->{{3.6093459341780987`*^9, 3.6093459613721423`*^9}, { 3.60934600497406*^9, 3.60934618533933*^9}, 3.6093523888150907`*^9, { 3.6093524238553324`*^9, 3.6093524244377227`*^9}, {3.609352569238103*^9, 3.609352627421851*^9}, {3.6093527079332647`*^9, 3.6093527460135217`*^9}, { 3.6093530614567804`*^9, 3.6093531246757174`*^9}, {3.6093535083477173`*^9, 3.609353509011162*^9}, {3.609353602515106*^9, 3.6093536087252336`*^9}, { 3.6093539982152853`*^9, 3.609353998430428*^9}, {3.609354029422985*^9, 3.6093540458939104`*^9}, {3.609354095246764*^9, 3.60935413661421*^9}, { 3.6093541805343432`*^9, 3.609354213669324*^9}, {3.6093542520540485`*^9, 3.6093543097153034`*^9}, 3.6093543913714685`*^9, {3.6093547529290485`*^9, 3.6093547779676604`*^9}, 3.6093548264244585`*^9, {3.6093548566465073`*^9, 3.6093548642705665`*^9}, {3.6093549246175985`*^9, 3.6093549255191984`*^9}, {3.6093588235959206`*^9, 3.609358830256342*^9}, { 3.6093593219887*^9, 3.609359332389595*^9}, 3.615750919286845*^9, 3.6157621807839413`*^9}], Cell[BoxData[ RowBox[{ RowBox[{"(*", RowBox[{"Poisson", " ", "with", " ", "different", " ", "mean"}], "*)"}], RowBox[{"DiscretePlot", "[", RowBox[{ RowBox[{"Evaluate", "@", RowBox[{"Poi", "[", RowBox[{ RowBox[{"mm1", "=", RowBox[{"{", RowBox[{".3", ",", "1", ",", "5", ",", "10"}], "}"}]}], ",", "n"}], "]"}]}], ",", RowBox[{"{", RowBox[{"n", ",", "0", ",", "20"}], "}"}], ",", RowBox[{"PlotRange", "\[Rule]", RowBox[{"{", RowBox[{"0", ",", ".8"}], "}"}]}], ",", RowBox[{"Frame", "\[Rule]", "True"}], ",", RowBox[{"PlotMarkers", "\[Rule]", "Automatic"}], ",", RowBox[{"Joined", "\[Rule]", "True"}], ",", RowBox[{"Filling", "\[Rule]", "None"}], ",", RowBox[{"PlotLegends", "\[Rule]", RowBox[{"Placed", "[", RowBox[{ RowBox[{"LaB", "[", RowBox[{"\"\\"", ",", "mm1"}], "]"}], ",", RowBox[{"{", RowBox[{"Right", ",", "Top"}], "}"}]}], "]"}]}], ",", RowBox[{"BaseStyle", "\[Rule]", RowBox[{"{", RowBox[{"12", ",", "Italic"}], "}"}]}], ",", RowBox[{"FrameLabel", "\[Rule]", RowBox[{"{", RowBox[{ "\"\\"", ",", "\"\<\!\(\*SubscriptBox[\(h\), \(n\)]\)\>\""}], "}"}]}]}], "]"}]}]], "Input", CellChangeTimes->{{3.6093533919064765`*^9, 3.6093534868434525`*^9}, { 3.6093535310847206`*^9, 3.6093535717016644`*^9}, {3.609353622980683*^9, 3.6093536320557013`*^9}, {3.6093546656811714`*^9, 3.60935466593734*^9}, 3.6093546975693245`*^9, {3.6093549402949986`*^9, 3.609354940966444*^9}, { 3.609358879603079*^9, 3.6093588853408823`*^9}, {3.609359352436899*^9, 3.6093593612597537`*^9}, 3.615762191562127*^9}], Cell[BoxData[ RowBox[{ RowBox[{"(*", RowBox[{"SWB", " ", "with", " ", "differnt", " ", "\[Lambda]"}], "*)"}], "\[IndentingNewLine]", RowBox[{"ListPlot", "[", RowBox[{ RowBox[{ RowBox[{ RowBox[{"dSW", "[", RowBox[{"#", ",", ".1", ",", "20"}], "]"}], "&"}], "/@", RowBox[{"{", RowBox[{".3", ",", "1", ",", "5", ",", "10"}], "}"}]}], ",", RowBox[{"PlotMarkers", "\[Rule]", "Automatic"}], ",", RowBox[{"Joined", "\[Rule]", "True"}], ",", RowBox[{"PlotRange", "\[Rule]", RowBox[{"{", RowBox[{"0", ",", ".8"}], "}"}]}], ",", RowBox[{"Frame", "\[Rule]", "True"}], ",", RowBox[{"PlotLegends", "\[Rule]", RowBox[{"Placed", "[", RowBox[{ RowBox[{"LaB", "[", RowBox[{"\"\<\[Lambda]\>\"", ",", "mm1"}], "]"}], ",", RowBox[{"{", RowBox[{"Right", ",", "Top"}], "}"}]}], "]"}]}], ",", "Bst", ",", RowBox[{"FrameLabel", "\[Rule]", RowBox[{"{", RowBox[{ "\"\\"", ",", "\"\<\!\(\*SubscriptBox[\(h\), \(n\)]\)\>\""}], "}"}]}]}], "]"}]}]], "Input", CellChangeTimes->{{3.6093459341780987`*^9, 3.6093459613721423`*^9}, { 3.60934600497406*^9, 3.60934618533933*^9}, 3.6093523888150907`*^9, { 3.6093524238553324`*^9, 3.6093524244377227`*^9}, {3.609352569238103*^9, 3.609352627421851*^9}, {3.6093527079332647`*^9, 3.6093527460135217`*^9}, { 3.6093530614567804`*^9, 3.6093531246757174`*^9}, {3.6093535083477173`*^9, 3.609353509011162*^9}, {3.609353602515106*^9, 3.6093536087252336`*^9}, { 3.609354957254249*^9, 3.609354957814621*^9}, {3.609358951042476*^9, 3.609358955806631*^9}, {3.609359365907834*^9, 3.6093593753560977`*^9}, 3.6157621995994883`*^9}] }, Closed]] }, Closed]], Cell[CellGroupData[{ Cell["MacDonald MWB", "Section", CellChangeTimes->{{3.583765137655398*^9, 3.5837651427476892`*^9}, { 3.5839618036329813`*^9, 3.5839618064841447`*^9}, {3.584543198597481*^9, 3.5845431997955494`*^9}, {3.5851447746884937`*^9, 3.585144789581346*^9}, 3.6102293269015455`*^9, {3.610381387454624*^9, 3.6103813901644216`*^9}, { 3.615645927681486*^9, 3.6156459309716825`*^9}, {3.6156472596236897`*^9, 3.6156472658798637`*^9}, {3.615752415138811*^9, 3.6157524155060563`*^9}, 3.61576255340543*^9}], Cell[CellGroupData[{ Cell["Mating functions for 0{{3.615489936548005*^9, 3.615489943436601*^9}, { 3.6156459752972517`*^9, 3.6156459785374093`*^9}, {3.6156463413915033`*^9, 3.615646347582637*^9}, 3.6156464654292765`*^9, {3.615646800236026*^9, 3.61564680686745*^9}}], Cell[BoxData[ RowBox[{"Plot", "[", RowBox[{ RowBox[{"Evaluate", "@", RowBox[{"{", RowBox[{"\[Phi]NB", "[", RowBox[{"w", ",", RowBox[{"(*", RowBox[{"k", " ", "values"}], "*)"}], RowBox[{"kk1", "=", RowBox[{"{", RowBox[{".1", ",", "1", ",", "20"}], "}"}]}]}], "]"}], "}"}]}], ",", RowBox[{"{", RowBox[{"w", ",", "0", ",", "10"}], "}"}], ",", RowBox[{"PlotRange", "\[Rule]", RowBox[{"{", RowBox[{"0", ",", "1"}], "}"}]}], ",", RowBox[{"Frame", "\[Rule]", "True"}], ",", RowBox[{"FrameLabel", "\[Rule]", RowBox[{"{", RowBox[{"\"\\"", ",", "\"\<\[Phi](w,k)\>\""}], "}"}]}], ",", RowBox[{"BaseStyle", "\[Rule]", RowBox[{"{", RowBox[{"Italic", ",", "12"}], "}"}]}], ",", RowBox[{"PlotLegends", "\[Rule]", RowBox[{"Placed", "[", RowBox[{ RowBox[{"LaB", "[", RowBox[{"\"\\"", ",", RowBox[{"{", RowBox[{".1", ",", "1", ",", "\"\<\[Infinity]\>\""}], "}"}]}], "]"}], ",", RowBox[{"{", RowBox[{"Right", ",", "Center"}], "}"}]}], "]"}]}]}], "]"}]], "Input", CellChangeTimes->{{3.615490026191197*^9, 3.6154901066478643`*^9}, { 3.6154901625851793`*^9, 3.6154901729681044`*^9}, {3.615490578684885*^9, 3.615490797122807*^9}, {3.615490829200199*^9, 3.615490883734577*^9}, { 3.6157447459715805`*^9, 3.6157447495559745`*^9}, 3.615762210042463*^9}] }, Closed]], Cell[CellGroupData[{ Cell[TextData[{ "Equilibria: critical parameters ", Cell[BoxData[ FormBox[ RowBox[{ SubscriptBox["R", "0"], ",", "k", ",", RowBox[{"a", "/", "\[Gamma]"}], ","}], TraditionalForm]]], " for function ", Cell[BoxData[ FormBox[ RowBox[{ RowBox[{"F", "(", "y", ")"}], "=", RowBox[{ SubscriptBox["R", "0"], RowBox[{"y", "[", RowBox[{ RowBox[{ RowBox[{"(", RowBox[{"1", "-", "y"}], ")"}], "\[Phi]"}], "-", RowBox[{"1", "/", SubscriptBox["R", "0"]}]}], "]"}]}]}], TraditionalForm]]] }], "Subsection", CellChangeTimes->{{3.583765152346238*^9, 3.583765196173745*^9}, { 3.585144792644521*^9, 3.585144798953882*^9}, {3.6083932679209146`*^9, 3.608393382878504*^9}, {3.6102070924184275`*^9, 3.610207092920761*^9}, { 3.6156464514209375`*^9, 3.615646452439617*^9}, {3.615646482573715*^9, 3.6156464985013437`*^9}, {3.6157497032626276`*^9, 3.615749705229935*^9}}], Cell[BoxData[ RowBox[{ RowBox[{"(*", RowBox[{ RowBox[{ RowBox[{ RowBox[{"Reduced", " ", "NB"}], "-", RowBox[{"MacDonald", " ", "equilibrium", " ", "f"}], "-", RowBox[{"n", " ", "for", " ", "rescaled", " ", "a"}]}], "=", RowBox[{"a", "/", RowBox[{"(", RowBox[{"\[Gamma]", "+", "\[Mu]"}], ")"}]}]}], ",", " ", RowBox[{"b", "=", RowBox[{"b", "/", "\[Nu]"}]}]}], "*)"}], "\n", RowBox[{ RowBox[{ RowBox[{ RowBox[{"FyNB", "[", RowBox[{"y_", ",", RowBox[{"{", RowBox[{"a_", ",", "b_", ",", "k_"}], "}"}]}], "]"}], "=", RowBox[{ RowBox[{"(", RowBox[{ RowBox[{ FractionBox[ RowBox[{"b", " ", "a"}], "2"], " ", RowBox[{"\[Phi]NB", "[", RowBox[{ RowBox[{"a", " ", "y"}], ",", "k"}], "]"}], RowBox[{"(", RowBox[{"1", "-", "y"}], ")"}]}], "-", "1"}], ")"}], "y"}]}], ";"}], "\n", RowBox[{"(*", RowBox[{ RowBox[{"Critical", " ", "BRN", " ", "R0", RowBox[{"(", RowBox[{"k", ",", "a"}], ")"}], " ", "for", " ", "MacDonald", " ", "with", " ", "a"}], "=", RowBox[{"A", "/", "\[Gamma]"}]}], "*)"}], "\n", RowBox[{ RowBox[{ RowBox[{"R0", "[", RowBox[{ RowBox[{"k_", "?", "NumberQ"}], ",", RowBox[{"a_", "?", "NumberQ"}]}], "]"}], ":=", RowBox[{"(", RowBox[{ RowBox[{"R0", "[", RowBox[{"k", ",", "a"}], "]"}], "=", RowBox[{"Module", "[", RowBox[{ RowBox[{"{", "fR", "}"}], ",", RowBox[{ RowBox[{ RowBox[{"fR", "[", RowBox[{"k1_", ",", "a1_"}], "]"}], "=", FractionBox[ RowBox[{ SubscriptBox["\[PartialD]", "y"], RowBox[{"\[Phi]NB", "[", RowBox[{ RowBox[{"a1", " ", "y"}], ",", "k1"}], "]"}]}], RowBox[{"\[Phi]NB", "[", RowBox[{ RowBox[{"a1", " ", "y"}], ",", "k1"}], "]"}]]}], ";", RowBox[{ FractionBox["1", RowBox[{ RowBox[{"(", RowBox[{"1", "-", "y"}], ")"}], RowBox[{"\[Phi]NB", "[", RowBox[{ RowBox[{"a", " ", "y"}], ",", "k"}], "]"}]}]], "/.", RowBox[{"FindRoot", "[", RowBox[{ RowBox[{ RowBox[{"fR", "[", RowBox[{"k", ",", "a"}], "]"}], "==", FractionBox["1", RowBox[{"1", "-", "y"}]]}], ",", RowBox[{"{", RowBox[{"y", ",", ".5"}], "}"}]}], "]"}]}]}]}], "]"}]}], ")"}]}], ";"}]}]}]], "Input", CellChangeTimes->{{3.581956791414787*^9, 3.5819567999572754`*^9}, 3.58196654937191*^9, {3.582032372132191*^9, 3.582032401586876*^9}, 3.5820324496436243`*^9, {3.582034122280294*^9, 3.5820341282486353`*^9}, { 3.582582002974743*^9, 3.5825820318683953`*^9}, {3.582582067110411*^9, 3.582582093472919*^9}, {3.5825821654460354`*^9, 3.5825821682571964`*^9}, { 3.582582251067933*^9, 3.582582297161569*^9}, {3.5832646665489244`*^9, 3.583264680940748*^9}, {3.583264760580303*^9, 3.583264802868722*^9}, { 3.583264849617396*^9, 3.583264850367439*^9}, {3.583264977724723*^9, 3.5832649926355762`*^9}, {3.5832650548131323`*^9, 3.5832650674868574`*^9}, 3.5832651685106354`*^9, 3.5832652248288565`*^9, {3.5832652595658436`*^9, 3.583265304053388*^9}, {3.583265374211401*^9, 3.583265377256575*^9}, { 3.583338528214657*^9, 3.5833385579303565`*^9}, {3.583605041137524*^9, 3.5836050605766363`*^9}, {3.5836052724897566`*^9, 3.583605285864522*^9}, { 3.583605368063223*^9, 3.583605405328355*^9}, 3.583605556314991*^9, { 3.5836055900659213`*^9, 3.5836056026296396`*^9}, {3.583765684846696*^9, 3.583765685557736*^9}, {3.5837727198140726`*^9, 3.58377272396631*^9}, 3.5841053043511252`*^9, 3.5842881451711636`*^9, {3.584288466754557*^9, 3.584288467106578*^9}, {3.584288521561692*^9, 3.5842885285850935`*^9}, { 3.584552932583233*^9, 3.5845529335742893`*^9}, 3.584553183902608*^9, 3.6099599380752926`*^9, {3.610288772894741*^9, 3.6102887737262926`*^9}, 3.6102888274999638`*^9, {3.6102888693897552`*^9, 3.6102888728550487`*^9}, { 3.6103813265853558`*^9, 3.6103813327054157`*^9}, 3.610718760022849*^9, { 3.610722134498396*^9, 3.610722155244161*^9}, {3.6157487664955215`*^9, 3.615748767772373*^9}, 3.615751951822779*^9}], Cell[BoxData[ RowBox[{ RowBox[{"(*", RowBox[{"Manipulate", " ", "parameters", " ", RowBox[{"(", RowBox[{"a", ",", "b", ",", "k"}], ")"}], " ", "for", " ", "function", " ", RowBox[{"F", "[", RowBox[{"y", ",", RowBox[{"{", RowBox[{"a", ",", "b", ",", "k"}], "}"}]}], "]"}]}], "*)"}], "\[IndentingNewLine]", RowBox[{"Manipulate", "[", RowBox[{ RowBox[{"Plot", "[", RowBox[{ RowBox[{"FyNB", "[", RowBox[{"y", ",", RowBox[{"{", RowBox[{"a", ",", "b", ",", "k"}], "}"}]}], "]"}], ",", RowBox[{"{", RowBox[{"y", ",", "0", ",", "1"}], "}"}], ",", RowBox[{"PlotRange", "\[Rule]", RowBox[{"{", RowBox[{ RowBox[{"-", ".2"}], ",", ".3"}], "}"}]}]}], "]"}], ",", "\[IndentingNewLine]", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"b", ",", "6"}], "}"}], ",", "1", ",", "10"}], "}"}], ",", "\[IndentingNewLine]", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"a", ",", "1"}], "}"}], ",", ".2", ",", "4"}], "}"}], ",", "\[IndentingNewLine]", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"k", ",", ".8"}], "}"}], ",", ".1", ",", "5"}], "}"}]}], "]"}]}]], "Input", CellChangeTimes->{{3.5817831948820953`*^9, 3.581783283833183*^9}, { 3.5819635920727625`*^9, 3.581963636106281*^9}, 3.5819644771573863`*^9, { 3.5820348252835035`*^9, 3.5820348333839664`*^9}, {3.5820348869430304`*^9, 3.5820349274273458`*^9}, 3.583263727582219*^9, {3.583767866795496*^9, 3.5837678842154922`*^9}, {3.5838453020924006`*^9, 3.583845305156576*^9}, { 3.6089935817016163`*^9, 3.6089935842653213`*^9}, {3.6089943838481827`*^9, 3.6089943857264347`*^9}, 3.6102888291520576`*^9, 3.615743038824339*^9, { 3.6157430908030157`*^9, 3.6157431086829433`*^9}, {3.6157491129272423`*^9, 3.615749119757799*^9}}], Cell[CellGroupData[{ Cell["\<\ Parameter planes with critical \[OpenCurlyDoubleQuote]zero->bistable\ \[CloseCurlyDoubleQuote] transision curves\ \>", "Subsubsection", CellChangeTimes->{{3.6087446402882495`*^9, 3.608744647970373*^9}, { 3.6088171185577536`*^9, 3.6088171275757675`*^9}, {3.615646583725193*^9, 3.61564664219619*^9}, {3.61564670365219*^9, 3.615646759051139*^9}, 3.615744645068546*^9, 3.6157491271227126`*^9, 3.615749535225527*^9, { 3.615749604878997*^9, 3.615749660727247*^9}, {3.6157618184935665`*^9, 3.615761818740733*^9}}], Cell[BoxData[ RowBox[{ RowBox[{"(*", RowBox[{ RowBox[{"(", RowBox[{"k", ",", "R0"}], ")"}], "-", RowBox[{"Parameter", " ", "plane"}]}], " ", "*)"}], "\[IndentingNewLine]", RowBox[{"Block", "[", RowBox[{ RowBox[{"{", RowBox[{"(*", RowBox[{ RowBox[{"Critical", " ", "R0"}], "-", "values"}], "*)"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"rCC", "=", RowBox[{"Table", "[", RowBox[{ RowBox[{"R0", "[", RowBox[{"k", ",", "a"}], "]"}], ",", RowBox[{"{", RowBox[{"(*", RowBox[{"max", " ", "load"}], "*)"}], RowBox[{"a", ",", RowBox[{"aa1", "=", RowBox[{"{", RowBox[{".5", ",", "1", ",", "4"}], "}"}]}]}], "}"}], ",", RowBox[{"{", RowBox[{"k", ",", ".02", ",", "2", ",", ".02"}], "}"}]}], "]"}]}], ",", "\[IndentingNewLine]", RowBox[{"(*", RowBox[{"k", " ", "values"}], "*)"}], RowBox[{"kk1", "=", RowBox[{"{", RowBox[{".5", ",", "1", ",", "1.5"}], "}"}]}], ",", "\[IndentingNewLine]", RowBox[{"(*", RowBox[{"R0", " ", "values"}], "*)"}], RowBox[{"rr1", "=", RowBox[{"{", RowBox[{"5.3", ",", "6.54", ",", "7.6"}], "}"}]}], ",", "\[IndentingNewLine]", RowBox[{"pk1", "=", RowBox[{"Thread", "@", RowBox[{"{", RowBox[{"kk1", ",", "6.54"}], "}"}]}]}], ",", "pr1"}], "}"}], ",", "\[IndentingNewLine]", RowBox[{ RowBox[{"pr1", "=", RowBox[{"Thread", "@", RowBox[{"{", RowBox[{"1", ",", "rr1"}], "}"}]}]}], ";", RowBox[{"ListLinePlot", "[", RowBox[{"rCC", ",", RowBox[{"DataRange", "\[Rule]", RowBox[{"{", RowBox[{".02", ",", "2"}], "}"}]}], ",", RowBox[{"Frame", "\[Rule]", "True"}], ",", RowBox[{"FrameLabel", "\[Rule]", RowBox[{"{", RowBox[{ "\"\\"", ",", "\"\<\!\(\*SubscriptBox[\(R\), \(0\)]\)\>\""}], "}"}]}], ",", "Bst", ",", RowBox[{"GridLines", "\[Rule]", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"{", RowBox[{"1", ",", "Dashed"}], "}"}], "}"}], ",", RowBox[{"{", RowBox[{"{", RowBox[{"6.54", ",", "Dashed"}], "}"}], "}"}]}], "}"}]}], ",", RowBox[{"PlotLegends", "\[Rule]", RowBox[{"Placed", "[", RowBox[{ RowBox[{"LaB", "[", RowBox[{"\"\\"", ",", "aa1"}], "]"}], ",", RowBox[{"{", RowBox[{"Left", ",", "Top"}], "}"}]}], "]"}]}], ",", RowBox[{"AspectRatio", "\[Rule]", "1"}], ",", RowBox[{"Epilog", "\[Rule]", RowBox[{"{", RowBox[{ RowBox[{"PointSize", "@", "Medium"}], ",", RowBox[{"Point", "/@", RowBox[{"{", RowBox[{"pk1", ",", "pr1"}], "}"}]}]}], "}"}]}]}], "]"}]}]}], "]"}]}]], "Input", CellChangeTimes->{{3.6083934041636868`*^9, 3.608393422955206*^9}, { 3.6084710470116043`*^9, 3.6084710524422174`*^9}, {3.6087389142901134`*^9, 3.6087389465246134`*^9}, 3.610107943157361*^9, {3.610108076648384*^9, 3.6101080964425173`*^9}, {3.6157493001519423`*^9, 3.6157493898259673`*^9}, {3.615749570096795*^9, 3.6157495927619133`*^9}, { 3.6157618549658976`*^9, 3.6157618734322147`*^9}, 3.615761912007948*^9, 3.615762234504778*^9}], Cell[BoxData[ RowBox[{ RowBox[{"(*", RowBox[{ RowBox[{"Critical", " ", "curve", " ", "b", RowBox[{"(", "a", ")"}], " ", "for", " ", "bistable"}], "->", RowBox[{ RowBox[{"zero", " ", "transition", " ", "in", " ", RowBox[{"(", RowBox[{"a", ",", "b"}], ")"}]}], "-", RowBox[{"parameter", " ", "space"}]}]}], "*)"}], "\[IndentingNewLine]", RowBox[{"Module", "[", RowBox[{ RowBox[{"{", "bC", "}"}], ",", "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"bC", "[", RowBox[{"k_", ",", "a_"}], "]"}], ":=", FractionBox[ RowBox[{"2", RowBox[{"R0", "[", RowBox[{"k", ",", "a"}], "]"}]}], "a"]}], ";", RowBox[{"SetAttributes", "[", RowBox[{"bC", ",", "Listable"}], "]"}], ";", "\n", RowBox[{"Show", "[", RowBox[{ RowBox[{"PTS", "[", RowBox[{ RowBox[{"{", RowBox[{"bC", "[", RowBox[{ RowBox[{"kk1", "=", RowBox[{"{", RowBox[{".05", ",", "1", ",", "10"}], "}"}]}], ",", "t"}], "]"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "5"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "10"}], "}"}], ",", RowBox[{"{", RowBox[{"\"\\"", ",", "\"\\""}], "}"}], ",", RowBox[{"PlotLegends", "\[Rule]", RowBox[{"Placed", "[", RowBox[{ RowBox[{"LaB", "[", RowBox[{"\"\\"", ",", "kk1"}], "]"}], ",", RowBox[{"{", RowBox[{"Right", ",", "Top"}], "}"}]}], "]"}]}]}], "]"}], ",", "\[IndentingNewLine]", RowBox[{"PTS", "[", RowBox[{ FractionBox["2", "t"], ",", RowBox[{"{", RowBox[{"0", ",", "5"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "10"}], "}"}], ",", "Gray", ",", "\"\<\>\"", ",", RowBox[{"Filling", "\[Rule]", "Bottom"}]}], "]"}], ",", "Bst", ",", RowBox[{"AspectRatio", "\[Rule]", "1"}]}], "]"}]}]}], "]"}]}]], "Input", CellChangeTimes->{{3.6084750560388308`*^9, 3.6084750597122793`*^9}, 3.608475327487311*^9, 3.608475360015981*^9, {3.6087393853214083`*^9, 3.608739406590598*^9}, 3.6156467701975737`*^9, {3.615646910744745*^9, 3.615646933103654*^9}, 3.6156469665599756`*^9, 3.6156470077538395`*^9, { 3.615749244809023*^9, 3.61574926145313*^9}, {3.6157494441762295`*^9, 3.615749474171237*^9}, {3.6157622697693048`*^9, 3.615762293040821*^9}}] }, Open ]] }, Closed]] }, Open ]], Cell[CellGroupData[{ Cell["SWB for single human-snail system", "Section", CellChangeTimes->{{3.5778964680483007`*^9, 3.5778964734496098`*^9}, { 3.5779288065024567`*^9, 3.5779288133678493`*^9}, {3.6088172631874657`*^9, 3.6088172665927362`*^9}, {3.6088173026738043`*^9, 3.608817302678808*^9}, { 3.615748079362664*^9, 3.6157480843459864`*^9}, {3.615749177842349*^9, 3.6157491848500214`*^9}, {3.61576255973265*^9, 3.6157625620221806`*^9}}], Cell[CellGroupData[{ Cell["Prevalence \[CapitalOmega]: NB-MacDonald vs SWB ", "Subsection", CellChangeTimes->{{3.583193689358969*^9, 3.5831937038237967`*^9}, { 3.6100498976977763`*^9, 3.6100499088721886`*^9}, {3.6100730151307955`*^9, 3.6100730157462006`*^9}, {3.615667877754102*^9, 3.6156679124902782`*^9}, { 3.6157523978833*^9, 3.6157523980013776`*^9}}], Cell[BoxData[ RowBox[{ RowBox[{"(*", "MWB", "*)"}], RowBox[{"Plot", "[", RowBox[{ RowBox[{"Evaluate", "@", RowBox[{"pNB", "[", RowBox[{"w", ",", RowBox[{"kk1", "=", RowBox[{"{", RowBox[{"10", ",", "1", ",", ".2"}], "}"}]}]}], "]"}]}], ",", RowBox[{"{", RowBox[{"w", ",", "0", ",", "10"}], "}"}], ",", RowBox[{"Frame", "\[Rule]", "True"}], ",", RowBox[{"FrameLabel", "\[Rule]", RowBox[{"{", RowBox[{"\"\\"", ",", "\"\\""}], "}"}]}], ",", RowBox[{"PlotRange", "\[Rule]", RowBox[{"{", RowBox[{"0", ",", "1"}], "}"}]}], ",", RowBox[{"BaseStyle", "\[Rule]", RowBox[{"{", RowBox[{"12", ",", "Italic"}], "}"}]}], ",", RowBox[{"PlotLegends", "\[Rule]", RowBox[{"Placed", "[", RowBox[{ RowBox[{"LaB", "[", RowBox[{"\"\\"", ",", "kk1"}], "]"}], ",", RowBox[{"{", RowBox[{"Left", ",", "Top"}], "}"}]}], "]"}]}]}], "]"}]}]], "Input", CellChangeTimes->{{3.6099852890264215`*^9, 3.6099853288518405`*^9}, { 3.6099853646125193`*^9, 3.6099853820921144`*^9}, 3.6099855237861176`*^9, { 3.6099855638815355`*^9, 3.6099855668164864`*^9}, {3.609985767174955*^9, 3.6099857694464617`*^9}, {3.609985821464971*^9, 3.6099858488141127`*^9}, { 3.609985898145835*^9, 3.60998593762461*^9}, {3.6099859692015533`*^9, 3.6099860126073523`*^9}, {3.6099861209673605`*^9, 3.609986127769869*^9}, { 3.6099861696796713`*^9, 3.6099862085494623`*^9}, {3.615742355546923*^9, 3.6157423754892282`*^9}, 3.6157620234508085`*^9}], Cell[BoxData[ RowBox[{ RowBox[{"(*", "SWB", " ", "*)"}], "\n", RowBox[{"(", RowBox[{ RowBox[{"hid", "=", RowBox[{"Table", "[", RowBox[{ RowBox[{"{", RowBox[{"l", ",", RowBox[{"pSW", "[", RowBox[{ RowBox[{"{", RowBox[{"l", ",", "m", ",", ".6"}], "}"}], ",", "40", ",", "1"}], "]"}]}], "}"}], ",", RowBox[{"{", RowBox[{"m", ",", RowBox[{"mm1", "=", RowBox[{"{", RowBox[{".1", ",", "1", ",", "5"}], "}"}]}]}], "}"}], ",", RowBox[{"{", RowBox[{"l", ",", "0", ",", "10", ",", ".2"}], "}"}]}], "]"}]}], ";", "\n", RowBox[{"ListLinePlot", "[", RowBox[{"hid", ",", RowBox[{"Frame", "\[Rule]", "True"}], ",", RowBox[{"FrameLabel", "\[Rule]", RowBox[{"{", RowBox[{"\"\<\[Lambda]\>\"", ",", "\"\\""}], "}"}]}], ",", RowBox[{"PlotRange", "\[Rule]", RowBox[{"{", RowBox[{"0", ",", "1"}], "}"}]}], ",", "Bst", ",", RowBox[{"PlotLegends", "\[Rule]", RowBox[{"Placed", "[", RowBox[{ RowBox[{"LaB", "[", RowBox[{"\"\<\[Mu]\>\"", ",", "mm1"}], "]"}], ",", RowBox[{"{", RowBox[{"Left", ",", "Top"}], "}"}]}], "]"}]}]}], "]"}]}], ")"}]}]], "Input", CellChangeTimes->{{3.6088369712424445`*^9, 3.6088369908475275`*^9}, { 3.608837036898245*^9, 3.608837054953289*^9}, {3.60883787327692*^9, 3.6088378736841917`*^9}, {3.6089241714892187`*^9, 3.608924175578949*^9}, 3.609100548813737*^9, {3.609984541618164*^9, 3.609984549104134*^9}, { 3.60998458425745*^9, 3.6099845844475784`*^9}, 3.6099846372486053`*^9, { 3.6099847120393944`*^9, 3.609984716079072*^9}, 3.609984791584161*^9, { 3.609984923636777*^9, 3.6099849348702354`*^9}, 3.609985038532482*^9, { 3.6099857319405775`*^9, 3.609985742579641*^9}, {3.609985798325616*^9, 3.609985803082776*^9}, {3.609986033338101*^9, 3.6099861016085143`*^9}, { 3.6099862170961266`*^9, 3.6099862365830593`*^9}, {3.6100629606637383`*^9, 3.610062965855177*^9}, 3.610063053031659*^9, {3.6100651951431227`*^9, 3.610065206807768*^9}, {3.615667938042325*^9, 3.6156679517224464`*^9}, 3.615668261905151*^9, 3.6157620416309357`*^9}] }, Closed]], Cell[CellGroupData[{ Cell["SWB equilibria", "Subsection", CellChangeTimes->{{3.449671732939887*^9, 3.4496717344888873`*^9}, { 3.449671834281887*^9, 3.449671836273887*^9}, {3.577907458438915*^9, 3.5779074627101593`*^9}, {3.577916595971552*^9, 3.577916600436807*^9}, { 3.5784914103042965`*^9, 3.5784914150785694`*^9}, {3.58410531859494*^9, 3.5841053212500916`*^9}, {3.584554258812089*^9, 3.5845542643004026`*^9}, { 3.5851447404905376`*^9, 3.585144742660662*^9}, {3.610381537466136*^9, 3.6103815392072945`*^9}, 3.615745273536513*^9}], Cell[BoxData[ RowBox[{ RowBox[{"(*", RowBox[{ RowBox[{ RowBox[{"Y", "-", RowBox[{"equilibria", " ", "for", " ", "SWB", " ", "for", " ", "a"}]}], "=", RowBox[{"a", "/", "\[Gamma]"}]}], ";", RowBox[{"b", "=", RowBox[{"b", "/", "\[Nu]"}]}]}], "*)"}], "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"ySW", "[", RowBox[{ RowBox[{"y_", "?", "NumberQ"}], ",", RowBox[{"{", RowBox[{ RowBox[{"n_", "?", "NumberQ"}], ",", RowBox[{"dw_", "?", "NumberQ"}], ",", RowBox[{"q_", "?", "NumberQ"}], ",", RowBox[{"m_", "?", "NumberQ"}], ",", RowBox[{"a_", "?", "NumberQ"}], ",", RowBox[{"b_", "?", "NumberQ"}]}], "}"}]}], "]"}], ":=", "\[IndentingNewLine]", RowBox[{"(", RowBox[{ RowBox[{"ySW", "[", RowBox[{"y", ",", RowBox[{"{", RowBox[{"n", ",", "dw", ",", "q", ",", "m", ",", "a", ",", "b"}], "}"}]}], "]"}], "=", RowBox[{"(", RowBox[{ RowBox[{"b", " ", RowBox[{"(", RowBox[{"1", "-", "y"}], ")"}], RowBox[{ RowBox[{"MCa", "[", RowBox[{ RowBox[{"dw", " ", RowBox[{"Range", "[", "n", "]"}]}], ",", "q"}], "]"}], ".", RowBox[{"Rest", "@", RowBox[{"SWc", "[", RowBox[{ RowBox[{"a", " ", RowBox[{"y", "/", "dw"}]}], ",", "m", ",", "n"}], "]"}]}]}]}], "-", " ", "y"}], ")"}]}], ")"}]}], ";"}]}]], "Input", CellChangeTimes->{{3.581956791414787*^9, 3.5819567999572754`*^9}, 3.58196654937191*^9, {3.582032372132191*^9, 3.582032401586876*^9}, 3.5820324496436243`*^9, {3.582034122280294*^9, 3.5820341282486353`*^9}, { 3.582582002974743*^9, 3.5825820318683953`*^9}, {3.582582067110411*^9, 3.582582093472919*^9}, {3.5825821654460354`*^9, 3.5825821682571964`*^9}, { 3.582582251067933*^9, 3.582582297161569*^9}, {3.5832646665489244`*^9, 3.583264680940748*^9}, {3.583264760580303*^9, 3.583264802868722*^9}, { 3.583264849617396*^9, 3.583264850367439*^9}, {3.583264977724723*^9, 3.5832649926355762`*^9}, {3.5832650548131323`*^9, 3.5832650674868574`*^9}, 3.5832651685106354`*^9, 3.5832652248288565`*^9, {3.5832652595658436`*^9, 3.583265304053388*^9}, {3.583265374211401*^9, 3.583265377256575*^9}, { 3.583338528214657*^9, 3.5833385579303565`*^9}, {3.583605041137524*^9, 3.5836050605766363`*^9}, {3.5836052724897566`*^9, 3.583605285864522*^9}, { 3.583605368063223*^9, 3.583605405328355*^9}, 3.583605556314991*^9, { 3.5836055900659213`*^9, 3.5836056026296396`*^9}, {3.583765684846696*^9, 3.583765685557736*^9}, {3.5837727198140726`*^9, 3.58377272396631*^9}, 3.5841053043511252`*^9, 3.5842881451711636`*^9, {3.584288466754557*^9, 3.584288467106578*^9}, {3.584288521561692*^9, 3.5842885285850935`*^9}, { 3.584552932583233*^9, 3.5845529335742893`*^9}, 3.584553183902608*^9, 3.58455374254856*^9, {3.5845542388209457`*^9, 3.5845542418521185`*^9}, 3.6088395146138477`*^9, {3.608991002922678*^9, 3.6089910078349533`*^9}, { 3.608991046427419*^9, 3.608991051322689*^9}, 3.6099836673715363`*^9, { 3.610108854659482*^9, 3.61010885592432*^9}, {3.6103004935698547`*^9, 3.6103005245924387`*^9}, {3.6103951003621407`*^9, 3.6103951136129327`*^9}, {3.6103951754362307`*^9, 3.610395196469181*^9}, { 3.6103952658111863`*^9, 3.6103952777390943`*^9}, {3.6157424063087854`*^9, 3.6157424066770315`*^9}}], Cell[CellGroupData[{ Cell["Function F(y)", "Subsubsection", CellChangeTimes->{{3.5836101496407137`*^9, 3.583610154047966*^9}, { 3.6090137398910236`*^9, 3.6090137437696066`*^9}, 3.609013783225927*^9, { 3.6090872464193916`*^9, 3.609087252258289*^9}, {3.615744772163052*^9, 3.6157447733468437`*^9}, {3.615745019280321*^9, 3.615745030352711*^9}, { 3.6157452831039*^9, 3.61574529851818*^9}}], Cell[BoxData[ RowBox[{ RowBox[{"(*", RowBox[{ RowBox[{"\[Mu]", " ", "dependence", " ", "of", " ", "F", RowBox[{"(", "y", ")"}]}], ",", " ", RowBox[{ RowBox[{"for", " ", "dw"}], "=", "2"}]}], "*)"}], RowBox[{"With", "[", RowBox[{ RowBox[{"{", RowBox[{"tt", "=", RowBox[{"Table", "[", RowBox[{ RowBox[{"ySW", "[", RowBox[{"y", ",", RowBox[{"{", RowBox[{"20", ",", RowBox[{"d1", "=", "2"}], ",", RowBox[{"q1", "=", ".95"}], ",", "m", ",", RowBox[{"a1", "=", "6"}], ",", RowBox[{"b1", "=", "6"}]}], "}"}]}], "]"}], ",", RowBox[{"{", RowBox[{"m", ",", RowBox[{"{", RowBox[{".05", ",", ".1", ",", ".15"}], "}"}]}], "}"}], ",", RowBox[{"{", RowBox[{"y", ",", "0", ",", RowBox[{"yt", "=", ".8"}], ",", ".02"}], "}"}]}], "]"}]}], "}"}], ",", "\[IndentingNewLine]", RowBox[{"ListLinePlot", "[", RowBox[{"tt", ",", RowBox[{"DataRange", "\[Rule]", RowBox[{"{", RowBox[{"0", ",", "yt"}], "}"}]}], ",", RowBox[{"PlotRange", "\[Rule]", RowBox[{"{", RowBox[{ RowBox[{"-", ".02"}], ",", ".25"}], "}"}]}], ",", RowBox[{"Frame", "\[Rule]", "True"}], ",", RowBox[{"PlotStyle", "\[Rule]", RowBox[{"{", RowBox[{ RowBox[{"{", "}"}], ",", RowBox[{"{", "}"}], ",", RowBox[{"{", "}"}]}], "}"}]}], ",", RowBox[{"BaseStyle", "\[Rule]", "12"}], ",", RowBox[{"FrameLabel", "\[Rule]", RowBox[{"{", RowBox[{"\"\\"", ",", "\"\\""}], "}"}]}]}], "]"}]}], "]"}]}]], "Input", CellChangeTimes->{{3.5836096157241755`*^9, 3.583609751350933*^9}, { 3.5836097835687757`*^9, 3.5836098024058533`*^9}, {3.5836098413440804`*^9, 3.583609997326002*^9}, {3.5836100394444113`*^9, 3.583610069747144*^9}, { 3.5836173437371926`*^9, 3.5836174099439793`*^9}, {3.583850861055355*^9, 3.583850989792719*^9}, 3.609014221626051*^9, {3.609014267474636*^9, 3.6090142905140038`*^9}, 3.6090876283788958`*^9, 3.610108862424635*^9, { 3.61039552455933*^9, 3.6103955294174767`*^9}, {3.615744785769131*^9, 3.615744820259135*^9}}], Cell[BoxData[ RowBox[{ RowBox[{"(*", RowBox[{"Allee", " ", "q", " ", "dependence", " ", "of", " ", "F", RowBox[{"(", "Y", ")"}]}], "*)"}], RowBox[{"With", "[", RowBox[{ RowBox[{"{", RowBox[{"tt", "=", RowBox[{"Table", "[", RowBox[{ RowBox[{"ySW", "[", RowBox[{"y", ",", RowBox[{"{", RowBox[{"20", ",", RowBox[{"d1", "=", "2"}], ",", "p", ",", ".1", ",", RowBox[{"a1", "=", "6"}], ",", RowBox[{"b1", "=", "5.8"}]}], "}"}]}], "]"}], ",", RowBox[{"{", RowBox[{"p", ",", RowBox[{"pp1", "=", RowBox[{"{", RowBox[{".94", ",", ".95", ",", ".96"}], "}"}]}]}], "}"}], ",", RowBox[{"{", RowBox[{"y", ",", "0", ",", RowBox[{"yz", "=", "1"}], ",", ".02"}], "}"}]}], "]"}]}], "}"}], ",", "\[IndentingNewLine]", RowBox[{"ListLinePlot", "[", RowBox[{"tt", ",", RowBox[{"DataRange", "\[Rule]", RowBox[{"{", RowBox[{"0", ",", "yz"}], "}"}]}], ",", "\[IndentingNewLine]", RowBox[{"PlotRange", "\[Rule]", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"0", ",", ".8"}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"-", ".1"}], ",", ".2"}], "}"}]}], "}"}]}], ",", "\[IndentingNewLine]", RowBox[{"Frame", "\[Rule]", "True"}], ",", "Bst", ",", RowBox[{"FrameLabel", "\[Rule]", RowBox[{"{", RowBox[{"\"\\"", ",", "\"\\""}], "}"}]}], ",", "\[IndentingNewLine]", RowBox[{"PlotLegends", "\[Rule]", RowBox[{"Placed", "[", RowBox[{ RowBox[{"LaB", "[", RowBox[{"\"\\"", ",", "pp1"}], "]"}], ",", RowBox[{"{", RowBox[{"Left", ",", "Top"}], "}"}]}], "]"}]}]}], "]"}]}], "]"}]}]], "Input", CellChangeTimes->{{3.6090878742543507`*^9, 3.6090880060429945`*^9}, { 3.6090880654466305`*^9, 3.6090880738232136`*^9}, 3.6101088638926067`*^9, { 3.610395542137916*^9, 3.6103955473853955`*^9}, {3.6157443192484913`*^9, 3.6157443208635745`*^9}, {3.6157451202456765`*^9, 3.6157451326349416`*^9}, 3.6157615782226887`*^9, 3.615761982237316*^9}] }, Open ]], Cell[CellGroupData[{ Cell["Equilibia", "Subsubsection", CellChangeTimes->{{3.6157450876279144`*^9, 3.615745095050867*^9}}], Cell[BoxData[ RowBox[{ RowBox[{"(*", RowBox[{"Parameter", " ", "choice", " ", "for", " ", "breakpooint"}], "*)"}], RowBox[{ RowBox[{ RowBox[{"pa2", "=", RowBox[{"{", RowBox[{"(*", RowBox[{"#", " ", "strata"}], "*)"}], RowBox[{"10", ",", RowBox[{"(*", "dw", "*)"}], "2", ",", RowBox[{"(*", "q", "*)"}], ".95", ",", RowBox[{"(*", "\[Mu]", "*)"}], RowBox[{"m1", "=", ".2"}], ",", RowBox[{"a1", "=", "6"}], ",", RowBox[{"b1", "=", "7"}]}], "}"}]}], ";"}], "\n", RowBox[{"(*", RowBox[{"SWB", " ", "equilibria"}], "*)"}], "\[IndentingNewLine]", RowBox[{"(*", RowBox[{ RowBox[{"Breakpoint", " ", "SWB"}], "-", "equilibria"}], "*)"}], "\n", RowBox[{ RowBox[{"hQ1", "=", RowBox[{"With", "[", RowBox[{ RowBox[{"{", RowBox[{"(*", "breakpoint", "*)"}], RowBox[{"eq1", "=", RowBox[{"FindRoot", "[", RowBox[{ RowBox[{"ySW", "[", RowBox[{"y", ",", "pa2"}], "]"}], ",", RowBox[{"{", RowBox[{"y", ",", ".2"}], "}"}]}], "]"}]}], "}"}], ",", RowBox[{"SWc", "[", RowBox[{ RowBox[{ FractionBox[ RowBox[{"a1", " ", "y"}], "d1"], "/.", "eq1"}], ",", "m1", ",", RowBox[{"n1", "=", "10"}]}], "]"}]}], "]"}]}], ";", RowBox[{"(*", RowBox[{ RowBox[{"Endemic", " ", "SWB"}], "-", "equilibria"}], "*)"}], RowBox[{"hQ2", "=", RowBox[{"With", "[", RowBox[{ RowBox[{"{", RowBox[{"(*", "endemic", "*)"}], RowBox[{"eq2", "=", RowBox[{"FindRoot", "[", RowBox[{ RowBox[{"ySW", "[", RowBox[{"y", ",", "pa2"}], "]"}], ",", RowBox[{"{", RowBox[{"y", ",", "1"}], "}"}]}], "]"}]}], "}"}], ",", RowBox[{"SWc", "[", RowBox[{ RowBox[{ FractionBox[ RowBox[{"a1", " ", "y"}], "d1"], "/.", "eq2"}], ",", "m1", ",", "n1"}], "]"}]}], "]"}]}], ";"}], "\n", RowBox[{"ListLinePlot", "[", RowBox[{ RowBox[{"{", RowBox[{"hQ1", ",", "hQ2"}], "}"}], ",", RowBox[{"PlotRange", "\[Rule]", "All"}], ",", RowBox[{"DataRange", "\[Rule]", RowBox[{"{", RowBox[{"0", ",", "n1"}], "}"}]}], ",", RowBox[{"Frame", "\[Rule]", "True"}], ",", "\[IndentingNewLine]", RowBox[{"PlotMarkers", "\[Rule]", "Automatic"}], ",", "\[IndentingNewLine]", "Bst", ",", RowBox[{"FrameLabel", "\[Rule]", RowBox[{"{", RowBox[{ "\"\\"", ",", "\"\<\!\(\*SuperscriptBox[\(h\), \(*\)]\)(w)\>\""}], "}"}]}], ",", RowBox[{"PlotLegends", "\[Rule]", RowBox[{"Placed", "[", RowBox[{ RowBox[{"{", RowBox[{"\"\\"", ",", "\"\\""}], "}"}], ",", RowBox[{"{", RowBox[{"Right", ",", "Top"}], "}"}]}], "]"}]}], ",", "Bst"}], "]"}]}]}]], "Input", CellChangeTimes->{{3.583850343952779*^9, 3.5838503737214813`*^9}, { 3.5838504125187006`*^9, 3.583850448563762*^9}, {3.584043552342431*^9, 3.584043558811801*^9}, {3.58404411337252*^9, 3.5840441148046017`*^9}, { 3.609013945478018*^9, 3.609013977557413*^9}, {3.6090140168311396`*^9, 3.6090140176006536`*^9}, {3.609014106933244*^9, 3.609014107687746*^9}, { 3.609087506441027*^9, 3.6090875147355566`*^9}, {3.6101088589163065`*^9, 3.6101088596337814`*^9}, {3.61039546850815*^9, 3.6103954802139187`*^9}, { 3.615744547835684*^9, 3.615744598338377*^9}, {3.615744866757449*^9, 3.615744897034645*^9}, {3.615745309340397*^9, 3.6157453223310623`*^9}, { 3.615751185795171*^9, 3.6157511865086484`*^9}, 3.615761610026902*^9, 3.615761643424091*^9, {3.615761686369745*^9, 3.615761686926111*^9}, 3.6157620906826644`*^9, 3.615762121905485*^9}] }, Open ]] }, Closed]], Cell[CellGroupData[{ Cell["Breakpoint regions for SWB", "Subsection", CellChangeTimes->{{3.583962014470041*^9, 3.583962021077419*^9}, 3.6090127760190263`*^9}], Cell[BoxData[ RowBox[{ RowBox[{"(*", RowBox[{"Manipulate", " ", "b", " ", "in", " ", "F", RowBox[{"(", RowBox[{"y", ",", RowBox[{"...", "b"}]}], ")"}], " ", "for", " ", "breakpoint", " ", "analysis"}], "*)"}], "\[IndentingNewLine]", RowBox[{"Manipulate", "[", "\[IndentingNewLine]", RowBox[{ RowBox[{"With", "[", RowBox[{ RowBox[{"{", RowBox[{"tt", "=", RowBox[{"Table", "[", RowBox[{ RowBox[{"{", RowBox[{"y", ",", RowBox[{"ySW", "[", RowBox[{"y", ",", RowBox[{"{", RowBox[{ "20", ",", "dw", ",", "q", ",", "m", ",", "a", ",", "b"}], "}"}]}], "]"}]}], "}"}], ",", RowBox[{"{", RowBox[{"y", ",", "0", ",", "1", ",", ".02"}], "}"}]}], "]"}]}], "}"}], ",", "\[IndentingNewLine]", RowBox[{"ListLinePlot", "[", RowBox[{"tt", ",", RowBox[{"PlotRange", "\[Rule]", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"0", ",", "yt"}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"-", "f0"}], ",", "f0"}], "}"}]}], "}"}]}]}], "]"}]}], "]"}], ",", "\[IndentingNewLine]", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"dw", ",", "1"}], "}"}], ",", RowBox[{"Range", "[", RowBox[{"1", ",", "10"}], "]"}]}], "}"}], ",", "\[IndentingNewLine]", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"m", ",", ".1"}], "}"}], ",", ".05", ",", ".5"}], "}"}], ",", "\[IndentingNewLine]", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"a", ",", "2.5"}], "}"}], ",", "1", ",", "10"}], "}"}], ",", "\[IndentingNewLine]", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"b", ",", "4"}], "}"}], ",", "1", ",", "20"}], "}"}], ",", "\[IndentingNewLine]", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"q", ",", ".6"}], "}"}], ",", ".01", ",", ".99"}], "}"}], ",", "\[IndentingNewLine]", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"yt", ",", ".8"}], "}"}], ",", ".1", ",", "1"}], "}"}], ",", "\[IndentingNewLine]", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"f0", ",", ".2"}], "}"}], ",", ".0001", ",", ".5"}], "}"}], ",", "\[IndentingNewLine]", RowBox[{"Bookmarks", "\[Rule]", RowBox[{"{", RowBox[{ RowBox[{"\"\\"", "\[RuleDelayed]", RowBox[{"{", RowBox[{ RowBox[{"a", "=", "1.3`"}], ",", RowBox[{"b", "=", "20.`"}], ",", RowBox[{"dw", "=", "1"}], ",", RowBox[{"f0", "=", "0.15`"}], ",", RowBox[{"m", "=", "0.1`"}], ",", RowBox[{"q", "=", "0.5`"}], ",", RowBox[{"yt", "=", "0.8`"}]}], "}"}]}], ",", RowBox[{"\"\\"", "\[RuleDelayed]", RowBox[{"{", RowBox[{ RowBox[{"a", "=", "3.5`"}], ",", RowBox[{"b", "=", "5.823`"}], ",", RowBox[{"dw", "=", "2"}], ",", RowBox[{"f0", "=", "0.02`"}], ",", RowBox[{"m", "=", "0.1`"}], ",", RowBox[{"q", "=", "0.9`"}], ",", RowBox[{"yt", "=", "0.5`"}]}], "}"}]}], ",", "\[IndentingNewLine]", RowBox[{"\"\\"", "\[RuleDelayed]", RowBox[{"{", RowBox[{ RowBox[{"a", "=", "6`"}], ",", RowBox[{"b", "=", "2.8`"}], ",", RowBox[{"dw", "=", "2"}], ",", RowBox[{"f0", "=", "0.02`"}], ",", RowBox[{"m", "=", "0.1`"}], ",", RowBox[{"q", "=", "0.9`"}], ",", RowBox[{"yt", "=", "0.5`"}]}], "}"}]}]}], "}"}]}]}], "]"}]}]], "Input", CellChangeTimes->{{3.5830904952242055`*^9, 3.583090503503679*^9}, { 3.583090539915762*^9, 3.583090640385508*^9}, {3.5830906846880417`*^9, 3.5830907085844088`*^9}, {3.583090758730277*^9, 3.5830907960814133`*^9}, { 3.5830909925336494`*^9, 3.58309101369886*^9}, {3.5830911599592257`*^9, 3.5830911738450203`*^9}, {3.5831156972207556`*^9, 3.5831156976907825`*^9}, {3.583115865363373*^9, 3.5831158724327774`*^9}, 3.5831159785778484`*^9, {3.5831950312947235`*^9, 3.5831950624245043`*^9}, 3.583195093070257*^9, {3.5831953863110294`*^9, 3.5831954090113277`*^9}, 3.5831965106443377`*^9, 3.583196798028775*^9, 3.5831974039374313`*^9, 3.5831995307810793`*^9, {3.583262850311042*^9, 3.583262906352247*^9}, { 3.5832629743151345`*^9, 3.5832629745991507`*^9}, {3.583263096230108*^9, 3.5832631116099873`*^9}, 3.5832632618335795`*^9, {3.583263553874284*^9, 3.5832635819218874`*^9}, 3.5832636317567377`*^9, {3.583263666603731*^9, 3.583263667121761*^9}, {3.583606109343622*^9, 3.583606220053954*^9}, { 3.5836063405198445`*^9, 3.5836063630061307`*^9}, {3.5836068599135523`*^9, 3.583606879198655*^9}, {3.5836070817512407`*^9, 3.5836070997092676`*^9}, { 3.583607153272331*^9, 3.5836071756806135`*^9}, 3.583607479755005*^9, { 3.5836076119155645`*^9, 3.583607626649407*^9}, {3.5836106787799788`*^9, 3.5836107138109827`*^9}, {3.5836108043421607`*^9, 3.58361081272064*^9}, { 3.5836109501004972`*^9, 3.5836109571138988`*^9}, {3.5836109913458567`*^9, 3.583610991879887*^9}, {3.5836110358514023`*^9, 3.583611043537842*^9}, { 3.5836152467872543`*^9, 3.5836153118929777`*^9}, {3.5836153811059365`*^9, 3.583615391232516*^9}, {3.5836154584893627`*^9, 3.583615466414816*^9}, { 3.5836155802403264`*^9, 3.5836156397347293`*^9}, 3.5836156831912146`*^9, { 3.583615721288394*^9, 3.5836157304869204`*^9}, {3.583615832168736*^9, 3.5836158612543993`*^9}, {3.583615893134223*^9, 3.583615914254431*^9}, 3.5836160123460417`*^9, {3.5837657472602654`*^9, 3.5837657693975315`*^9}, { 3.5837658006953216`*^9, 3.5837658468669624`*^9}, 3.583765878537774*^9, { 3.583765914987859*^9, 3.583765915194871*^9}, {3.58376605785003*^9, 3.5837661283120604`*^9}, {3.58376615995087*^9, 3.5837661617149706`*^9}, { 3.583766275004451*^9, 3.5837663081683474`*^9}, {3.5837663508687897`*^9, 3.5837663513308163`*^9}, {3.5837667744490175`*^9, 3.5837667833305254`*^9}, {3.5837668763868475`*^9, 3.5837669035203996`*^9}, {3.5837688942242613`*^9, 3.5837689331664886`*^9}, 3.5837690946417246`*^9, {3.5837705163520417`*^9, 3.5837705237194633`*^9}, { 3.5837706808594513`*^9, 3.5837706932751613`*^9}, {3.58378203044361*^9, 3.5837820334927845`*^9}, 3.608991689369619*^9, {3.608991889801453*^9, 3.608991940174221*^9}, {3.6089992968073373`*^9, 3.6089992987576365`*^9}, { 3.6090009998135395`*^9, 3.6090010132987337`*^9}, 3.6101088573702817`*^9, 3.6102852682120533`*^9, {3.610285302219612*^9, 3.6102853094894347`*^9}, { 3.610395327485095*^9, 3.610395331741915*^9}, {3.6103986466807833`*^9, 3.610398663336836*^9}, 3.615743007294486*^9, 3.6157431486435966`*^9, { 3.615743206168971*^9, 3.615743214840513*^9}, {3.6157432597744904`*^9, 3.6157432612454653`*^9}, {3.615745238607219*^9, 3.6157452575468454`*^9}}], Cell[CellGroupData[{ Cell[TextData[{ "Critical (\[OpenCurlyDoubleQuote]breakpoint \[OpenCurlyDoubleQuote]) value ", Cell[BoxData[ FormBox[ SuperscriptBox["b", "*"], TraditionalForm]], FormatType->"TraditionalForm"], "(a) for dw=2" }], "Subsubsection", CellChangeTimes->{{3.609087322336032*^9, 3.6090873335955467`*^9}, { 3.609109202647727*^9, 3.6091092049492564`*^9}, {3.610285424330968*^9, 3.6102854276561747`*^9}, {3.615742484968255*^9, 3.615742495004468*^9}, { 3.6157432858628902`*^9, 3.615743310479308*^9}}], Cell[BoxData[ RowBox[{ RowBox[{"(*", RowBox[{"Max", " ", RowBox[{"F", "[", "y", "]"}]}], "*)"}], RowBox[{ RowBox[{ RowBox[{ RowBox[{"MaY", "[", RowBox[{"n_", ",", "dw_", ",", "m_", ",", "a_", ",", "b_", ",", "q_"}], "]"}], ":=", RowBox[{"Max", "@", RowBox[{"Table", "[", RowBox[{ RowBox[{"ySW", "[", RowBox[{"y", ",", RowBox[{"{", RowBox[{"n", ",", "dw", ",", "q", ",", "m", ",", "a", ",", "b"}], "}"}]}], "]"}], ",", RowBox[{"{", RowBox[{"y", ",", ".01", ",", "1", ",", ".025"}], "}"}]}], "]"}]}]}], ";"}], "\n", RowBox[{"(*", RowBox[{ RowBox[{"Zoom", " ", "f"}], "-", "n"}], "*)"}], "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"Zom", "[", RowBox[{ RowBox[{"{", RowBox[{"x_", ",", "y_"}], "}"}], ",", "f_"}], "]"}], ":=", RowBox[{"Which", "[", RowBox[{ RowBox[{ RowBox[{"f", "[", FractionBox[ RowBox[{"x", "+", "y"}], "2"], "]"}], "<", "0"}], ",", RowBox[{"{", RowBox[{"x", ",", FractionBox[ RowBox[{"x", "+", "y"}], "2"]}], "}"}], ",", RowBox[{ RowBox[{"f", "[", FractionBox[ RowBox[{"x", "+", "y"}], "2"], "]"}], ">", "0"}], ",", RowBox[{"{", RowBox[{ FractionBox[ RowBox[{"x", "+", "y"}], "2"], ",", "y"}], "}"}]}], "]"}]}], ";"}], "\n", RowBox[{"(*", RowBox[{"Compute", " ", "critical", " ", SuperscriptBox["b", "*"], RowBox[{"(", "a", ")"}]}], "*)"}], RowBox[{ RowBox[{ RowBox[{"NLB", "[", RowBox[{"a_", ",", "q_", ",", "m_"}], "]"}], ":=", RowBox[{"With", "[", RowBox[{ RowBox[{"{", RowBox[{"b0", "=", FractionBox[ RowBox[{"4", RowBox[{"(", RowBox[{"1", "+", "m"}], ")"}]}], RowBox[{ RowBox[{"(", RowBox[{"1", "-", SuperscriptBox["q", "2"]}], ")"}], "a"}]]}], "}"}], ",", RowBox[{"NestWhile", "[", RowBox[{ RowBox[{ RowBox[{"Zom", "[", RowBox[{"#", ",", RowBox[{ RowBox[{"MaY", "[", RowBox[{"20", ",", StyleBox["2", FontColor->RGBColor[1, 0, 0]], ",", "m", ",", "a", ",", "#", ",", "q"}], "]"}], "&"}]}], "]"}], "&"}], ",", RowBox[{"{", RowBox[{"b0", ",", "0"}], "}"}], ",", RowBox[{ RowBox[{ RowBox[{"Abs", "[", RowBox[{ RowBox[{"#", "[", RowBox[{"[", "1", "]"}], "]"}], "-", RowBox[{"#", "[", RowBox[{"[", "2", "]"}], "]"}]}], "]"}], ">", ".001"}], "&"}]}], "]"}]}], "]"}]}], ";"}]}]}]], "Input", CellChangeTimes->{{3.6089945829882107`*^9, 3.608994668657767*^9}, { 3.6089953111457376`*^9, 3.6089953116880894`*^9}, {3.6089954441920567`*^9, 3.6089954511797137`*^9}, {3.6090076616796227`*^9, 3.6090076622780275`*^9}, {3.6090128101357875`*^9, 3.6090128190217123`*^9}, {3.609087289531151*^9, 3.6090872976635785`*^9}, { 3.60908738436841*^9, 3.60908740961926*^9}, 3.6101088581297836`*^9, { 3.6103954302837944`*^9, 3.6103954345886507`*^9}, 3.6157429329969225`*^9, { 3.6157433300733786`*^9, 3.615743356696144*^9}}], Cell[BoxData[ RowBox[{ RowBox[{"(*", RowBox[{ RowBox[{"Upper", " ", "bound", " ", "of", " ", "breakpoint", " ", RowBox[{"region", ":", " ", RowBox[{ RowBox[{ RowBox[{"critical", " ", "B"}], "-", RowBox[{"values", " ", "for", " ", RowBox[{"Max", "[", "F", "]"}]}]}], ">", "0"}]}]}], ",", " ", RowBox[{"Allee", " ", "q"}]}], "*)"}], RowBox[{ RowBox[{ RowBox[{ RowBox[{"BcV", "[", "q_", "]"}], ":=", RowBox[{"Table", "[", RowBox[{ RowBox[{"NLB", "[", RowBox[{"a", ",", "q", ",", ".2"}], "]"}], ",", RowBox[{"{", RowBox[{"a", ",", "1", ",", "10", ",", ".25"}], "}"}]}], "]"}]}], ";"}], "\[IndentingNewLine]", RowBox[{"(*", RowBox[{ RowBox[{"Upper", " ", "bound", " ", "of", " ", "breakpoint", " ", RowBox[{"region", ":", " ", RowBox[{ RowBox[{"critical", " ", RowBox[{ RowBox[{"F", "'"}], "[", "0", "]"}]}], "<", RowBox[{"0", " ", "curve", " ", "of", " ", "A"}]}]}]}], ",", "q", ",", " ", RowBox[{"\[Mu]", "=", "m"}]}], "*)"}], "\n", RowBox[{ RowBox[{ RowBox[{"BMV", "[", RowBox[{"a_", ",", "q_", ",", "m_"}], "]"}], "=", FractionBox[ RowBox[{"4", RowBox[{"(", RowBox[{"1", "+", "m"}], ")"}]}], RowBox[{ RowBox[{"(", RowBox[{"1", "-", SuperscriptBox["q", "2"]}], ")"}], "a"}]]}], ";"}]}]}]], "Input", CellChangeTimes->{{3.6157436558874454`*^9, 3.6157436833998036`*^9}, 3.615744051182892*^9, {3.6157440872609625`*^9, 3.61574409397144*^9}, { 3.615744147957597*^9, 3.6157441767237873`*^9}, 3.615744232816204*^9}], Cell[BoxData[ RowBox[{ RowBox[{"(*", RowBox[{ RowBox[{ "Plot", " ", "breakpoint", " ", "region", " ", "for", " ", "AAllee"}], " ", "=", "q"}], "*)"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"PBR", "[", "q_", "]"}], ":=", RowBox[{"Block", "[", RowBox[{ RowBox[{"{", RowBox[{"(*", RowBox[{"a", "-", "range"}], "*)"}], RowBox[{ RowBox[{"raG", "=", RowBox[{"Range", "[", RowBox[{"1", ",", "10", ",", ".25"}], "]"}]}], ",", "\n", RowBox[{"bbz", "=", RowBox[{"BMV", "[", RowBox[{"raG", ",", "q", ",", ".2"}], "]"}]}], ",", RowBox[{"abc", "=", RowBox[{"Mean", "/@", RowBox[{"BcV", "[", "q", "]"}]}]}]}], "}"}], ",", "\[IndentingNewLine]", RowBox[{"ListLinePlot", "[", RowBox[{ RowBox[{"{", RowBox[{"abc", ",", "bbz"}], "}"}], ",", RowBox[{"DataRange", "\[Rule]", RowBox[{"{", RowBox[{"1", ",", "10"}], "}"}]}], ",", RowBox[{"Frame", "\[Rule]", "True"}], ",", RowBox[{"PlotRange", "\[Rule]", RowBox[{"{", RowBox[{"0", ",", "30"}], "}"}]}], ",", RowBox[{"FrameLabel", "\[Rule]", RowBox[{"{", RowBox[{"\"\\"", ",", "\"\\""}], "}"}]}], ",", "Bst", ",", RowBox[{"Filling", "\[Rule]", RowBox[{"{", RowBox[{"1", "\[Rule]", RowBox[{"{", "2", "}"}]}], "}"}]}], ",", RowBox[{"PlotLabel", "\[Rule]", RowBox[{"Row", "[", RowBox[{"{", RowBox[{"\"\\"", ",", "q"}], "}"}], "]"}]}], ",", RowBox[{"PlotStyle", "\[Rule]", "Gray"}]}], "]"}]}], "]"}]}]}]], "Input", CellChangeTimes->{{3.6090091641440315`*^9, 3.609009216208757*^9}, 3.609009248987624*^9, {3.6090105356662173`*^9, 3.609010568761302*^9}, { 3.609012873457026*^9, 3.609012904492728*^9}, {3.609087449993366*^9, 3.6090874665744257`*^9}, 3.615742552295682*^9, {3.615742650858436*^9, 3.6157426688354244`*^9}, {3.6157427223040934`*^9, 3.6157427308678045`*^9}, {3.615742772466555*^9, 3.615742821722411*^9}, { 3.615743731436843*^9, 3.6157437658592*^9}, {3.615743978859652*^9, 3.6157439968166285`*^9}}], Cell[BoxData[ RowBox[{ RowBox[{"(*", "Test", "*)"}], RowBox[{"PBR", "@", ".95"}]}]], "Input", CellChangeTimes->{{3.615743395322395*^9, 3.6157434134645033`*^9}, 3.6157434519992046`*^9, {3.615744198279166*^9, 3.6157442008758974`*^9}, 3.6157512738218946`*^9}] }, Closed]] }, Closed]] }, Open ]], Cell[CellGroupData[{ Cell["MDA control", "Section", CellChangeTimes->{{3.5807523951370173`*^9, 3.5807524016713915`*^9}, { 3.585144476540441*^9, 3.585144477839515*^9}, {3.5869852546048565`*^9, 3.586985260112171*^9}, {3.5870662326696568`*^9, 3.58706627241593*^9}, { 3.5870664479409695`*^9, 3.5870664479459696`*^9}, {3.6087362616308465`*^9, 3.608736333982337*^9}, {3.608739524471233*^9, 3.6087395769547606`*^9}, { 3.6092745726304483`*^9, 3.60927457712599*^9}, 3.609275161742839*^9, { 3.6101077726421328`*^9, 3.610107793986289*^9}, {3.6102073659832983`*^9, 3.6102073729339128`*^9}, {3.6103920198693743`*^9, 3.610392032676871*^9}, 3.615745413838513*^9, {3.6157463020001173`*^9, 3.6157463026315374`*^9}, 3.615751838903844*^9, {3.615762637701666*^9, 3.615762648125618*^9}}], Cell[CellGroupData[{ Cell["Macdonald ", "Subsection", CellChangeTimes->{{3.615751842843474*^9, 3.615751846622998*^9}}], Cell[CellGroupData[{ Cell["Codes", "Subsubsection", CellChangeTimes->{{3.5870663374506493`*^9, 3.5870663486402893`*^9}, { 3.615745405703086*^9, 3.6157454101500516`*^9}, {3.615746298949078*^9, 3.615746306230936*^9}}], Cell[BoxData[ RowBox[{ RowBox[{"(*", RowBox[{ RowBox[{ "Extended", " ", "MWB", " ", "system", " ", "for", " ", "treatment", " ", "for", " ", "basic", " ", "as"}], ",", " ", RowBox[{ RowBox[{ RowBox[{"with", " ", "untreated"}], "=", RowBox[{ RowBox[{"w", " ", "tretead"}], "=", "u"}]}], ";", " ", RowBox[{ RowBox[{"treatment", " ", "fractions"}], " ", "=", " ", "f"}]}]}], "*)"}], "\n", RowBox[{ RowBox[{ RowBox[{ RowBox[{"EAS", "[", RowBox[{"as_", ",", "w_", ",", "u_", ",", "f_"}], "]"}], ":=", RowBox[{"{", RowBox[{ RowBox[{"as", "[", RowBox[{"[", "1", "]"}], "]"}], ",", RowBox[{ RowBox[{ RowBox[{"Sign", "[", "f", "]"}], RowBox[{"as", "[", RowBox[{"[", "1", "]"}], "]"}]}], "/.", RowBox[{"Thread", "[", RowBox[{"w", "->", "u"}], "]"}]}], ",", RowBox[{ RowBox[{"as", "[", RowBox[{"[", "2", "]"}], "]"}], "/.", RowBox[{"Thread", "[", RowBox[{"w", "->", RowBox[{"(", RowBox[{ RowBox[{"f", " ", "u"}], "+", RowBox[{"w", RowBox[{"(", RowBox[{"1", "-", "f"}], ")"}]}]}], ")"}]}], "]"}]}]}], "}"}]}], ";"}], "\[IndentingNewLine]", RowBox[{"(*", RowBox[{ "Event", " ", "control", " ", "with", " ", "regular", " ", "timing"}], "*)"}], "\n", RowBox[{ RowBox[{ RowBox[{"WE1", "[", RowBox[{ RowBox[{"{", RowBox[{"ww_", ",", RowBox[{"(*", "Covered", "*)"}], "uu_", ",", "ff_"}], "}"}], ",", RowBox[{"{", RowBox[{"fc_", ",", "ep_", ",", "Ft_"}], "}"}]}], "]"}], ":=", RowBox[{"With", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"w", "=", RowBox[{"ww", "[", "t", "]"}]}], ",", RowBox[{"u", "=", RowBox[{"uu", "@", "t"}]}], ",", RowBox[{"f", "=", RowBox[{"ff", "@", "t"}]}]}], "}"}], ",", "\[IndentingNewLine]", RowBox[{"WhenEvent", "[", RowBox[{ RowBox[{ RowBox[{"Mod", "[", RowBox[{"t", ",", "Ft"}], "]"}], "\[Equal]", "0"}], ",", "\[IndentingNewLine]", RowBox[{"{", RowBox[{ RowBox[{"w", "\[Rule]", RowBox[{ RowBox[{"f", " ", "u"}], "+", RowBox[{ RowBox[{"(", RowBox[{"1", "-", "f"}], ")"}], "w"}]}]}], ",", "\[IndentingNewLine]", RowBox[{"u", "->", RowBox[{"ep", " ", "w"}]}], ",", RowBox[{"f", "\[Rule]", "fc"}]}], "}"}]}], "]"}]}], "]"}]}], ";"}], "\n", RowBox[{"(*", RowBox[{ "Endemic", " ", "equilibrium", " ", "for", " ", "pretreatment", " ", "Initialization"}], "*)"}], "\n", RowBox[{ RowBox[{ RowBox[{"EqI", "[", RowBox[{ RowBox[{"{", RowBox[{"a_", ",", "b_", ",", "k_", ",", "\[Gamma]_", ",", "\[Nu]_"}], "}"}], ",", "s_"}], "]"}], ":=", RowBox[{ RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"a", "/", "\[Gamma]"}], ",", "0", ",", "1"}], "}"}], " ", "y"}], "/.", "\[VeryThinSpace]", RowBox[{"FindRoot", "[", RowBox[{ RowBox[{"Eqy", "[", RowBox[{ RowBox[{"{", RowBox[{"a", ",", "b", ",", "k", ",", "\[Gamma]", ",", "\[Nu]"}], "}"}], ",", "s"}], "]"}], ",", RowBox[{"{", RowBox[{"y", ",", "0.95`", ",", "0", ",", "1"}], "}"}]}], "]"}]}]}], ";"}], "\[IndentingNewLine]", RowBox[{"(*", RowBox[{ RowBox[{"Combined", " ", RowBox[{"MWB", ":", " ", RowBox[{"for", " ", "untreated", " ", "w"}]}]}], ",", " ", RowBox[{"treated", " ", "u"}]}], "*)"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"mWB", "=", RowBox[{ RowBox[{ RowBox[{"(", RowBox[{"1", "-", "f"}], ")"}], "w"}], "+", RowBox[{"f", " ", "u"}]}]}], ";"}]}]}]], "Input", CellChangeTimes->{{3.5778998801974645`*^9, 3.5778998923681602`*^9}, { 3.577902063573346*^9, 3.5779020642243834`*^9}, 3.5779045313724966`*^9, { 3.5779070645123835`*^9, 3.5779070685366135`*^9}, {3.5779077995694265`*^9, 3.577907821504681*^9}, {3.5779790541160493`*^9, 3.577979060358406*^9}, 3.5779806000744734`*^9, 3.577980905229927*^9, {3.577980937255759*^9, 3.577980955726815*^9}, 3.5779813407128353`*^9, 3.5779820713156233`*^9, 3.5779843414084654`*^9, 3.578490250407954*^9, 3.5785174671541557`*^9, { 3.57851753978831*^9, 3.5785175403453417`*^9}, {3.5807430309386325`*^9, 3.580743042349285*^9}, 3.5808271939086456`*^9, {3.5808404139487886`*^9, 3.5808404327088614`*^9}, {3.5809265316342487`*^9, 3.5809265587487993`*^9}, {3.5810184026004486`*^9, 3.5810184042045403`*^9}, 3.581020253799331*^9, 3.581093162019294*^9, {3.5822226390600147`*^9, 3.5822226425832157`*^9}, {3.5822234201864233`*^9, 3.582223423241598*^9}, { 3.5832662068060226`*^9, 3.583266207027035*^9}, 3.583765224115343*^9, 3.583765265636718*^9, 3.5842867251729445`*^9, {3.584405139246133*^9, 3.584405156212104*^9}, {3.5844052019637203`*^9, 3.584405203045782*^9}, 3.585086055331216*^9, 3.585243137802143*^9, 3.5853366352790956`*^9, 3.5872437294706173`*^9, {3.6109086051946187`*^9, 3.61090860790842*^9}, { 3.615645315256566*^9, 3.6156453159130077`*^9}, 3.6157486318056726`*^9, 3.6157488423595376`*^9, 3.6157512980830793`*^9, 3.6157519525822887`*^9}, CellTags->{"General", "Macd control"}] }, Closed]], Cell[CellGroupData[{ Cell["Endemic initialization; DS", "Subsubsection", CellChangeTimes->{{3.5869846417238016`*^9, 3.5869846494782453`*^9}, { 3.586984950178444*^9, 3.586984960153015*^9}, {3.5869850242446804`*^9, 3.5869850247477093`*^9}, {3.5869851510359325`*^9, 3.586985151038933*^9}, 3.5869852514276743`*^9, {3.5871289228955526`*^9, 3.5871289368613515`*^9}, 3.587145892090135*^9, {3.608736451804932*^9, 3.6087364700441055`*^9}, { 3.6087396064694457`*^9, 3.608739649779337*^9}, {3.608742338714525*^9, 3.608742340081439*^9}, {3.610291997144225*^9, 3.610292008558798*^9}, { 3.6157463355675097`*^9, 3.6157463569187517`*^9}, {3.615751898286069*^9, 3.615751903884802*^9}}], Cell[BoxData[ RowBox[{ RowBox[{"(*", RowBox[{ "transmission", " ", "pars", " ", "for", " ", "NB", " ", "MacDonald"}], "*)"}], "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"paNB", "=", RowBox[{"{", RowBox[{"0.8`", ",", "16.35`", ",", "0.14`", ",", "0.35", ",", "5.`"}], "}"}]}], ";"}], "\n", RowBox[{"(*", RowBox[{"Endemic", " ", "initialization"}], "*)"}], RowBox[{ RowBox[{"wyM", "=", RowBox[{ RowBox[{"{", RowBox[{"w0", ",", "u0", ",", "y0"}], "}"}], "=", RowBox[{"EqI", "[", RowBox[{"paNB", ",", "1"}], "]"}]}]}], ";"}], "\n", RowBox[{"(*", RowBox[{"NB", "-", RowBox[{"MacDonald", " ", "DS"}]}], "*)"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"dsNB", "=", RowBox[{"DSV", "[", RowBox[{ RowBox[{"EAS", "[", RowBox[{ RowBox[{"MdN", "[", RowBox[{"paNB", ",", "1"}], "]"}], ",", "w", ",", "u", ",", RowBox[{"f", "@", "t"}]}], "]"}], ",", RowBox[{"{", RowBox[{"w", ",", "u", ",", "y"}], "}"}], ",", "wyM", ",", "0"}], "]"}]}], ";"}]}]}]], "Input", CellChangeTimes->{{3.5851458137159233`*^9, 3.5851458203103004`*^9}, 3.5852466340741186`*^9, 3.5852466909753733`*^9, 3.5852469456589403`*^9, 3.5852478986864505`*^9, 3.5852479685054436`*^9, {3.5852481867999296`*^9, 3.585248188453024*^9}, 3.5852491877661815`*^9, {3.585410242258892*^9, 3.585410261221977*^9}, 3.585519794247282*^9, 3.585579543552904*^9, { 3.5868087300138235`*^9, 3.5868087311338882`*^9}, {3.586984654915556*^9, 3.5869846765317926`*^9}, {3.5870715813855853`*^9, 3.587071584548766*^9}, { 3.5871287157277036`*^9, 3.587128719459917*^9}, {3.5871287983514295`*^9, 3.5871287996565037`*^9}, {3.5871289489820447`*^9, 3.5871289565484776`*^9}, 3.5871289900083914`*^9, 3.5872434614732885`*^9, {3.608739760229868*^9, 3.6087397654823647`*^9}, {3.6087410207519584`*^9, 3.608741021815669*^9}, 3.608741279063655*^9, {3.609275313980441*^9, 3.609275323187549*^9}, { 3.609275358141732*^9, 3.60927536439088*^9}, {3.609275419359341*^9, 3.6092754333056*^9}, {3.60927547288485*^9, 3.609275483937339*^9}, { 3.60927556213021*^9, 3.60927559475285*^9}, 3.6092764673293343`*^9, 3.6092765733180904`*^9, 3.6092767575733857`*^9, 3.609277723249361*^9, 3.609278846294325*^9, 3.6092790124926233`*^9, 3.6092791866811647`*^9, { 3.609279396040718*^9, 3.6092793971664658`*^9}, 3.609280702599762*^9, 3.609281203348441*^9, {3.6092851330489893`*^9, 3.609285148640336*^9}, { 3.610292071768724*^9, 3.6102921322908745`*^9}, 3.6102922171318207`*^9, { 3.6102922508441806`*^9, 3.6102922541783986`*^9}, {3.610314078808945*^9, 3.6103141065823717`*^9}, {3.6103141525258503`*^9, 3.610314153542519*^9}, { 3.6103150025018663`*^9, 3.6103150108834286`*^9}, 3.6103151788538747`*^9, { 3.6103157135880113`*^9, 3.6103157237467484`*^9}, {3.6157458534956264`*^9, 3.6157459006300697`*^9}, {3.6157459422620244`*^9, 3.615745948326069*^9}, 3.6157487200055094`*^9, {3.6157518821473026`*^9, 3.615751891023227*^9}}] }, Closed]], Cell[CellGroupData[{ Cell["3 - year control with cover f=.7; drug efficacy \[Epsilon]=.1", \ "Subsubsection", CellChangeTimes->{{3.5870656065658455`*^9, 3.5870656251959105`*^9}, { 3.5870657041754284`*^9, 3.587065731847011*^9}, {3.6102931243308873`*^9, 3.6102931270416813`*^9}, {3.615746012738038*^9, 3.6157460336179657`*^9}}], Cell[BoxData[ RowBox[{ RowBox[{"(*", RowBox[{"Test", " ", "run"}], "*)"}], "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"{", RowBox[{"cNw", ",", "cNu", ",", "cMW", ",", "cNy"}], "}"}], "=", RowBox[{"NDSolveValue", "[", RowBox[{ RowBox[{"{", RowBox[{"dsNB", ",", RowBox[{ RowBox[{"f", "[", "0", "]"}], "\[Equal]", "0"}], ",", "\[IndentingNewLine]", RowBox[{"WE1", "[", RowBox[{ RowBox[{"{", RowBox[{"w", ",", "u", ",", "f"}], "}"}], ",", RowBox[{"{", RowBox[{"(*", "Cover", "*)"}], RowBox[{ RowBox[{"fc1", "=", ".7"}], ",", RowBox[{"(*", "Efficacy", "*)"}], RowBox[{"eh1", "=", ".1"}], ",", RowBox[{"(*", "Frequency", "*)"}], "3"}], "}"}]}], "]"}]}], "}"}], ",", "\[IndentingNewLine]", RowBox[{"{", RowBox[{"w", ",", "u", ",", "mWB", ",", "y"}], "}"}], ",", "\[IndentingNewLine]", RowBox[{"{", RowBox[{"t", ",", RowBox[{"t3", "=", "25"}]}], "}"}], ",", RowBox[{"DiscreteVariables", "\[Rule]", RowBox[{"{", "f", "}"}]}]}], "]"}]}], ";"}]}]], "Input", CellChangeTimes->{{3.585582205098136*^9, 3.5855822125635624`*^9}, { 3.5855827150793047`*^9, 3.585582726606964*^9}, {3.5855827593388367`*^9, 3.585582833625085*^9}, {3.585583890378528*^9, 3.585583927428647*^9}, { 3.58558517283188*^9, 3.585585173437915*^9}, {3.585585213897229*^9, 3.5855852949288635`*^9}, {3.5855853617656865`*^9, 3.585585362439725*^9}, { 3.586809293423049*^9, 3.586809295771183*^9}, {3.586985401198241*^9, 3.5869854053304777`*^9}, {3.5869854356852136`*^9, 3.586985459431572*^9}, { 3.5869855996895943`*^9, 3.5869856524586124`*^9}, {3.5870645529055796`*^9, 3.5870646658320384`*^9}, 3.5870648935160613`*^9, {3.587064939945717*^9, 3.5870649422688494`*^9}, {3.587064978971949*^9, 3.587064979216963*^9}, { 3.587065158881239*^9, 3.58706519054005*^9}, {3.5870656552706313`*^9, 3.5870656718395786`*^9}, {3.5870657711932616`*^9, 3.587065806607287*^9}, { 3.587071412468924*^9, 3.58707142201447*^9}, {3.5871290134657335`*^9, 3.5871290453935595`*^9}, {3.587243078874406*^9, 3.5872430999816127`*^9}, 3.587376930550579*^9, {3.608741791310277*^9, 3.6087417946705165`*^9}, { 3.6087421168618946`*^9, 3.6087421222765036`*^9}, {3.608743152936097*^9, 3.6087431622523174`*^9}, 3.6092760106334047`*^9, 3.609276137773203*^9, 3.610292994382223*^9, {3.6103133421626453`*^9, 3.6103133717682858`*^9}, 3.610313411072358*^9, 3.610313442270055*^9, {3.610314527718462*^9, 3.6103145505576124`*^9}, 3.61031577640068*^9, {3.610315841726015*^9, 3.6103158420612373`*^9}, 3.6103173992557216`*^9, {3.615746000472855*^9, 3.615746001490533*^9}, {3.615746080097971*^9, 3.615746083593303*^9}}], Cell[BoxData[ RowBox[{ RowBox[{"(*", RowBox[{"Plot", " ", "control", " ", "solutions"}], "*)"}], RowBox[{"GRo", "[", RowBox[{"{", RowBox[{ RowBox[{"PTS", "[", RowBox[{ RowBox[{ RowBox[{"{", RowBox[{"cMW", ",", "cNw", ",", "cNu"}], "}"}], "/.", "InR"}], ",", RowBox[{"{", RowBox[{"0", ",", "t3"}], "}"}], ",", RowBox[{"rr", "=", RowBox[{"{", RowBox[{"0", ",", "2"}], "}"}]}], ",", RowBox[{"{", RowBox[{"Thick", ",", RowBox[{"{", "}"}], ",", "Dashed"}], "}"}], ",", RowBox[{"{", RowBox[{"\"\\"", ",", "\"\\""}], "}"}], ",", RowBox[{"FrT", "@", "rr"}]}], "]"}], ",", "\[IndentingNewLine]", RowBox[{"PTS", "[", RowBox[{ RowBox[{ RowBox[{"pNB", "[", RowBox[{"cMW", ",", ".14"}], "]"}], "/.", "InR"}], ",", RowBox[{"{", RowBox[{"0", ",", "t3"}], "}"}], ",", RowBox[{"rr", "=", RowBox[{"{", RowBox[{"0", ",", ".25"}], "}"}]}], ",", RowBox[{"{", "Thick", "}"}], ",", RowBox[{"{", RowBox[{"\"\\"", ",", "\"\\""}], "}"}], ",", RowBox[{"FrT", "@", "rr"}]}], "]"}], ",", "\[IndentingNewLine]", RowBox[{"PTS", "[", RowBox[{ RowBox[{"cNy", "/.", "InR"}], ",", RowBox[{"{", RowBox[{"0", ",", "t3"}], "}"}], ",", RowBox[{"rr", "=", RowBox[{"{", RowBox[{"0", ",", "1"}], "}"}]}], ",", RowBox[{"{", RowBox[{ RowBox[{"{", "}"}], ",", "Thick", ",", "Dashed"}], "}"}], ",", RowBox[{"{", RowBox[{"\"\\"", ",", "\"\\""}], "}"}], ",", RowBox[{"FrT", "@", "rr"}]}], "]"}]}], "}"}], "]"}]}]], "Input", CellChangeTimes->{{3.585582412215982*^9, 3.585582427003828*^9}, { 3.585582580476606*^9, 3.585582652261712*^9}, {3.5855838354353857`*^9, 3.5855838637220035`*^9}, {3.5855839296557746`*^9, 3.5855839376612325`*^9}, {3.585585597168151*^9, 3.585585599358276*^9}, { 3.586985659869036*^9, 3.5869856603320627`*^9}, {3.5870542358464775`*^9, 3.5870543190252347`*^9}, {3.5870543817838244`*^9, 3.587054403299055*^9}, { 3.587055088828265*^9, 3.587055134124856*^9}, 3.6087424415631313`*^9, { 3.6092768342102284`*^9, 3.6092768481704874`*^9}, 3.609285423522607*^9, { 3.6102929030406284`*^9, 3.6102929581692004`*^9}, {3.610313342881121*^9, 3.6103133723766966`*^9}, {3.6103134117598147`*^9, 3.610313412408245*^9}, 3.6103134434718504`*^9, 3.610314419055371*^9, {3.6103171604920597`*^9, 3.6103171836744375`*^9}, {3.6157460625022373`*^9, 3.6157460683181143`*^9}, {3.615751445453669*^9, 3.615751446522385*^9}, { 3.61575191134478*^9, 3.615751913094947*^9}}], Cell[BoxData[ RowBox[{ RowBox[{"(*", RowBox[{ RowBox[{"Plot", " ", "MWB", " ", "and", " ", "NB"}], "-", "prevalence"}], "*)"}], RowBox[{"GRo", "[", RowBox[{"{", RowBox[{ RowBox[{"PTS", "[", RowBox[{ RowBox[{ RowBox[{"{", RowBox[{"cMW", ",", "cNw", ",", "cNu"}], "}"}], "/.", "InR"}], ",", RowBox[{"{", RowBox[{"0", ",", "t3"}], "}"}], ",", RowBox[{"rr", "=", RowBox[{"{", RowBox[{"0", ",", "2"}], "}"}]}], ",", RowBox[{"{", "}"}], ",", RowBox[{"{", RowBox[{"\"\\"", ",", "\"\\""}], "}"}], ",", RowBox[{"FrT", "@", "rr"}]}], "]"}], ",", "\[IndentingNewLine]", RowBox[{"PTS", "[", RowBox[{ RowBox[{ RowBox[{"pNB", "[", RowBox[{"cMW", ",", ".14"}], "]"}], "/.", "InR"}], ",", RowBox[{"{", RowBox[{"0", ",", "t3"}], "}"}], ",", RowBox[{"rr", "=", RowBox[{"{", RowBox[{"0", ",", ".25"}], "}"}]}], ",", RowBox[{"{", "Black", "}"}], ",", RowBox[{"{", RowBox[{"\"\\"", ",", "\"\\""}], "}"}], ",", RowBox[{"FrT", "@", "rr"}]}], "]"}]}], "}"}], "]"}]}]], "Input", CellChangeTimes->{{3.585582412215982*^9, 3.585582427003828*^9}, { 3.585582580476606*^9, 3.585582652261712*^9}, {3.5855838354353857`*^9, 3.5855838637220035`*^9}, {3.5855839296557746`*^9, 3.5855839376612325`*^9}, {3.585585597168151*^9, 3.585585599358276*^9}, { 3.586985659869036*^9, 3.5869856603320627`*^9}, {3.5870542358464775`*^9, 3.5870543190252347`*^9}, {3.5870543817838244`*^9, 3.587054403299055*^9}, { 3.587055088828265*^9, 3.587055134124856*^9}, {3.6087424415631313`*^9, 3.608742521866764*^9}, {3.6092768784825926`*^9, 3.6092768832357492`*^9}, 3.6092854300539403`*^9, {3.610293020722697*^9, 3.610293021251053*^9}, { 3.61029305317068*^9, 3.6102930538341208`*^9}, {3.610313343591593*^9, 3.6103133730471334`*^9}, {3.610313413143731*^9, 3.6103134138291883`*^9}, 3.6103144620849223`*^9, {3.6103171962948112`*^9, 3.6103172015893183`*^9}, { 3.6103178105511103`*^9, 3.610317819758217*^9}, {3.615746115092317*^9, 3.615746125273108*^9}, {3.6157514580500727`*^9, 3.6157514587365284`*^9}, { 3.6157620629561615`*^9, 3.6157620632103357`*^9}}] }, Closed]] }, Open ]], Cell[CellGroupData[{ Cell["SWB", "Subsection", CellChangeTimes->{{3.5585504061338067`*^9, 3.558550417866478*^9}, { 3.578000574830964*^9, 3.578000584835536*^9}, {3.5784889051220083`*^9, 3.5784889061840687`*^9}, {3.6102953593382483`*^9, 3.6102953987052393`*^9}, {3.610392002951149*^9, 3.6103920124924784`*^9}, 3.6157469506437883`*^9, 3.615752067524334*^9}], Cell[CellGroupData[{ Cell["Codes", "Subsubsection", CellChangeTimes->{{3.6157481932413874`*^9, 3.615748198074617*^9}}], Cell[BoxData[ RowBox[{ RowBox[{"(*", RowBox[{ "Generate", " ", "SWB", " ", "DS", " ", "with", " ", "parametric", " ", "inputs"}], "*)"}], RowBox[{ RowBox[{ RowBox[{"DSW", "[", RowBox[{"(*", "strata", "*)"}], RowBox[{ RowBox[{"{", RowBox[{"n_", ",", "dw_", ",", "q_"}], "}"}], ",", RowBox[{"(*", "Demog", "*)"}], RowBox[{"{", RowBox[{"\[Mu]_", ",", "\[Gamma]_", ",", "\[Nu]_"}], "}"}], ",", RowBox[{"(*", RowBox[{ RowBox[{"Trans", " ", RowBox[{"rates", ":", RowBox[{"a", "*", "\[Gamma]"}]}]}], ";", RowBox[{"b", "*", "\[Nu]"}]}], "*)"}], RowBox[{"{", RowBox[{"a_", ",", "b_"}], "}"}], ",", RowBox[{"(*", "name", "*)"}], "h_"}], "]"}], ":=", "\[IndentingNewLine]", RowBox[{"Block", "[", RowBox[{ RowBox[{"{", RowBox[{"Sh", ",", "swb", ",", "eq", ",", "hQ", ",", "in"}], "}"}], ",", "\[IndentingNewLine]", RowBox[{"(*", "variables", "*)"}], RowBox[{ RowBox[{"hv", "=", RowBox[{"(", RowBox[{"h", "/@", RowBox[{"Range", "[", RowBox[{"0", ",", "n"}], "]"}]}], ")"}]}], ";", "\[IndentingNewLine]", RowBox[{"(*", RowBox[{"Dynamic", " ", "variables"}], "*)"}], " ", RowBox[{ RowBox[{"hh", "[", "t_", "]"}], "=", RowBox[{"Through", "@", RowBox[{"(", RowBox[{"hv", "@", "t"}], ")"}]}]}], ";", "\[IndentingNewLine]", RowBox[{"(*", "Source", "*)"}], RowBox[{"Sh", "=", RowBox[{"\[Mu]", " ", RowBox[{"UnitVector", "[", RowBox[{ RowBox[{"n", "+", "1"}], ",", "1"}], "]"}]}]}], ";", "\[IndentingNewLine]", RowBox[{"(*", RowBox[{"SWB", " ", "AS", " ", "with", " ", "pars"}], "*)"}], "\[IndentingNewLine]", RowBox[{"swb", "=", RowBox[{"SWA", "[", RowBox[{ RowBox[{"{", RowBox[{"n", ",", "dw", ",", "q"}], "}"}], ",", RowBox[{"{", RowBox[{"\[Mu]", ",", "\[Gamma]", ",", "\[Nu]"}], "}"}], ",", RowBox[{"{", RowBox[{"a", ",", "b"}], "}"}], ",", "h", ",", "Sh"}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"(*", RowBox[{"Equilibria", " ", "y"}], "*)"}], RowBox[{"eq", "=", RowBox[{"FindRoot", "[", RowBox[{ RowBox[{"ySW", "[", RowBox[{"y", ",", RowBox[{"{", RowBox[{"n", ",", "dw", ",", "q", ",", RowBox[{"\[Mu]", "/", "\[Gamma]"}], ",", RowBox[{"a", "/", "\[Gamma]"}], ",", RowBox[{"b", "/", "\[Nu]"}]}], "}"}]}], "]"}], ",", RowBox[{"{", RowBox[{"y", ",", "1"}], "}"}]}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"(*", RowBox[{"Equilibria", " ", "h"}], "*)"}], RowBox[{"hQ", "=", RowBox[{"SWc", "[", RowBox[{ RowBox[{ FractionBox[ RowBox[{"a", " ", "y"}], RowBox[{"dw", " ", "\[Gamma]"}]], "/.", "eq"}], ",", RowBox[{"\[Mu]", "/", "\[Gamma]"}], ",", "n"}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"(*", "initialization", "*)"}], RowBox[{"in", "=", RowBox[{"{", RowBox[{"hQ", ",", RowBox[{"y", "/.", "eq"}]}], "}"}]}], ";", "\[IndentingNewLine]", RowBox[{"(*", RowBox[{"DS", "-", "SWB"}], "*)"}], RowBox[{"DSV", "[", RowBox[{"swb", ",", RowBox[{"{", RowBox[{"hv", ",", "y"}], "}"}], ",", "in", ",", "0"}], "]"}]}]}], "]"}]}], ";"}]}]], "Input", CellChangeTimes->{{3.6102964195972934`*^9, 3.610296470872314*^9}, { 3.6102965038407197`*^9, 3.6102965081916075`*^9}, {3.6102965512111464`*^9, 3.610296552057708*^9}, 3.61029658394586*^9, {3.6102980501143103`*^9, 3.6102980980641203`*^9}, {3.610303749312669*^9, 3.610303759121171*^9}, { 3.6103062186220856`*^9, 3.6103062226057243`*^9}, 3.610306329515769*^9, 3.6103084961636915`*^9, {3.6103085565547547`*^9, 3.6103085568009167`*^9}, { 3.610393899157633*^9, 3.6103939742798405`*^9}, {3.6103940044618673`*^9, 3.6103940300308294`*^9}, {3.610394061317584*^9, 3.6103940877415404`*^9}, { 3.6103941263551474`*^9, 3.6103941277080507`*^9}, {3.610394171772283*^9, 3.610394191479353*^9}, {3.6103944513178897`*^9, 3.610394680145294*^9}, 3.6103949514764147`*^9, {3.6103956313440886`*^9, 3.6103956371039133`*^9}, { 3.610395904331363*^9, 3.610395907931752*^9}, {3.610395975836795*^9, 3.6103961264378433`*^9}, {3.610396404275657*^9, 3.6103964055705166`*^9}, 3.6103965636658525`*^9, {3.6103966466964717`*^9, 3.610396646985665*^9}, { 3.6103967505253477`*^9, 3.6103967658465137`*^9}, 3.610477631378068*^9, { 3.615748141231693*^9, 3.6157481435092115`*^9}, {3.61574821055494*^9, 3.6157482435469446`*^9}, {3.615748638910411*^9, 3.615748641206944*^9}, { 3.6157487056749473`*^9, 3.615748706355403*^9}, 3.6157526163726473`*^9}], Cell[BoxData[ RowBox[{ RowBox[{"(*", RowBox[{ RowBox[{ RowBox[{"Treatment", " ", "map", " ", "for", " ", "h"}], "-", RowBox[{"strata", ":", " ", RowBox[{"h", "[", "i", "]"}]}]}], "\[Rule]", " ", RowBox[{"h", "[", RowBox[{"\[Epsilon]", "*", "i"}], "]"}]}], "*)"}], "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{ RowBox[{"TrM", "[", RowBox[{"h_", ",", "n_", ",", "e_"}], "]"}], ":=", RowBox[{"PadRight", "[", RowBox[{ RowBox[{"Total", "/@", RowBox[{"Map", "[", RowBox[{"h", ",", RowBox[{"GatherBy", "[", RowBox[{ RowBox[{"Range", "[", RowBox[{"0", ",", "n"}], "]"}], ",", RowBox[{ RowBox[{"Floor", "[", RowBox[{"2", "e", " ", "#"}], "]"}], "&"}]}], "]"}], ",", RowBox[{"{", "2", "}"}]}], "]"}]}], ",", RowBox[{"n", "+", "1"}]}], "]"}]}], ";"}], "\n", RowBox[{"(*", RowBox[{ "MDA", " ", "Event", " ", "control", " ", "for", " ", "SWB", " ", "with", " ", "variables", " ", RowBox[{"hv", "[", "t", "]"}], " ", "and", " ", "control", " ", "parameters", " ", RowBox[{"{", RowBox[{ RowBox[{"fc", "=", RowBox[{"fraction", " ", "cover"}]}], ",", " ", RowBox[{"ep", "=", "efficacy"}], ",", " ", RowBox[{"tz", "=", " ", RowBox[{"interval", RowBox[{"(", "years", ")"}]}]}]}], "}"}]}], "*)"}], "\n", RowBox[{ RowBox[{ RowBox[{"WEB", "[", RowBox[{"hv_", ",", RowBox[{"{", RowBox[{"fc_", ",", "ep_", ",", "tz_"}], "}"}]}], "]"}], ":=", RowBox[{ StyleBox["With", FontColor->GrayLevel[0]], "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"hz", "=", RowBox[{"Through", "@", RowBox[{"(", RowBox[{"hv", "@", "t"}], ")"}]}]}], ",", RowBox[{"h", "=", RowBox[{"Head", "@", RowBox[{"hv", "[", RowBox[{"[", "1", "]"}], "]"}]}]}], ",", RowBox[{"ht", "=", RowBox[{ RowBox[{"TrM", "[", RowBox[{"h", ",", RowBox[{ RowBox[{"Length", "@", "hv"}], "-", "1"}], ",", "ep"}], "]"}], "/.", RowBox[{ RowBox[{"h", "[", "i_", "]"}], "\[Rule]", RowBox[{ RowBox[{"h", "[", "i", "]"}], "[", "t", "]"}]}]}]}]}], "}"}], ",", "\[IndentingNewLine]", RowBox[{"WhenEvent", "[", RowBox[{ RowBox[{ RowBox[{"Mod", "[", RowBox[{"t", ",", "tz"}], "]"}], "\[Equal]", "0"}], ",", "\[IndentingNewLine]", RowBox[{"{", RowBox[{ RowBox[{ RowBox[{"f", "@", "t"}], "\[Rule]", "fc"}], ",", RowBox[{"hz", "\[Rule]", RowBox[{ RowBox[{ RowBox[{"(", RowBox[{"1", "-", RowBox[{"f", "@", "t"}]}], ")"}], "hz"}], "+", RowBox[{ RowBox[{"f", "@", "t"}], " ", "ht"}]}]}]}], "}"}]}], "]"}]}], "]"}]}], ";"}], "\n", RowBox[{"(*", " ", RowBox[{"Event", " ", "occurence", " ", RowBox[{"control", ":", " ", RowBox[{ RowBox[{"remove", " ", "after", " ", "m"}], "+", RowBox[{"1", " ", "occurence"}]}]}]}], "*)"}], "\n", RowBox[{ RowBox[{ RowBox[{"WEBm", "[", RowBox[{"hv_", ",", RowBox[{"{", RowBox[{"fc_", ",", "ep_", ",", "tz_", ",", "m_"}], "}"}]}], "]"}], ":=", "\[IndentingNewLine]", RowBox[{ StyleBox["With", FontColor->GrayLevel[0]], "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"hz", "=", RowBox[{"Through", "@", RowBox[{"(", RowBox[{"hv", "@", "t"}], ")"}]}]}], ",", RowBox[{"h", "=", RowBox[{"Head", "@", RowBox[{"hv", "[", RowBox[{"[", "1", "]"}], "]"}]}]}], ",", RowBox[{"ht", "=", RowBox[{ RowBox[{"TrM", "[", RowBox[{"h", ",", RowBox[{ RowBox[{"Length", "@", "hv"}], "-", "1"}], ",", "ep"}], "]"}], "/.", RowBox[{ RowBox[{"h", "[", "i_", "]"}], "\[Rule]", RowBox[{ RowBox[{"h", "[", "i", "]"}], "[", "t", "]"}]}]}]}]}], "}"}], ",", "\[IndentingNewLine]", RowBox[{"WhenEvent", "[", RowBox[{ RowBox[{ RowBox[{"Mod", "[", RowBox[{"t", ",", "tz"}], "]"}], "\[Equal]", "0"}], ",", "\[IndentingNewLine]", RowBox[{"{", RowBox[{ RowBox[{ RowBox[{"f", "@", "t"}], "\[Rule]", "fc"}], ",", RowBox[{"hz", "\[Rule]", RowBox[{ RowBox[{ RowBox[{"(", RowBox[{"1", "-", RowBox[{"f", "@", "t"}]}], ")"}], "hz"}], "+", RowBox[{ RowBox[{"f", "@", "t"}], " ", "ht"}]}]}], ",", RowBox[{ RowBox[{"c", "[", "t", "]"}], "\[Rule]", RowBox[{ RowBox[{"c", "[", "t", "]"}], "+", "1"}]}], ",", "\[IndentingNewLine]", RowBox[{"If", "[", RowBox[{ RowBox[{ RowBox[{"c", "[", "t", "]"}], ">", "m"}], ",", "\"\\""}], "]"}]}], "}"}]}], "]"}]}], "]"}]}], ";"}], "\n", RowBox[{"(*", "Plots", "*)"}], "\n", RowBox[{ RowBox[{ RowBox[{"GPa", "[", RowBox[{"ch_", ",", "cp_", ",", "cy_", ",", "tp_"}], "]"}], ":=", RowBox[{"GRo", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"PTS", "[", RowBox[{ RowBox[{ RowBox[{"(", RowBox[{"ch", ".", "rgH"}], ")"}], "/.", "InR"}], ",", RowBox[{"{", RowBox[{"0", ",", "tp"}], "}"}], ",", "All", ",", RowBox[{"{", RowBox[{ RowBox[{"{", "}"}], ",", RowBox[{"{", "}"}], ",", "Dashed"}], "}"}], ",", RowBox[{"{", RowBox[{"\"\\"", ",", "\"\\""}], "}"}]}], "]"}], ",", "\[IndentingNewLine]", RowBox[{"PTS", "[", RowBox[{ RowBox[{"cp", "/.", "InR"}], ",", RowBox[{"{", RowBox[{"0", ",", "tp"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "1"}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"{", "}"}], ",", RowBox[{"{", "}"}], ",", "Dashed"}], "}"}], ",", RowBox[{"{", RowBox[{"\"\\"", ",", "\"\\""}], "}"}]}], "]"}], ",", "\[IndentingNewLine]", RowBox[{"PTS", "[", RowBox[{ RowBox[{"cy", "/.", "InR"}], ",", RowBox[{"{", RowBox[{"0", ",", "tp"}], "}"}], ",", "All", ",", RowBox[{"{", RowBox[{ RowBox[{"{", "}"}], ",", RowBox[{"{", "}"}], ",", "Dashed"}], "}"}], ",", RowBox[{"{", RowBox[{"\"\\"", ",", "\"\\""}], "}"}]}], "]"}]}], "}"}], ",", RowBox[{"ImageSize", "\[Rule]", "Large"}], ",", RowBox[{"Spacings", "\[Rule]", "0"}]}], "]"}]}], ";"}], "\n", RowBox[{"(*", RowBox[{ RowBox[{"Dynamic", " ", "SWB", " ", "prevalence", " ", "P", RowBox[{"(", RowBox[{ RowBox[{"MC", ">", RowBox[{"1", "/", "p"}]}], "=", RowBox[{"1", "-", SuperscriptBox["q", "n"]}]}], ")"}]}], " ", "-", " ", RowBox[{ "to", " ", "multiply", " ", "computed", " ", "solution", " ", "cH"}]}], "*)"}], RowBox[{ RowBox[{"DPS", "[", RowBox[{"n_", ",", "dw_", ",", "q_"}], "]"}], ":=", RowBox[{"With", "[", RowBox[{ RowBox[{"{", RowBox[{"r", "=", RowBox[{"dw", " ", RowBox[{"Range", "[", "n", "]"}]}]}], "}"}], ",", RowBox[{"BPS", "[", RowBox[{"r", ",", RowBox[{"1", "/", RowBox[{"(", RowBox[{"1", "-", SuperscriptBox["q", "r"]}], ")"}]}]}], "]"}]}], "]"}]}]}]}]], "Input", CellChangeTimes->{{3.584041539658312*^9, 3.584041571723146*^9}, { 3.5840416157726655`*^9, 3.584041671594858*^9}, {3.584042280019658*^9, 3.5840423689317436`*^9}, {3.5840424724076624`*^9, 3.584042478803028*^9}, { 3.584049951736455*^9, 3.584049952741513*^9}, {3.5881040557330337`*^9, 3.588104083048596*^9}, 3.5881041506714635`*^9, 3.588104427169278*^9, 3.6157469985017157`*^9, 3.6157470536914377`*^9, 3.615747910850253*^9, 3.6157482572210712`*^9, {3.6157486561819353`*^9, 3.6157486678937464`*^9}, 3.6157526702265654`*^9, {3.615754106276388*^9, 3.6157541074041405`*^9}, 3.615756353930015*^9, {3.6157564039657106`*^9, 3.6157564159817257`*^9}, 3.615756756186263*^9, {3.6157568563420734`*^9, 3.6157568617346706`*^9}, { 3.6157570624772453`*^9, 3.6157571140653687`*^9}, 3.615762408524065*^9}, TextJustification->1., CellTags->"SWB control"] }, Closed]], Cell[CellGroupData[{ Cell["Parameters, DS, initialization", "Subsubsection", CellChangeTimes->{{3.584123386748379*^9, 3.584123390737607*^9}, { 3.5881050827317743`*^9, 3.5881050843228655`*^9}, {3.615747759237387*^9, 3.6157477695612707`*^9}, {3.615752228811924*^9, 3.6157522302038507`*^9}}], Cell[BoxData[ RowBox[{ RowBox[{"(*", RowBox[{"pars", " ", "for", " ", "Equilibria"}], "*)"}], RowBox[{ RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"n1", "=", "20"}], ",", RowBox[{"d1", "=", "2"}], ",", RowBox[{"q1", "=", ".9"}], ",", RowBox[{"m1", "=", ".1"}], ",", RowBox[{"a1", "=", "6"}], ",", RowBox[{"b1", "=", "3.27"}]}], "}"}], ";"}], "\n", RowBox[{"(*", RowBox[{"Strata", " ", "pars", " ", "for", " ", "SWB"}], "*)"}], "\n", RowBox[{ RowBox[{"sPar", "=", RowBox[{"{", RowBox[{ RowBox[{"n1", "=", "20"}], ",", RowBox[{"d1", "=", "2"}], ",", RowBox[{"q1", "=", ".9"}]}], "}"}]}], ";"}], "\n", RowBox[{"(*", RowBox[{ RowBox[{"Demographic", " ", "pars", " ", "for", " ", RowBox[{"SWB", ":", " ", RowBox[{"human", " ", "turnover"}]}]}], ",", " ", RowBox[{"worm", " ", "mort"}], ",", " ", RowBox[{"snail", " ", "mort"}]}], "*)"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"dPar", "=", RowBox[{"{", RowBox[{"\[Mu]1", ",", RowBox[{"\[Gamma]1", "=", ".25"}], ",", RowBox[{"\[Nu]1", "=", "5"}]}], "}"}]}], ";"}], "\[IndentingNewLine]", RowBox[{"(*", "MWB", "*)"}], RowBox[{ RowBox[{"rgH", "=", RowBox[{"Range", "[", RowBox[{"0", ",", "n1"}], "]"}]}], ";"}], "\[IndentingNewLine]", RowBox[{"(*", RowBox[{"Demographic", " ", "Source"}], "*)"}], "\n", RowBox[{ RowBox[{"Sh1", "=", RowBox[{ RowBox[{"(", RowBox[{"\[Mu]1", "=", RowBox[{"\[Gamma]1", " ", "m1"}]}], ")"}], " ", RowBox[{"UnitVector", "[", RowBox[{ RowBox[{"n1", "+", "1"}], ",", "1"}], "]"}]}]}], ";"}]}]}]], "Input", CellChangeTimes->{{3.584040576789239*^9, 3.5840405790193663`*^9}, { 3.584040630326301*^9, 3.584040636547657*^9}, {3.5840431922118325`*^9, 3.584043194891986*^9}, {3.584043315750899*^9, 3.584043315908908*^9}, 3.584043380190584*^9, {3.5840462144396944`*^9, 3.5840462228221736`*^9}, { 3.610295565593951*^9, 3.6102955788858533`*^9}, {3.6102956951649914`*^9, 3.610295701956497*^9}, 3.610296049526617*^9, {3.61029647836482*^9, 3.61029648673137*^9}, 3.610296518147212*^9, {3.610298135793131*^9, 3.6102981404562263`*^9}, {3.6103039602669754`*^9, 3.610303964345682*^9}, { 3.610392199202793*^9, 3.610392208970271*^9}, {3.610392252122896*^9, 3.6103922530895395`*^9}, {3.6103955870126796`*^9, 3.6103955905180097`*^9}, 3.6157519537150435`*^9, 3.6157521926938324`*^9, {3.6157524920016513`*^9, 3.6157524982388153`*^9}, 3.615753472783098*^9, {3.615753528574957*^9, 3.615753557609332*^9}, {3.6157538717802343`*^9, 3.6157538901094594`*^9}}], Cell[BoxData[ RowBox[{ RowBox[{"(*", "variables", "*)"}], RowBox[{ RowBox[{ RowBox[{"hv", "=", RowBox[{"(", RowBox[{"h", "/@", RowBox[{"Range", "[", RowBox[{"0", ",", "n1"}], "]"}]}], ")"}]}], ";"}], "\n", RowBox[{"(*", RowBox[{"Algebraic", " ", "SWB", " ", "system"}], "*)"}], RowBox[{ RowBox[{"swb", "=", RowBox[{"SWA", "[", RowBox[{"sPar", ",", "dPar", ",", RowBox[{"{", RowBox[{ RowBox[{"a1", " ", "\[Gamma]1"}], ",", RowBox[{"b1", " ", "\[Nu]1"}]}], "}"}], ",", "h", ",", "Sh1"}], "]"}]}], ";"}], "\n", RowBox[{"(*", RowBox[{"Endemic", " ", "initialization"}], "*)"}], RowBox[{ RowBox[{"inZ", "=", RowBox[{ RowBox[{"{", RowBox[{"hv", ",", "y"}], "}"}], "/.", RowBox[{"FindRoot", "[", RowBox[{ RowBox[{"Flatten", "@", "swb"}], ",", RowBox[{"Append", "[", RowBox[{ RowBox[{"Thread", "@", RowBox[{"{", RowBox[{"hv", ",", "1"}], "}"}]}], ",", RowBox[{"{", RowBox[{"y", ",", "1"}], "}"}]}], "]"}]}], "]"}]}]}], ";"}], "\n", RowBox[{"(*", RowBox[{"Generate", " ", "DS"}], "*)"}], RowBox[{ RowBox[{"dsb", "=", RowBox[{"DSV", "[", RowBox[{"swb", ",", RowBox[{"{", RowBox[{"hv", ",", "y"}], "}"}], ",", "inZ", ",", "0"}], "]"}]}], ";"}]}]}]], "Input", CellChangeTimes->{{3.6157535894615803`*^9, 3.6157536439349165`*^9}, { 3.6157569693160925`*^9, 3.615756976687015*^9}, 3.6157624173729653`*^9}] }, Closed]], Cell[CellGroupData[{ Cell[" 3-year control", "Subsubsection", CellChangeTimes->{{3.5841241254996333`*^9, 3.584124132665043*^9}, { 3.584125078630149*^9, 3.584125086040573*^9}, {3.589653488441739*^9, 3.589653488446739*^9}, 3.6103193441100073`*^9, {3.61574725238453*^9, 3.615747276472596*^9}, {3.6157517884952173`*^9, 3.6157517963904867`*^9}}], Cell[BoxData[ RowBox[{ RowBox[{"(*", RowBox[{"3", "-", " ", RowBox[{"year", " ", "control"}]}], "*)"}], "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"{", RowBox[{"cSh", ",", "cSy"}], "}"}], "=", RowBox[{"NDSolveValue", "[", RowBox[{ RowBox[{"{", RowBox[{"dsb", ",", RowBox[{ RowBox[{"f", "[", "0", "]"}], "\[Equal]", "0"}], ",", StyleBox[ RowBox[{"WEB", "[", RowBox[{"hv", ",", RowBox[{"{", RowBox[{ RowBox[{"fc", "=", ".75"}], ",", ".1", ",", "3"}], "}"}]}], "]"}], FontColor->RGBColor[1, 0, 0]]}], "}"}], ",", "\[IndentingNewLine]", RowBox[{"{", RowBox[{"hv", ",", "y"}], "}"}], ",", "\[IndentingNewLine]", RowBox[{"{", RowBox[{"t", ",", RowBox[{"tf", "=", "30"}]}], "}"}], ",", RowBox[{"DiscreteVariables", "\[Rule]", RowBox[{"{", "f", "}"}]}]}], "]"}]}], ";"}]}]], "Input", CellChangeTimes->{{3.5840431438160644`*^9, 3.5840431490803657`*^9}, { 3.5840433634226255`*^9, 3.5840433747362723`*^9}, 3.5840462750461607`*^9, 3.584051356559807*^9, {3.5841213972195845`*^9, 3.5841213978056183`*^9}, 3.588104931453122*^9, 3.589653652305208*^9, {3.608231035395388*^9, 3.6082310398653593`*^9}, {3.61029592413392*^9, 3.6102959305051517`*^9}, 3.610297181539147*^9, {3.610297348778404*^9, 3.610297349490877*^9}, { 3.6102982288708825`*^9, 3.610298234548645*^9}, 3.610299508983023*^9, 3.610303980789596*^9, {3.610308015664812*^9, 3.610308024124419*^9}, { 3.6103931830431347`*^9, 3.6103931864674053`*^9}, 3.6157471521371083`*^9, 3.6157473890289984`*^9, {3.6157474702731943`*^9, 3.61574750843265*^9}, { 3.615751564162736*^9, 3.61575158099397*^9}, 3.615751954769745*^9, 3.6157521050943937`*^9, 3.615752215892304*^9, {3.6157546502494297`*^9, 3.6157546702887936`*^9}, {3.6157562558545904`*^9, 3.615756258062065*^9}, { 3.615756916201003*^9, 3.6157569326476383`*^9}}], Cell[BoxData[ RowBox[{ RowBox[{"(*", RowBox[{"Generate", " ", "DS1", " ", "with", " ", "q"}], "*)"}], RowBox[{ RowBox[{ RowBox[{"ds1", "=", RowBox[{"With", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"g1", "=", ".25"}], ",", RowBox[{"nu1", "=", "5"}]}], "}"}], ",", RowBox[{"DSW", "[", RowBox[{ RowBox[{"{", RowBox[{"20", ",", "2", ",", RowBox[{"q2", "=", ".85"}]}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{".1", "g1"}], ",", "g1", ",", "nu1"}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"a1", " ", "g1"}], ",", " ", RowBox[{"b1", " ", "nu1"}]}], "}"}], ",", "h"}], "]"}]}], "]"}]}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"{", RowBox[{"ch1", ",", "cy1"}], "}"}], "=", RowBox[{"NDSolveValue", "[", RowBox[{ RowBox[{"{", RowBox[{"ds1", ",", RowBox[{ RowBox[{"f", "[", "0", "]"}], "\[Equal]", "0"}], ",", StyleBox[ RowBox[{"WEB", "[", RowBox[{"hv", ",", RowBox[{"{", RowBox[{"fc", ",", ".1", ",", "3"}], "}"}]}], "]"}], FontColor->RGBColor[1, 0, 0]]}], "}"}], ",", "\[IndentingNewLine]", RowBox[{"{", RowBox[{"hv", ",", "y"}], "}"}], ",", "\[IndentingNewLine]", RowBox[{"{", RowBox[{"t", ",", RowBox[{"tf", "=", "30"}]}], "}"}], ",", RowBox[{"DiscreteVariables", "\[Rule]", RowBox[{"{", "f", "}"}]}]}], "]"}]}], ";"}]}]}]], "Input", CellChangeTimes->{{3.584043124402954*^9, 3.5840431250989943`*^9}, { 3.584043155154713*^9, 3.584043155822751*^9}, {3.5840433238133597`*^9, 3.584043337668152*^9}, {3.584121102292716*^9, 3.584121102921752*^9}, { 3.5841213691809807`*^9, 3.584121377816475*^9}, 3.584121732619768*^9, 3.584121763484534*^9, {3.584122408279414*^9, 3.5841225092881913`*^9}, { 3.5841226212015924`*^9, 3.584122624807799*^9}, 3.5841241539202585`*^9, { 3.584124242981353*^9, 3.5841242498647466`*^9}, {3.584124298771544*^9, 3.584124301873721*^9}, {3.584124514834902*^9, 3.584124520848246*^9}, { 3.5841252060554376`*^9, 3.584125206639471*^9}, 3.584125326964353*^9, 3.584125933080021*^9, {3.588104341833398*^9, 3.58810434326748*^9}, { 3.5881048364266863`*^9, 3.58810483858381*^9}, {3.589653643035035*^9, 3.589653646004012*^9}, 3.5896536791110578`*^9, 3.610296903512661*^9, { 3.6103967976469507`*^9, 3.610396840191175*^9}, {3.610398435639823*^9, 3.6103984364623733`*^9}, {3.6103985900542603`*^9, 3.610398591293083*^9}, { 3.6103988368813086`*^9, 3.6103988407518773`*^9}, {3.615747422420273*^9, 3.615747430176446*^9}, {3.6157516310153327`*^9, 3.615751698391118*^9}, { 3.6157546802834606`*^9, 3.6157546858011494`*^9}, {3.6157562803909597`*^9, 3.6157562813996305`*^9}, 3.615756919986529*^9}], Cell[BoxData[ RowBox[{ RowBox[{"(*", RowBox[{ "Solution", " ", "comparison", " ", "for", " ", "different", " ", "q"}], "*)"}], "\[IndentingNewLine]", RowBox[{"(*", "Prevalence", " ", "*)"}], RowBox[{ RowBox[{ RowBox[{"DpS", "=", RowBox[{"DPS", "[", RowBox[{"n1", ",", "d1", ",", "q1"}], "]"}]}], ";"}], "\[IndentingNewLine]", RowBox[{"(*", RowBox[{"Prevalence", " ", "1"}], "*)"}], RowBox[{ RowBox[{"Dp1", "=", RowBox[{"DPS", "[", RowBox[{"n1", ",", "d1", ",", "q2"}], "]"}]}], ";"}], "\n", RowBox[{"GPa", "[", RowBox[{ RowBox[{"{", RowBox[{"cSh", ",", "ch1"}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"DpS", ".", RowBox[{"Rest", "@", "cSh"}]}], ",", RowBox[{"Dp1", ".", RowBox[{"Rest", "@", "ch1"}]}]}], "}"}], ",", RowBox[{"{", RowBox[{"cSy", ",", "cy1"}], "}"}], ",", "30"}], "]"}]}]}]], "Input", CellChangeTimes->{{3.584043124402954*^9, 3.5840431250989943`*^9}, { 3.584043155154713*^9, 3.584043155822751*^9}, {3.5840433238133597`*^9, 3.584043337668152*^9}, {3.584121102292716*^9, 3.584121102921752*^9}, { 3.5841213691809807`*^9, 3.584121377816475*^9}, 3.584121732619768*^9, 3.584121763484534*^9, {3.584122408279414*^9, 3.5841225092881913`*^9}, { 3.5841226212015924`*^9, 3.584122624807799*^9}, 3.5841241539202585`*^9, { 3.584124242981353*^9, 3.5841242498647466`*^9}, {3.584124298771544*^9, 3.584124301873721*^9}, {3.584124514834902*^9, 3.584124520848246*^9}, { 3.5841252060554376`*^9, 3.584125206639471*^9}, 3.584125326964353*^9, 3.584125933080021*^9, {3.588104341833398*^9, 3.58810434326748*^9}, { 3.5881048364266863`*^9, 3.58810483858381*^9}, {3.589653643035035*^9, 3.589653646004012*^9}, 3.5896536791110578`*^9, 3.610296903512661*^9, { 3.61029693585211*^9, 3.6102969406583023`*^9}, 3.6103135040090113`*^9, 3.61031359036145*^9, {3.6103973589172564`*^9, 3.610397395775703*^9}, { 3.610397482461212*^9, 3.610397489707019*^9}, {3.6103978840962276`*^9, 3.6103978879828053`*^9}, 3.610398006658535*^9, {3.61039842482965*^9, 3.6103984529923344`*^9}, 3.6103985965045*^9, {3.61574752840097*^9, 3.615747538038398*^9}, {3.615747937436988*^9, 3.615747962687834*^9}, { 3.6157517327000027`*^9, 3.6157517370418997`*^9}}] }, Closed]], Cell[CellGroupData[{ Cell["\<\ Control 2: stop after 4 steps. Infection bopunced to endemic level\ \>", "Subsubsection", CellChangeTimes->{{3.5841239354217615`*^9, 3.584123945169319*^9}, { 3.5841250638923063`*^9, 3.584125067920537*^9}, {3.5841254991452017`*^9, 3.584125501656345*^9}, 3.615747238257103*^9, {3.615748574918541*^9, 3.6157485875349565`*^9}, {3.615751779287081*^9, 3.6157517843094244`*^9}, { 3.615762452791597*^9, 3.61576249243904*^9}}], Cell[BoxData[ RowBox[{ RowBox[{"(*", RowBox[{"4", " ", "year", " ", "conditional", " ", "control"}], " ", "*)"}], RowBox[{ RowBox[{ RowBox[{"{", RowBox[{"cSh", ",", "cSy"}], "}"}], "=", RowBox[{"NDSolveValue", "[", RowBox[{ RowBox[{"{", RowBox[{"ds1", ",", RowBox[{ RowBox[{"f", "[", "0", "]"}], "\[Equal]", "0"}], ",", RowBox[{ RowBox[{"c", "[", "0", "]"}], "\[Equal]", "0"}], ",", RowBox[{"WEBm", "[", RowBox[{"hv", ",", RowBox[{"{", RowBox[{ RowBox[{"fc", "=", StyleBox[".6", FontColor->RGBColor[1, 0, 0]]}], StyleBox[",", FontColor->RGBColor[1, 0, 0]], StyleBox[ RowBox[{"ec", "=", ".15"}], FontColor->RGBColor[1, 0, 0]], StyleBox[",", FontColor->RGBColor[1, 0, 0]], StyleBox["6", FontColor->RGBColor[1, 0, 0]], StyleBox[",", FontColor->RGBColor[1, 0, 0]], StyleBox[ RowBox[{"ns", "=", "3"}], FontColor->RGBColor[1, 0, 0]]}], StyleBox["}", FontColor->RGBColor[1, 0, 0]]}]}], StyleBox["]", FontColor->RGBColor[1, 0, 0]]}]}], "}"}], ",", "\[IndentingNewLine]", RowBox[{"{", RowBox[{"hv", ",", "y"}], "}"}], ",", "\[IndentingNewLine]", RowBox[{"{", RowBox[{"t", ",", RowBox[{"tf", "=", "60"}]}], "}"}], ",", RowBox[{"DiscreteVariables", "\[Rule]", RowBox[{"{", RowBox[{"f", ",", RowBox[{"Element", "[", RowBox[{"c", ",", "Integers"}], "]"}]}], "}"}]}]}], "]"}]}], ";"}]}]], "Input", CellChangeTimes->{{3.5840465517239857`*^9, 3.584046553652096*^9}, { 3.58404658676399*^9, 3.584046666331541*^9}, {3.584046699606444*^9, 3.584046700973522*^9}, {3.584046789333576*^9, 3.5840468302359157`*^9}, 3.5840468968137236`*^9, {3.5840473944631877`*^9, 3.584047434180459*^9}, 3.5840501976065187`*^9, {3.5840521274649*^9, 3.584052130660083*^9}, 3.5840521916375704`*^9, {3.584052426245989*^9, 3.5840524747897654`*^9}, { 3.5840531454071226`*^9, 3.5840531598889513`*^9}, {3.58405328277598*^9, 3.584053325752438*^9}, {3.5840533673058147`*^9, 3.5840533813936205`*^9}, { 3.5840535304661465`*^9, 3.5840535611379013`*^9}, 3.584053670809174*^9, { 3.5840537094013815`*^9, 3.58405372633135*^9}, {3.5840538215097933`*^9, 3.584053854078656*^9}, {3.5841239525087385`*^9, 3.5841240332433567`*^9}, { 3.5841240827881904`*^9, 3.5841240841572685`*^9}, {3.584124767709366*^9, 3.584124797019042*^9}, {3.584124827701797*^9, 3.5841248423906374`*^9}, { 3.584124906302293*^9, 3.584124937012049*^9}, {3.5881044180387564`*^9, 3.58810441863879*^9}, {3.588105005318347*^9, 3.5881050058853793`*^9}, 3.5881050553632092`*^9, 3.6103135108225317`*^9, 3.6103135957930546`*^9, { 3.6157567685164857`*^9, 3.615756773641905*^9}, {3.615756823082882*^9, 3.615756825290356*^9}, 3.6157568806983166`*^9}], Cell[BoxData[ RowBox[{ RowBox[{"(*", RowBox[{"4", " ", "year", " ", "conditional", " ", "control"}], " ", "*)"}], RowBox[{ RowBox[{ RowBox[{"{", RowBox[{"ch1", ",", "cy1"}], "}"}], "=", RowBox[{"NDSolveValue", "[", RowBox[{ RowBox[{"{", RowBox[{"dsb", ",", RowBox[{ RowBox[{"f", "[", "0", "]"}], "\[Equal]", "0"}], ",", RowBox[{ RowBox[{"c", "[", "0", "]"}], "\[Equal]", "0"}], ",", RowBox[{"WEBm", "[", RowBox[{"hv", ",", RowBox[{"{", StyleBox[ RowBox[{"fc", ",", "ec", ",", "6", ",", "ns"}], FontColor->RGBColor[1, 0, 0]], StyleBox["}", FontColor->RGBColor[1, 0, 0]]}]}], StyleBox["]", FontColor->RGBColor[1, 0, 0]]}]}], "}"}], ",", "\[IndentingNewLine]", RowBox[{"{", RowBox[{"hv", ",", "y"}], "}"}], ",", "\[IndentingNewLine]", RowBox[{"{", RowBox[{"t", ",", RowBox[{"tf", "=", "60"}]}], "}"}], ",", RowBox[{"DiscreteVariables", "\[Rule]", RowBox[{"{", RowBox[{"f", ",", RowBox[{"Element", "[", RowBox[{"c", ",", "Integers"}], "]"}]}], "}"}]}]}], "]"}]}], ";"}]}]], "Input", CellChangeTimes->{{3.5840465517239857`*^9, 3.584046553652096*^9}, { 3.58404658676399*^9, 3.584046666331541*^9}, {3.584046699606444*^9, 3.584046700973522*^9}, {3.584046789333576*^9, 3.5840468302359157`*^9}, 3.5840468968137236`*^9, {3.5840473944631877`*^9, 3.584047434180459*^9}, 3.5840501976065187`*^9, {3.5840521274649*^9, 3.584052130660083*^9}, 3.5840521916375704`*^9, {3.584052426245989*^9, 3.5840524747897654`*^9}, { 3.5840531454071226`*^9, 3.5840531598889513`*^9}, {3.58405328277598*^9, 3.584053325752438*^9}, {3.5840533673058147`*^9, 3.5840533813936205`*^9}, { 3.5840535304661465`*^9, 3.5840535611379013`*^9}, 3.584053670809174*^9, { 3.5840537094013815`*^9, 3.58405372633135*^9}, {3.5840538215097933`*^9, 3.584053854078656*^9}, {3.5841239525087385`*^9, 3.5841240332433567`*^9}, { 3.5841240827881904`*^9, 3.5841240841572685`*^9}, {3.584124767709366*^9, 3.584124797019042*^9}, {3.584124827701797*^9, 3.5841248423906374`*^9}, { 3.584124906302293*^9, 3.584124937012049*^9}, {3.5881044180387564`*^9, 3.58810441863879*^9}, {3.588105005318347*^9, 3.5881050524680433`*^9}, { 3.6157568012273083`*^9, 3.6157568057933545`*^9}}], Cell[BoxData[ RowBox[{ RowBox[{"(*", "Prevalence", " ", "*)"}], RowBox[{ RowBox[{ RowBox[{"DpS", "=", RowBox[{"DPS", "[", RowBox[{"n1", ",", "d1", ",", "q1"}], "]"}]}], ";"}], "\[IndentingNewLine]", RowBox[{"(*", RowBox[{"Prevalence", " ", "1"}], "*)"}], RowBox[{ RowBox[{"Dp1", "=", RowBox[{"DPS", "[", RowBox[{"n1", ",", "d1", ",", "q2"}], "]"}]}], ";"}], "\n", RowBox[{"GPa", "[", RowBox[{ RowBox[{"{", RowBox[{"cSh", ",", "ch1"}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"DpS", ".", RowBox[{"Rest", "@", "cSh"}]}], ",", RowBox[{"Dp1", ".", RowBox[{"Rest", "@", "ch1"}]}]}], "}"}], ",", RowBox[{"{", RowBox[{"cSy", ",", "cy1"}], "}"}], ",", "tf"}], "]"}]}]}]], "Input", CellChangeTimes->{3.6157517531496453`*^9}] }, Closed]] }, Open ]] }, Open ]] }, Open ]] }, WindowToolbars->"EditBar", WindowSize->{902, 975}, WindowMargins->{{122, Automatic}, {Automatic, 28}}, ShowSelection->True, FrontEndVersion->"10.0 for Microsoft Windows (64-bit) (July 1, 2014)", StyleDefinitions->"Default.nb" ] (* End of Notebook Content *) (* Internal cache information *) (*CellTagsOutline CellTagsIndex->{ "General"->{ Cell[2620, 64, 3388, 75, 172, "Input", CellTags->"General"], Cell[86942, 2224, 5602, 145, 292, "Input", CellTags->{"General", "Macd control"}]}, "Plot"->{ Cell[6203, 148, 3199, 79, 212, "Input", CellTags->"Plot"]}, "Macd code"->{ Cell[9841, 239, 5327, 141, 296, "Input", CellTags->{"Macd code", "Breakpoint"}]}, "Breakpoint"->{ Cell[9841, 239, 5327, 141, 296, "Input", CellTags->{"Macd code", "Breakpoint"}]}, "SWB"->{ Cell[15441, 390, 10547, 285, 632, "Input", CellTags->"SWB"]}, "Macd control"->{ Cell[86942, 2224, 5602, 145, 292, "Input", CellTags->{"General", "Macd control"}]}, "SWB control"->{ Cell[110313, 2773, 9186, 251, 454, "Input", CellTags->"SWB control"]} } *) (*CellTagsIndex CellTagsIndex->{ {"General", 139082, 3508}, {"Plot", 139248, 3513}, {"Macd code", 139329, 3516}, {"Breakpoint", 139433, 3519}, {"SWB", 139530, 3522}, {"Macd control", 139616, 3525}, {"SWB control", 139723, 3528} } *) (*NotebookFileOutline Notebook[{ Cell[CellGroupData[{ Cell[579, 22, 321, 4, 101, "Title"], Cell[903, 28, 164, 2, 56, "Subtitle"], Cell[1070, 32, 390, 8, 87, "Text"], Cell[CellGroupData[{ Cell[1485, 44, 733, 10, 70, "Section"], Cell[CellGroupData[{ Cell[2243, 58, 374, 4, 49, "Subsection"], Cell[2620, 64, 3388, 75, 172, "Input", CellTags->"General"] }, Closed]], Cell[CellGroupData[{ Cell[6045, 144, 155, 2, 41, "Subsection"], Cell[6203, 148, 3199, 79, 212, "Input", CellTags->"Plot"] }, Closed]], Cell[CellGroupData[{ Cell[9439, 232, 399, 5, 41, "Subsection"], Cell[9841, 239, 5327, 141, 296, "Input", CellTags->{"Macd code", "Breakpoint"}] }, Closed]], Cell[CellGroupData[{ Cell[15205, 385, 233, 3, 41, "Subsection"], Cell[15441, 390, 10547, 285, 632, "Input", CellTags->"SWB"] }, Closed]] }, Open ]], Cell[CellGroupData[{ Cell[26037, 681, 268, 3, 70, "Section"], Cell[26308, 686, 1909, 55, 165, "Input"], Cell[CellGroupData[{ Cell[28242, 745, 161, 2, 49, "Subsection"], Cell[28406, 749, 2047, 52, 92, "Input"], Cell[30456, 803, 2262, 49, 92, "Input"], Cell[32721, 854, 1727, 42, 112, "Input"], Cell[34451, 898, 1726, 39, 92, "Input"] }, Closed]] }, Closed]], Cell[CellGroupData[{ Cell[36226, 943, 509, 7, 56, "Section"], Cell[CellGroupData[{ Cell[36760, 954, 303, 4, 49, "Subsection"], Cell[37066, 960, 1442, 37, 72, "Input"] }, Closed]], Cell[CellGroupData[{ Cell[38545, 1002, 947, 26, 41, "Subsection"], Cell[39495, 1030, 4498, 107, 164, "Input"], Cell[43996, 1139, 1919, 50, 112, "Input"], Cell[CellGroupData[{ Cell[45940, 1193, 535, 9, 39, "Subsubsection"], Cell[46478, 1204, 3483, 94, 212, "Input"], Cell[49964, 1300, 2537, 63, 179, "Input"] }, Open ]] }, Closed]] }, Open ]], Cell[CellGroupData[{ Cell[52562, 1370, 425, 5, 70, "Section"], Cell[CellGroupData[{ Cell[53012, 1379, 341, 4, 49, "Subsection"], Cell[53356, 1385, 1602, 37, 72, "Input"], Cell[54961, 1424, 2296, 53, 92, "Input"] }, Closed]], Cell[CellGroupData[{ Cell[57294, 1482, 531, 7, 41, "Subsection"], Cell[57828, 1491, 3512, 74, 92, "Input"], Cell[CellGroupData[{ Cell[61365, 1569, 379, 5, 39, "Subsubsection"], Cell[61747, 1576, 2291, 58, 132, "Input"], Cell[64041, 1636, 2260, 58, 172, "Input"] }, Open ]], Cell[CellGroupData[{ Cell[66338, 1699, 102, 1, 39, "Subsubsection"], Cell[66443, 1702, 3876, 98, 270, "Input"] }, Open ]] }, Closed]], Cell[CellGroupData[{ Cell[70368, 1806, 142, 2, 41, "Subsection"], Cell[70513, 1810, 7068, 151, 292, "Input"], Cell[CellGroupData[{ Cell[77606, 1965, 507, 11, 39, "Subsubsection"], Cell[78116, 1978, 3426, 99, 216, "Input"], Cell[81545, 2079, 1702, 48, 113, "Input"], Cell[83250, 2129, 2227, 56, 132, "Input"], Cell[85480, 2187, 271, 6, 31, "Input"] }, Closed]] }, Closed]] }, Open ]], Cell[CellGroupData[{ Cell[85812, 2200, 778, 10, 70, "Section"], Cell[CellGroupData[{ Cell[86615, 2214, 99, 1, 49, "Subsection"], Cell[CellGroupData[{ Cell[86739, 2219, 200, 3, 39, "Subsubsection"], Cell[86942, 2224, 5602, 145, 292, "Input", CellTags->{"General", "Macd control"}] }, Closed]], Cell[CellGroupData[{ Cell[92581, 2374, 678, 9, 33, "Subsubsection"], Cell[93262, 2385, 3103, 61, 112, "Input"] }, Closed]], Cell[CellGroupData[{ Cell[96402, 2451, 310, 4, 33, "Subsubsection"], Cell[96715, 2457, 2866, 56, 112, "Input"], Cell[99584, 2515, 2780, 64, 112, "Input"], Cell[102367, 2581, 2327, 51, 72, "Input"] }, Closed]] }, Open ]], Cell[CellGroupData[{ Cell[104743, 2638, 349, 5, 49, "Subsection"], Cell[CellGroupData[{ Cell[105117, 2647, 98, 1, 39, "Subsubsection"], Cell[105218, 2650, 5092, 121, 303, "Input"], Cell[110313, 2773, 9186, 251, 454, "Input", CellTags->"SWB control"] }, Closed]], Cell[CellGroupData[{ Cell[119536, 3029, 273, 3, 33, "Subsubsection"], Cell[119812, 3034, 2725, 64, 172, "Input"], Cell[122540, 3100, 1598, 48, 112, "Input"] }, Closed]], Cell[CellGroupData[{ Cell[124175, 3153, 331, 4, 33, "Subsubsection"], Cell[124509, 3159, 1999, 42, 92, "Input"], Cell[126511, 3203, 2957, 66, 112, "Input"], Cell[129471, 3271, 2329, 49, 92, "Input"] }, Closed]], Cell[CellGroupData[{ Cell[131837, 3325, 442, 7, 33, "Subsubsection"], Cell[132282, 3334, 3098, 71, 92, "Input"], Cell[135383, 3407, 2447, 54, 92, "Input"], Cell[137833, 3463, 858, 27, 72, "Input"] }, Closed]] }, Open ]] }, Open ]] }, Open ]] } ] *) (* End of internal cache information *)