EcoStableQ
| EcoStableQ[sol] |
| EcoStableQ[attributes,pops] |
(3)
Basic Examples
(3)
An unforced, continuous-time model — the Rosenzweig-MacArthur predator-prey model:
In[1]:=
Needs["EcoEvo`"];
In[2]:=
SetModel[{Pop[n]{Equationn(1-n/k)-anpn/(n+h),ColorGreen},Pop[p]{Equationp(apn/(n+h)-m),ColorRed},Parameters{an≥0,ap≥0,h≥0,m>0,k>0}}];
Analytical results:
In[3]:=
eq=SolveEcoEq[]
Out[3]=
{n0,p0},{nk,p0},n,p
hm
ap-m
aph(apk-hm-km)
ank
2
(ap-m)
In[4]:=
EcoStableQ[eq〚3〛]
Out[4]=
|
Numerical results:
In[5]:=
an=1;ap=2;h=1;m=1;k=2;
In[6]:=
eq
Out[6]=
{{n0,p0},{n2,p0},{n1,p1}}
In[7]:=
EcoStableQ[eq〚-1〛]
Out[7]=
True
EcoStableQ is in pops.
In[8]:=
EcoStableQ[eq]
Out[8]=
{False,False,True}
———
The trait-based Lotka-Volterra competition model:
In[1]:=
Needs["EcoEvo`"];
In[2]:=
SetModelGuild[n]Equationr[]-Suma,,j.,,Traits{-1≤x≤1},Parameters{σ>0};a[xi_,xj_]:=E^(-1/2*(xi-xj)^2/σ^2);r[x_]:=1-x^2;σ=1/2;
x
i.
x
i.
x
j.
n
j.
n
n
i.
In[3]:=
traits={-0.4,0.4};eq=SolveEcoEq[traits]
x
1
x
2
Solve::ratnz:Solve was unable to solve the system with inexact coefficients. The answer was obtained by solving a corresponding exact system and numericizing the result.
Out[3]=
{{0,0},{0.84,0},{0,0.84},{0.657258,0.657258}}
n
1
n
2
n
1
n
2
n
1
n
2
n
1
n
2
In[4]:=
EcoStableQ[traits,eq]
Out[4]=
{False,False,False,True}
traits and pops can be combined as traitsandpops:
In[5]:=
eeq=FindEcoEvoEq[{-0.4,0.4},{0.7,0.7}]
x
1
x
2
n
1
n
2
Out[5]=
{0.63373,0.63373,-0.340984,0.340984}
n
1
n
2
x
1
x
2
In[6]:=
EcoStableQ[eeq]
Out[6]=
True
———
An unforced discrete-time model — the Ricker equation:
In[1]:=
Needs["EcoEvo`"];
In[2]:=
SetModel[{ModelType"DiscreteTime",Pop[n]{EquationnE^(r(1-n))},Parameters{r}}]
In[3]:=
eq=SolveEcoEq[]
Solve::ifun:Inverse functions are being used by Solve, so some solutions may not be found; use Reduce for complete solution information.
Out[3]=
{{n0},{n1}}
In[4]:=
EcoStableQ[eq]
Out[4]=
,
|
|
In[5]:=
r=1.5;EcoStableQ[eq]
Out[5]=
{False,True}
In[6]:=
r=2.5;EcoStableQ[eq]
Out[6]=
{False,False}
▪