> #Dynamic Models Biology Project > #A full Maple implementation of "Dynamic complexity in predator-prey models framed in difference equations" by J.R. Beddington #et. al. > #Authors: Hrudai Battini, John Hermitt, Julian Jimenez.; Code file: Dr. Z > read "/John/Rutgers/Senior Fall/Dynamic Models/DMB.txt": #Input command for DMB.txt > with(plots); First Written: Nov. 2021 This is DMB.txt, A Maple package to explore Dynamical models in Biology (both discrete and continuous) accompanying the class Dynamical Models in Biology, Rutgers University. Taught by Dr. Z. (Doron Zeilbeger) The most current version is available on WWW at: http://sites.math.rutgers.edu/~zeilberg/tokhniot/DMB.txt . Please report all bugs to: DoronZeil at gmail dot com . For general help, and a list of the MAIN functions, type "Help();". For specific help type "Help(procedure_name);" ------------------------------ For a list of the supporting functions type: Help1(); For help with any of them type: Help(ProcedureName); ------------------------------ For a list of the functions that give examples of Discrete-time dynamical systems (some famous), type: HelpDDM(); For help with any of them type: Help(ProcedureName); ------------------------------ For a list of the functions continuous-time dynamical systems (some famous) type: HelpCDM(); For help with any of them type: Help(ProcedureName); ------------------------------ [animate, animate3d, animatecurve, arrow, changecoords, complexplot, complexplot3d, conformal, conformal3d, contourplot, contourplot3d, coordplot, coordplot3d, densityplot, display, dualaxisplot, fieldplot, fieldplot3d, gradplot, gradplot3d, implicitplot, implicitplot3d, inequal, interactive, interactiveparams, intersectplot, listcontplot, listcontplot3d, listdensityplot, listplot, listplot3d, loglogplot, logplot, matrixplot, multiple, odeplot, pareto, plotcompare, pointplot, pointplot3d, polarplot, polygonplot, polygonplot3d, polyhedra_supported, polyhedraplot, rootlocus, semilogplot, setcolors, setoptions, setoptions3d, shadebetween, spacecurve, sparsematrixplot, surfdata, textplot, textplot3d, tubeplot] ; > #1st item: The original predator prey model by J.R. Beddington > #H(t) = H(t-1)e^(r(1-H(t-1)/K)-aP(t)) > #P(t) = aH(t-1)(1-e^(-aP(t))) ; > r := 0.5; > a := 1; > b := 4; > K:=10; > q :=0.4; > OrbF([H*exp(r*(1-H/K))],[H],[8.6],1000,1005); > OrbF([H*exp(r*(1-H/K)-a*P), q*H*(1-exp(-a*P))],[H,P], [8.6,1.1], 0,30); > > r := 1.8; > OrbF([H*exp(r*(1-H/K))],[H],[8.6],1000,1005); > OrbF([H*exp(r*(1-H/K)-a*P), q*H*(1-exp(-a*P))],[H,P], [8.6,1.1], 0,30); > > r:= 2.2; > OrbF([H*exp(r*(1-H/K))],[H],[8.6],1000,1005); > OrbF([H*exp(r*(1-H/K)-a*P), q*H*(1-exp(-a*P))],[H,P], [8.6,1.1], 0,30); > > r:= 2.522; > OrbF([H*exp(r*(1-H/K))],[H],[8.6],1000,1005); > OrbF([H*exp(r*(1-H/K)-a*P), q*H*(1-exp(-a*P))],[H,P], [8.6,1.1], 0,30); > > r:= 2.653; > OrbF([H*exp(r*(1-H/K))],[H],[8.6],1000,1010); > OrbF([H*exp(r*(1-H/K)-a*P), q*H*(1-exp(-a*P))],[H,P], [8.6,1.1], 0,30); > > r:= 2.8; > OrbF([H*exp(r*(1-H/K))],[H],[8.6],1000,1005); > OrbF([H*exp(r*(1-H/K)-a*P), q*H*(1-exp(-a*P))],[H,P], [8.6,1.1], 0,30); > r := 0.5 a := 1 b := 4 K := 10 q := 0.4 [[9.999999991], [9.999999991], [9.999999991], [9.999999991], [9.999999991], [9.999999991], [9.999999991]] [[8.6, 1.1], [3.070259861, 2.294923472], [0.4375018864, 1.104349009], [0.2338914022, 0.1170008552], [0.3390547128, 0.01033010077], [0.5439615981, 0.0013937764], [0.8715618189, 0.0003030531], [1.375270410, 0.0001056358], [2.116536905, 0.0000581080], [3.138974845, 0.0000491937], [4.423354428, 0.000061766], [5.845480751, 0.000109282], [7.194274649, 0.000255508], [8.275640179, 0.000735184], [9.014181762, 0.002432753], [9.446622286, 0.008761050], [9.626936777, 0.032960338], [9.490183103, 0.124853919], [8.592543846, 0.445560954], [5.904452257, 1.235728431], [2.105926772, 1.675393084], [0.5851226585, 0.6846497946], [0.4724422751, 0.1160258922], [0.6774038098, 0.0207020109], [1.057534319, 0.0055517836], [1.644623668, 0.0023419736], [2.491633271, 0.0015388634], [3.621245042, 0.0015325339], [4.973993882, 0.002218172], [6.380875089, 0.004408379], [7.612968055, 0.011226962], [8.482267024, 0.033997003]] r := 1.8 [[9.999999980], [10.00000002], [9.999999980], [10.00000002], [9.999999980], [10.00000002], [9.999999980]] [[8.6, 1.1], [3.683127308, 2.294923472], [1.157052492, 1.324792747], [1.511063368, 0.3397763076], [4.958215542, 0.1741170768], [10.32378062, 0.316932065], [7.093915573, 1.121657142], [3.898826109, 1.913258681], [1.725692000, 1.329345894], [2.025178157, 0.5075948281], [5.121927226, 0.3224556609], [8.927426950, 0.564706718], [6.156353567, 1.540777972], [2.634156547, 1.935029633], [1.432448509, 0.9014926749], [2.718422686, 0.3403708307], [7.173293563, 0.3136989911], [8.718725510, 0.772595411], [5.070842955, 1.876922179], [1.884821566, 1.717878931], [1.457447100, 0.6186388767], [3.653578101, 0.2689414630], [8.750592986, 0.344623042], [7.763177243, 1.020363339], [4.185626717, 1.985932697], [1.636092767, 1.444455529], [1.739084304, 0.5000721021], [4.665763263, 0.2737409619], [9.268977640, 0.446925894], [6.762084615, 1.336248057], [3.183266687, 1.993922518], [1.478454681, 1.099932875]] r := 2.2 [[4.970594250], [15.02940575], [4.970594250], [15.02940575], [4.970594250], [15.02940575], [4.970594250]] [[8.6, 1.1], [3.895266910, 2.294923472], [1.503626732, 1.401097740], [2.401237887, 0.4532975010], [8.120685361, 0.3500725959], [8.652005815, 0.959420210], [4.459023033, 2.134917224], [1.784302174, 1.572689614], [2.256446674, 0.5656335151], [7.040924797, 0.3899138083], [9.141479667, 0.909362943], [4.447462867, 2.183787101], [1.699110467, 1.578646086], [2.176361554, 0.5394647462], [7.094999091, 0.3629646533], [9.351396862, 0.863855813], [4.546522277, 2.163787588], [1.733842627, 1.609670491], [2.136618092, 0.5548618973], [6.919243004, 0.3639502031], [9.469941287, 0.844353013], [4.573974915, 2.159770243], [1.740788005, 1.618543798], [2.122979928, 0.5583145187], [6.871968666, 0.3633075610], [9.509677432, 0.837356168], [4.585158866, 2.157352475], [1.744969938, 1.621989216], [2.118810245, 0.5601315620], [6.852303753, 0.3634743381], [9.521988910, 0.835277823], [4.588202628, 2.156715413]] r := 2.522 [[2.796703201], [17.20349822], [2.796561137], [17.20324068], [2.796700917], [17.20349408], [2.796563383]] [[8.6, 1.1], [4.074883688, 2.294923472], [1.829848297, 1.465704523], [3.316933803, 0.5629233687], [10.19183316, 0.5711207439], [5.485376110, 1.773819320], [2.906223543, 1.821838937], [2.812478075, 0.9744822477], [6.503085484, 0.7004333814], [7.797204047, 1.310059214], [3.666549902, 2.277394634], [1.857353490, 1.316216556], [3.882625164, 0.5437232150], [10.54435064, 0.6513762371], [4.791908489, 2.018914956], [2.366695047, 1.662218213], [3.078356291, 0.7670764625], [8.190360086, 0.6595456111], [6.684580381, 1.582095036], [3.170398312, 2.124241930], [2.121324900, 1.116584432], [5.065527480, 0.5707245342], [9.936429097, 0.881167056], [4.183186331, 2.327910110], [1.768556245, 1.510131441], [3.114293146, 0.5511663494], [10.19004361, 0.5278387079], [5.729586826, 1.671662418], [3.161286943, 1.861120190], [2.758211461, 1.067884822], [5.888944011, 0.7240472679], [8.051333653, 1.213626040]] r := 2.653 [[4.273403156], [19.52462804], [1.560166936], [14.64180126], [4.273403848], [19.52462760], [1.560167084], [14.64180208], [4.273403156], [19.52462804], [1.560166936], [14.64180126]] [[8.6, 1.1], [4.150306567, 2.294923472], [1.974237799, 1.492833556], [3.730654007, 0.6122230237], [10.67194167, 0.6832404378], [4.509162603, 2.113138413], [2.338926840, 1.585677569], [3.656466883, 0.7439574535], [9.350962052, 0.7675223954], [5.155925336, 2.004241616], [2.511896376, 1.784440064], [3.074652303, 0.8360685892], [8.368025694, 0.6968255519], [6.427304277, 1.679749972], [3.091453634, 2.091648993], [2.386504564, 1.083884240], [6.084873083, 0.6316800617], [9.141358240, 1.139823865], [3.672170016, 2.486905200], [1.636649014, 1.346706728], [3.914709623, 0.4843856427], [12.11910400, 0.6011810626], [3.786354552, 2.190339776], [2.202392033, 1.345096808], [4.541024482, 0.6514548011], [10.07406246, 0.8695392424], [4.140332232, 2.340629316], [1.886487392, 1.496701887], [3.634710935, 0.5856658337], [10.95257885, 0.6444559910], [4.465583014, 2.081217616], [2.419263101, 1.563350264]] r := 2.8 [[5.555077247], [19.28428855], [1.432885016], [15.77587858], [3.130635752], [21.42713455], [0.8737686983]] [[8.6, 1.1], [4.236604840, 2.294923472], [2.143820197, 1.523874386], [4.214139148, 0.6707017360], [10.88934337, 0.8236962793], [3.725019980, 2.444410611], [1.873214634, 1.360709173], [4.676017283, 0.5571098986], [11.89421327, 0.798921300], [3.147948548, 2.617612245], [1.564729785, 1.167288401], [5.167042149, 0.4311082955], [12.99312419, 0.723822955], [2.725147570, 2.677129417], [1.436704349, 1.015106293], [5.725720157, 0.3664378169], [13.13563639, 0.702662117], [2.703882129, 2.652005681], [1.470490309, 1.005292938], [5.862438626, 0.3729531504], [12.86010263, 0.729996726], [2.782373213, 2.665073307], [1.461066181, 1.035494412], [5.666510450, 0.3769253881], [13.07922604, 0.711787936], [2.710285408, 2.664154875], [1.453564996, 1.008596723], [5.803285571, 0.3693622390], [12.98950905, 0.716879879], [2.746149153, 2.658831161], [1.465866739, 1.021534500], [5.757305161, 0.3752372401]] ; > ; > #Item 2:Using Maple to create a function that a user can plug values into to return equations for the Predator-Prey model. > > PRP := proc(H,P,r,a,q,K) > [H*exp(r*(1-H/K)-a*P), q*H*(1-exp(-a*P))]; > end: > print(PRP); > F:= PRP(H,P,0.5,1,0.4,10); > densityplot(F[1],H=0..50,P=0..5,style=patchnogrid,colour="GREEN");#Prey Density Population > densityplot(F[2],H=0..50,P=0..5,style=patchnogrid,colour="RED"); #Predator Density Population proc (H, P, r, a, q, K) [H*exp(r*(1-H/K)-P*a), q*H*(1-exp(-P*a))\ ] end proc F := [H exp(0.5 - 0.05000000000 H - P), 0.4 H (1 - exp(-P))] ; > #Item 3: Real World Modeling of Lanternfly Invasion at Rutgers with no Predator Regulation > #x(n) = a*x(n-1)*40+b*x(n-1)*80-30000*25: Simplified Theoretical Predatory Prey Relationship of Lanterfly Model at Rutgers > a := 0.6; #Percent of Lantern flies that produce 1 egg mass > b := 0.3; #Percent of Lantern flies that produce 2 egg mass > UC:=Orb([a*x*40+b*x*80-300*25],[x],[50000],0,20); #Case of Predator free growth outside of static student population. > > #Self Regulating Prey Population Density > OrbF([H*exp(1.5*(1-H/2000000))],[H],[50000],0,20);#Carrying capcity = 2 million > SG:=OrbF([H*exp(1.5*(1-H/5000000))],[H],[50000],0,20);#Carrying capcity = 5 million > OrbF([H*exp(1.5*(1-H/10000000))],[H],[50000],0,20);#Carrying capcity = 10 million > > V := [seq(x,x=0..20)]; > L:=[]; > L2 := []; > L3 := []; > for z from 1 to 21 by 1 do L:=[op(L),[V[z],UC[z][1]]] od: > for g from 1 to 3 by 1 do L2:=[op(L2),[V[g],UC[g][1]]] od: > > for m from 1 to 21 by 1 do L3:=[op(L3),[V[m],SG[m][1]]] od: > pointplot(L); > pointplot(L2); > pointplot(L3); a := 0.6 b := 0.3 [ [ 6] [ 8] UC := [[50000], [2.3925000 10 ], [1.148325000 10 ], [ 9] [ 11] [ 13] [5.511952500 10 ], [2.645737125 10 ], [1.269953819 10 ], [ 14] [ 16] [ 18] [6.095778331 10 ], [2.925973599 10 ], [1.404467328 10 ], [ 19] [ 21] [ 23] [6.741443174 10 ], [3.235892724 10 ], [1.553228508 10 ], [ 24] [ 26] [ 28] [7.455496838 10 ], [3.578638482 10 ], [1.717746471 10 ], [ 29] [ 31] [ 33] [8.245183061 10 ], [3.957687869 10 ], [1.899690177 10 ], [ 34] [ 36] [ 38]] [9.118512850 10 ], [4.376886168 10 ], [2.100905361 10 ]] [ [ 5] [ 5] [[50000], [2.158368948 10 ], [8.227441971 10 ], [ 6] [ 6] [ 6] [1.989397657 10 ], [2.005279926 10 ], [1.997354832 10 ], [ 6] [ 6] [ 6] [2.001321269 10 ], [1.999339038 10 ], [2.000330400 10 ], [ 6] [ 6] [ 6] [1.999834780 10 ], [2.000082606 10 ], [1.999958697 10 ], [ 6] [ 6] [ 6] [2.000020650 10 ], [1.999989674 10 ], [2.000005162 10 ], [ 6] [ 6] [ 6] [1.999997418 10 ], [2.000001290 10 ], [1.999999354 10 ], [ 6] [ 6] [ 6] [2.000000322 10 ], [1.999999838 10 ], [2.000000082 10 ], [ 6]] [1.999999958 10 ]] [ [ 5] [ 5] SG := [[50000], [2.207482706 10 ], [9.259298947 10 ], [ 6] [ 6] [ 6] [3.143271942 10 ], [5.486457012 10 ], [4.741462300 10 ], [ 6] [ 6] [ 6] [5.123854051 10 ], [4.936964582 10 ], [5.031214015 10 ], [ 6] [ 6] [ 6] [4.984320603 10 ], [5.007821171 10 ], [4.996084839 10 ], [ 6] [ 6] [ 6] [5.001956428 10 ], [4.999021501 10 ], [5.000489179 10 ], [ 6] [ 6] [ 6] [4.999755391 10 ], [5.000122303 10 ], [4.999938847 10 ], [ 6] [ 6] [ 6] [5.000030576 10 ], [4.999984711 10 ], [5.000007646 10 ], [ 6]] [4.999996176 10 ]] [ [ 5] [ 5] [[50000], [2.224101068 10 ], [9.640676704 10 ], [ 6] [ 6] [ 7] [3.738917234 10 ], [9.563545006 10 ], [1.021060335 10 ], [ 6] [ 7] [ 6] [9.893086921 10 ], [1.005302098 10 ], [9.973384925 10 ], [ 7] [ 6] [ 7] [1.001328087 10 ], [9.993352969 10 ], [1.000332186 10 ], [ 6] [ 7] [ 6] [9.998338656 10 ], [1.000083057 10 ], [9.999584685 10 ], [ 7] [ 6] [ 7] [1.000020765 10 ], [9.999896169 10 ], [1.000005192 10 ], [ 6] [ 7] [ 6] [9.999974040 10 ], [1.000001298 10 ], [9.999993510 10 ], [ 7]] [1.000000325 10 ]] V := [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20] L := [] L2 := [] L3 := [] ; > ; > NULL;