FindMinima

| FindMinima[f,{tmin,tmax}] |

| FindMinima[f] |

| FindMinima[rulelist] |

(3)

Basic Examples

(3)

The Rosenzweig-MacArthur predator-prey model:

Needs["EcoEvo`"];

In[1]:=

SetModel[{Pop[n]{EquationdN,ColorGreen},Pop[p]{EquationdP,ColorRed}}];dN:=n[t](1-n[t]/k)-anp[t]n[t]/(n[t]+h);dP:=p[t](apn[t]/(n[t]+h)-m);

In[2]:=

an=1;ap=2;h=1;m=1;k=4;

In[3]:=

sol=EcoSim[{nk,p0.1},100];PlotDynamics[sol]

In[4]:=

Out[4]=

Look across entire domain:

FindMinima[n/.sol]

In[5]:=

{{9.47682,0.135844},{22.8321,0.149691},{35.96,0.1523},{49.0479,0.152817},{62.1279,0.152921},{75.2065,0.152942},{88.2846,0.152947}}

Out[5]=

Focus on a certain range:

FindMinima[n/.sol,{50,100}]

In[6]:=

{{62.1279,0.152917},{75.2065,0.152939},{88.2846,0.152943}}

Out[6]=

Thread across the rulelist sol:

FindMinima[sol]

In[7]:=

{n{{9.47682,0.135844},{22.8321,0.149691},{35.96,0.1523},{49.0479,0.152817},{62.1279,0.152921},{75.2065,0.152942},{88.2846,0.152947}},p{{13.0114,0.193923},{26.2892,0.214566},{39.4036,0.218466},{52.4888,0.219238},{65.5683,0.219392},{78.6467,0.219422},{91.7248,0.219428}}}

Out[7]=

The Ricker equation:

Needs["EcoEvo`"];

In[1]:=

SetModel[{Pop[n]{Equationn[t]E^(r(1-n[t]))},ModelType"DiscreteTime"}]

In[2]:=

r=2.1;sol=EcoSim[{n0.01},10]

In[3]:=

nTimeSeries

Out[3]=

PlotDynamics[sol]

In[4]:=

Out[4]=

FindMinima[n/.sol]

In[5]:=

{{0,0.01},{4,0.592575},{6,0.609274},{8,0.617834},{10,0.622578}}

Out[5]=

FindMinima[sol]

In[6]:=

{n{{0,0.01},{4,0.592575},{6,0.609274},{8,0.617834},{10,0.622578}}}

Out[6]=

A List:

Needs["EcoEvo`"];

In[1]:=

list={{1,1.1},{2,2},{3,1},{4,2.1}};

In[2]:=

FindMinima[list]

In[3]:=

{{1,1.1},{3,1}}

Out[3]=

FindMinima[list,{2,3}]

In[4]:=

{{3,1}}

Out[4]=

▪