# Mat375 Models

These models and simulations have been tagged “Mat375”.

This model illustrates predator prey interactions using real-life data of wolf and moose populations on the Isle Royale. It was "cloned" from a model that InsightMaker provides to its users, at
https://insightmaker.com/insight/2068/Isle-Royale-Predator-Prey-Interactions
Thanks Scott Fortmann-Roe.

I've created a Mathematica file that replicates the model, at
http://www.nku.edu/~longa/classes/2018spring/mat375/mathematica/Moose-n-Wolf-InsightMaker.nb

It allows one to experiment with adjusting the initial number of moose and wolves on the island.

I used steepest descent in Mathematica to optimize the parameters, with my objective data being the ratio of wolves to moose. You can try my (admittedly) kludgy code, at
http://www.nku.edu/~longa/classes/2018spring/mat375/mathematica/Moose-n-Wolf-InsightMaker-BestFit.nb

{WolfBirthRateFactorStart,
WolfDeathRateStart,
MooseBirthRateStart,
MooseDeathRateFactorStart,
moStart,
woStart} =
{0.000267409,
0.239821,
0.269755,
0.0113679,
591,
23.};

Galla age distribution model
This is an example of an SIR (Susceptible, Infected, Recovered) model that has been re-parameterized down to the bare minimum, to illustrated the dynamics possible with the fewest number of parameters.

We're rescaled this SIR model, so that time is given in infection rate-appropriate time units, "rates" are now ratios of rates (with infectivity rate in the denominator), and populations are considered proportions (unfortunately InsightMaker doesn't function properly if I give them all values from 0 to 1, which sum to 1 -- so, at the moment, I give them values that sum to 100, and consider the results percentages).

The new display includes the asymptotics: the three sub-populations will tend to fixed values as time goes to infinity; the infected population goes to zero if the recovery rate is greater than the infectivity rate -- i.e., the disease dies out.

Note the use of a "ghost" stock (for Total Population), which I think is a pretty cool idea. It cuts down on the number of arcs in the model graph.

A comparable model in Mathematica is available at
http://www.nku.edu/~longa/classes/2018spring/mat375/mathematica/SIRModel-rescaled.nb

This is an example from Cushing's book An Introduction to Structured Population Dynamics. ​

The parameters initially included reproduce the bifurcation results on p. 39 of Cushing's manuscript.
The tuning parameter is b, the birthrate.

p. 37: The LPA flour beetle model.

The bifurcation diagram for parameter b is on page 39;
The bifurcation diagram for mu adult is on p. 59;
The bifurcation diagram for C pa is on p. 60.

Andy Long

This is an example of an SIR (Susceptible, Infected, Recovered) model that has been re-parameterized down to the bare minimum, to illustrated the dynamics possible with the fewest number of parameters.

We're rescaled this SIR model, so that time is given in infection rate-appropriate time units, "rates" are now ratios of rates (with infectivity rate in the denominator), and populations are considered proportions (unfortunately InsightMaker doesn't function properly if I give them all values from 0 to 1, which sum to 1 -- so, at the moment, I give them values that sum to 100, and consider the results percentages).

The new display includes the asymptotics: the three sub-populations will tend to fixed values as time goes to infinity; the infected population goes to zero if the recovery rate is greater than the infectivity rate -- i.e., the disease dies out.

Note the use of a "ghost" stock (for Total Population), which I think is a pretty cool idea. It cuts down on the number of arcs in the model graph.

A comparable model in Mathematica is available at
http://www.nku.edu/~longa/classes/2018spring/mat375/mathematica/SIRModel-rescaled.nb

The basic model of Modelling the Canada lynx and snowshoe hare population cycle: The role of specialist predators (Tyson, et al.) demonstrates logistic growth in prey, and in predator (with prey dependence for carrying capacity). But interestingly, one possibility is limit cycles, which mimic the cycling of the populations in nature.

The differential equations for the population of hare (x) is

x'(t) = rx(1-x/K)
- gamma x^2/(x^2+eta^2)
- alpha y x/(x+mu)

where K is the logistic carrying capacity of the prey (hare), in the absence of predation; the second term is a "generalist predation" term;  and the third term is the "specialist predation" (in the limit as the prey gets big, this becomes simply proportional to y (the lynx population)).

The differential equations for the population of lynx (y) is

y'(t) = sy(1- qy/x) = sy - sqy^2/x

for the predator (lynx), which is essentially logistic growth. Its growth term suggests exponential growth, but there is a loss term of the form sqy^2/x -- loss is proportional to population (crowding), and inversely proportional to prey density. As the hare population goes to zero, so shall the lynx....

As one can see, the prey density won't change if y=x/q. If the prey density were not changing at the same time, the system would be at equilibrium.

In this InsightMaker model, I scaled the second equation by multiplying by q, then replace y by w=qy throughout both equations. This requires a slight change in the prey equation -- alpha replaced by the ratio of alpha/q.  (I used my favorite mathematical trick, of multiplying by the appropriate form of 1!)

So what we're really looking at here is the system

x'(t) = rx(1-x/K)
- gamma x^2/(x^2+eta^2)
- alpha/q w x/(x+mu)
w'(t) = sw(1- w/x)

where w(t)=qy(t).

Tyson, et al. took q to be about 212 for hare and lynx -- so that it requires about 212 hare to allow for one lynx to survive at "equilibrium".

However, when alpha -- the hares/lynx/year -- gets sufficiently large (e.g. 1867 -- and that does seem like a lot of hares per lynx per year...:), limit cycles develop (rather than a stable equilibrium). This means that the populations oscillate about the equilibrium values, rather than stabilize at those values.

Author: Andy Long, Northern Kentucky University (2020)

Reference: Tyson, Rebecca, Sheena Haines,  Karen Hodges. Modelling the Canada lynx and snowshoe hare population cycle: The role of specialist predators. Theoretical Ecology. 3, 97–111 (2010). https://doi.org/10.1007/s12080-009-0057-1

Resource: A comparable Mathematica model can be found at  http://ceadserv1.nku.edu/longa//classes/mat375/days/Mathematica/BasicModel.nb,
which allows one to experiment a little more easily than one can with this InsightMaker model.
This is an introductory example from Olinick's book An Introduction to Mathematical Models in the Social and Life Sciences. ​

Next up: and SIR, and his interesting model of female birth weights.
This model illustrates predator prey interactions using real-life data of wolf and moose populations on the Isle Royale.

We incorporate logistic growth into the moose dynamics, and we replace the death flow of the moose with a kill rate modeled from the kill rate data found on the Isle Royale website.

Thanks to Jacob Englert for the model if-then-else structure.

Wolf Death Rate = 0.15
Wolf Birth Rate = 0.0187963
Moose Birth Rate = 0.4
Carrying Capacity = 2000
Initial Moose: 563
Initial Wolves: 20

I used RK-4 with step-size 0.1, from 1959 for 60 years.

The moose birth flow is logistic, MBR*M*(1-M/K)
Moose death flow is Kill Rate (in Moose/Year)
Wolf birth flow is WBR*Kill Rate (in Wolves/Year)
Wolf death flow is WDR*W

This is an introductory example from Olinick's book An Introduction to Mathematical Models in the Social and Life Sciences. ​

Next up: and SIR, and his interesting model of female birth weights.
This is an example of an SIR (Susceptible, Infected, Recovered) model that has been re-parameterized down to the bare minimum, to illustrated the dynamics possible with the fewest number of parameters.

We're rescaled this SIR model, so that time is given in infection rate-appropriate time units, "rates" are now ratios of rates (with infectivity rate in the denominator), and populations are considered proportions (unfortunately InsightMaker doesn't function properly if I give them all values from 0 to 1, which sum to 1 -- so, at the moment, I give them values that sum to 100, and consider the results percentages).

The new display includes the asymptotics: the three sub-populations will tend to fixed values as time goes to infinity; the infected population goes to zero if the recovery rate is greater than the infectivity rate -- i.e., the disease dies out.

Note the use of a "ghost" stock (for Total Population), which I think is a pretty cool idea. It cuts down on the number of arcs in the model graph.

A comparable model in Mathematica is available at
http://www.nku.edu/~longa/classes/2018spring/mat375/mathematica/SIRModel-rescaled.nb

This is an example from Cushing's book An Introduction to Structured Population Dynamics. ​

The parameters initially included reproduce the bifurcation results on p. 39 of Cushing's manuscript.
The tuning parameter is b, the birthrate.

p. 37: The LPA flour beetle model.

The bifurcation diagram for parameter b is on page 39;
The bifurcation diagram for mu adult is on p. 59;
The bifurcation diagram for C pa is on p. 60.

Andy Long

This model illustrates predator prey interactions using real-life data of wolf and moose populations on the Isle Royale. It was "cloned" from a model that InsightMaker provides to its users, at
https://insightmaker.com/insight/2068/Isle-Royale-Predator-Prey-Interactions
Thanks Scott Fortmann-Roe.

I've created a Mathematica file that replicates the model, at
http://www.nku.edu/~longa/classes/2018spring/mat375/mathematica/Moose-n-Wolf-InsightMaker.nb

It allows one to experiment with adjusting the initial number of moose and wolves on the island.

I used steepest descent in Mathematica to optimize the parameters, with my objective data being the ratio of wolves to moose. You can try my (admittedly) kludgy code, at
http://www.nku.edu/~longa/classes/2018spring/mat375/mathematica/Moose-n-Wolf-InsightMaker-BestFit.nb

{WolfBirthRateFactorStart,
WolfDeathRateStart,
MooseBirthRateStart,
MooseDeathRateFactorStart,
moStart,
woStart} =
{0.000267409,
0.239821,
0.269755,
0.0113679,
591,
23.};

Clone of Bio103 Predator-Prey Model ("Lotka'Volterra")
Thanks to Insight Author: John Petersen

Edits by Andy Long

Everything that follows the dashes was created by John Petersen (or at least came from his Insight model). I just wanted to make a few comments.

We are looking at Hare and Lynx, of course. Clone this insight, and change the names.

Then read the text below, to get acquainted with one of the most important and well-known examples of a simple system of differential equations in all of mathematics.

http://www.nku.edu/~longa/classes/mat375/mathematica/Lotka-Volterra.nb
------------------------------------------------------------

Dynamic simulation modelers are particularly interested in understanding and being able to distinguish between the behavior of stocks and flows that result from internal interactions and those that result from external forces acting on a system.

For some time modelers have been particularly interested in internal interactions that result in stable oscillations in the absence of any external forces acting on a system.

The model in this last scenario was independently developed by Alfred Lotka (1924) and Vito Volterra (1926).  Lotka was interested in understanding internal dynamics that might explain oscillations in moth and butterfly populations and the parasitoids that attack them.  Volterra was interested in explaining an increase in coastal populations of predatory fish and a decrease in their prey that was observed during World War I when human fishing pressures on the predator species declined.

Both discovered that a relatively simple model is capable of producing the cyclical behaviors they observed.

Since that time, several researchers have been able to reproduce the modeling dynamics in simple experimental systems consisting of only predators and prey.  It is now generally recognized that the model world that Lotka and Volterra produced is too simple to explain the complexity of most predator-prey dynamics in nature.  And yet, the model significantly advanced our understanding of the critical role of feedback in predator-prey interactions and in feeding relationships that result in community dynamics.

The Lotka–Volterra model makes a number of assumptions about the environment and evolution of the predator and prey populations:

1. The prey population finds ample food at all times.
2. The food supply of the predator population depends entirely on the size of the prey population.
3. The rate of change of population is proportional to its size.
4. During the process, the environment does not change in favour of one species and genetic adaptation is inconsequential.
5. Predators have limitless appetite.

As differential equations are used, the solution is deterministic and continuous. This, in turn, implies that the generations of both the predator and prey are continually overlapping.[23]

Prey
When multiplied out, the prey equation becomes
dx/dtαx - βxy
The prey are assumed to have an unlimited food supply, and to reproduce exponentially unless subject to predation; this exponential growth is represented in the equation above by the term αx. The rate of predation upon the prey is assumed to be proportional to the rate at which the predators and the prey meet; this is represented above by βxy. If either x or y is zero then there can be no predation.

With these two terms the equation above can be interpreted as: the change in the prey's numbers is given by its own growth minus the rate at which it is preyed upon.

Predators

The predator equation becomes

dy/dt =  -

In this equation, {\displaystyle \displaystyle \delta xy} represents the growth of the predator population. (Note the similarity to the predation rate; however, a different constant is used as the rate at which the predator population grows is not necessarily equal to the rate at which it consumes the prey). {\displaystyle \displaystyle \gamma y} represents the loss rate of the predators due to either natural death or emigration; it leads to an exponential decay in the absence of prey.

Hence the equation expresses the change in the predator population as growth fueled by the food supply, minus natural death.

This is an example from Cushing's book An Introduction to Structured Population Dynamics. ​

The parameters initially included reproduce the bifurcation results on p. 39 of Cushing's manuscript.
The tuning parameter is b, the birthrate.

p. 37: The LPA flour beetle model.

The bifurcation diagram for parameter b is on page 39;
The bifurcation diagram for mu adult is on p. 59;
The bifurcation diagram for C pa is on p. 60.

Andy Long

Clone of Bio103 Predator-Prey Model ("Lotka'Volterra")
Thanks to Insight Author: John Petersen

Edits by Andy Long

Everything that follows the dashes was created by John Petersen (or at least came from his Insight model). I just wanted to make a few comments.

We are looking at Hare and Lynx, of course. Clone this insight, and change the names.

Then read the text below, to get acquainted with one of the most important and well-known examples of a simple system of differential equations in all of mathematics.

http://www.nku.edu/~longa/classes/mat375/mathematica/Lotka-Volterra.nb
------------------------------------------------------------

Dynamic simulation modelers are particularly interested in understanding and being able to distinguish between the behavior of stocks and flows that result from internal interactions and those that result from external forces acting on a system.

For some time modelers have been particularly interested in internal interactions that result in stable oscillations in the absence of any external forces acting on a system.

The model in this last scenario was independently developed by Alfred Lotka (1924) and Vito Volterra (1926).  Lotka was interested in understanding internal dynamics that might explain oscillations in moth and butterfly populations and the parasitoids that attack them.  Volterra was interested in explaining an increase in coastal populations of predatory fish and a decrease in their prey that was observed during World War I when human fishing pressures on the predator species declined.

Both discovered that a relatively simple model is capable of producing the cyclical behaviors they observed.

Since that time, several researchers have been able to reproduce the modeling dynamics in simple experimental systems consisting of only predators and prey.  It is now generally recognized that the model world that Lotka and Volterra produced is too simple to explain the complexity of most predator-prey dynamics in nature.  And yet, the model significantly advanced our understanding of the critical role of feedback in predator-prey interactions and in feeding relationships that result in community dynamics.

The Lotka–Volterra model makes a number of assumptions about the environment and evolution of the predator and prey populations:

1. The prey population finds ample food at all times.
2. The food supply of the predator population depends entirely on the size of the prey population.
3. The rate of change of population is proportional to its size.
4. During the process, the environment does not change in favour of one species and genetic adaptation is inconsequential.
5. Predators have limitless appetite.

As differential equations are used, the solution is deterministic and continuous. This, in turn, implies that the generations of both the predator and prey are continually overlapping.[23]

Prey
When multiplied out, the prey equation becomes
dx/dtαx - βxy
The prey are assumed to have an unlimited food supply, and to reproduce exponentially unless subject to predation; this exponential growth is represented in the equation above by the term αx. The rate of predation upon the prey is assumed to be proportional to the rate at which the predators and the prey meet; this is represented above by βxy. If either x or y is zero then there can be no predation.

With these two terms the equation above can be interpreted as: the change in the prey's numbers is given by its own growth minus the rate at which it is preyed upon.

Predators

The predator equation becomes

dy/dt =  -

In this equation, {\displaystyle \displaystyle \delta xy} represents the growth of the predator population. (Note the similarity to the predation rate; however, a different constant is used as the rate at which the predator population grows is not necessarily equal to the rate at which it consumes the prey). {\displaystyle \displaystyle \gamma y} represents the loss rate of the predators due to either natural death or emigration; it leads to an exponential decay in the absence of prey.

Hence the equation expresses the change in the predator population as growth fueled by the food supply, minus natural death.

This is an example from Cushing's book An Introduction to Structured Population Dynamics. ​

The parameters initially included reproduce the bifurcation results on p. 39 of Cushing's manuscript.
The tuning parameter is b, the birthrate.

p. 37: The LPA flour beetle model.

The bifurcation diagram for parameter b is on page 39;
The bifurcation diagram for mu adult is on p. 59;
The bifurcation diagram for C pa is on p. 60.

Andy Long

This is a simple example of (part of a) simple SIR (Susceptible, Infected, Recovered) model, suggested by De Vries, et al. in A Course in Mathematical Biology.

They wanted to illustrate the comparative behavior of differential equations and discrete difference equations. We know that differential equations are generally solved numerically by discretizing them, so that the comparison is a little bit rigged....

A comparable model in Mathematica is available at
http://www.nku.edu/~longa/classes/2018spring/mat375/mathematica/SIRModel-w-discrete-version.nb

This is an example from Cushing's book An Introduction to Structured Population Dynamics. ​

The parameters initially included reproduce the bifurcation results on p. 39 of Cushing's manuscript.
The tuning parameter is b, the birthrate.

p. 37: The LPA flour beetle model.

The bifurcation diagram for parameter b is on page 39;
The bifurcation diagram for mu adult is on p. 59;
The bifurcation diagram for C pa is on p. 60.

Andy Long

This is an example of an SIR (Susceptible, Infected, Recovered) model that has been re-parameterized down to the bare minimum, to illustrated the dynamics possible with the fewest number of parameters.

We're rescaled this SIR model, so that time is given in infection rate-appropriate time units, "rates" are now ratios of rates (with infectivity rate in the denominator), and populations are considered proportions (unfortunately InsightMaker doesn't function properly if I give them all values from 0 to 1, which sum to 1 -- so, at the moment, I give them values that sum to 100, and consider the results percentages).

The new display includes the asymptotics: the three sub-populations will tend to fixed values as time goes to infinity; the infected population goes to zero if the recovery rate is greater than the infectivity rate -- i.e., the disease dies out.

Note the use of a "ghost" stock (for Total Population), which I think is a pretty cool idea. It cuts down on the number of arcs in the model graph.

A comparable model in Mathematica is available at
http://www.nku.edu/~longa/classes/2018spring/mat375/mathematica/SIRModel-rescaled.nb

This is an introductory example from Olinick's book An Introduction to Mathematical Models in the Social and Life Sciences. ​

Galla Age Distribution Model.

Thanks Mike! Interesting examples, as always....
Andy Long

Clone of Bio103 Predator-Prey Model ("Lotka'Volterra")
Thanks to Insight Author: John Petersen

Edits by Andy Long

Everything that follows the dashes was created by John Petersen (or at least came from his Insight model). I just wanted to make a few comments.

We are looking at Hare and Lynx, of course. Clone this insight, and change the names.

Then read the text below, to get acquainted with one of the most important and well-known examples of a simple system of differential equations in all of mathematics.

http://www.nku.edu/~longa/classes/mat375/mathematica/Lotka-Volterra.nb
------------------------------------------------------------

Dynamic simulation modelers are particularly interested in understanding and being able to distinguish between the behavior of stocks and flows that result from internal interactions and those that result from external forces acting on a system.

For some time modelers have been particularly interested in internal interactions that result in stable oscillations in the absence of any external forces acting on a system.

The model in this last scenario was independently developed by Alfred Lotka (1924) and Vito Volterra (1926).  Lotka was interested in understanding internal dynamics that might explain oscillations in moth and butterfly populations and the parasitoids that attack them.  Volterra was interested in explaining an increase in coastal populations of predatory fish and a decrease in their prey that was observed during World War I when human fishing pressures on the predator species declined.

Both discovered that a relatively simple model is capable of producing the cyclical behaviors they observed.

Since that time, several researchers have been able to reproduce the modeling dynamics in simple experimental systems consisting of only predators and prey.  It is now generally recognized that the model world that Lotka and Volterra produced is too simple to explain the complexity of most predator-prey dynamics in nature.  And yet, the model significantly advanced our understanding of the critical role of feedback in predator-prey interactions and in feeding relationships that result in community dynamics.

The Lotka–Volterra model makes a number of assumptions about the environment and evolution of the predator and prey populations:

1. The prey population finds ample food at all times.
2. The food supply of the predator population depends entirely on the size of the prey population.
3. The rate of change of population is proportional to its size.
4. During the process, the environment does not change in favour of one species and genetic adaptation is inconsequential.
5. Predators have limitless appetite.

As differential equations are used, the solution is deterministic and continuous. This, in turn, implies that the generations of both the predator and prey are continually overlapping.[23]

Prey
When multiplied out, the prey equation becomes
dx/dtαx - βxy
The prey are assumed to have an unlimited food supply, and to reproduce exponentially unless subject to predation; this exponential growth is represented in the equation above by the term αx. The rate of predation upon the prey is assumed to be proportional to the rate at which the predators and the prey meet; this is represented above by βxy. If either x or y is zero then there can be no predation.

With these two terms the equation above can be interpreted as: the change in the prey's numbers is given by its own growth minus the rate at which it is preyed upon.

Predators

The predator equation becomes

dy/dt =  -

In this equation, {\displaystyle \displaystyle \delta xy} represents the growth of the predator population. (Note the similarity to the predation rate; however, a different constant is used as the rate at which the predator population grows is not necessarily equal to the rate at which it consumes the prey). {\displaystyle \displaystyle \gamma y} represents the loss rate of the predators due to either natural death or emigration; it leads to an exponential decay in the absence of prey.

Hence the equation expresses the change in the predator population as growth fueled by the food supply, minus natural death.

This is an example of an SIR (Susceptible, Infected, Recovered) model that has been re-parameterized down to the bare minimum, to illustrated the dynamics possible with the fewest number of parameters.

We're rescaled this SIR model, so that time is given in infection rate-appropriate time units, "rates" are now ratios of rates (with infectivity rate in the denominator), and populations are considered proportions (unfortunately InsightMaker doesn't function properly if I give them all values from 0 to 1, which sum to 1 -- so, at the moment, I give them values that sum to 100, and consider the results percentages).

The new display includes the asymptotics: the three sub-populations will tend to fixed values as time goes to infinity; the infected population goes to zero if the recovery rate is greater than the infectivity rate -- i.e., the disease dies out.

Note the use of a "ghost" stock (for Total Population), which I think is a pretty cool idea. It cuts down on the number of arcs in the model graph.

A comparable model in Mathematica is available at
http://www.nku.edu/~longa/classes/2018spring/mat375/mathematica/SIRModel-rescaled.nb

This is an example of an SIR (Susceptible, Infected, Recovered) model that has been re-parameterized down to the bare minimum, to illustrated the dynamics possible with the fewest number of parameters.

We're rescaled this SIR model, so that time is given in infection rate-appropriate time units, "rates" are now ratios of rates (with infectivity rate in the denominator), and populations are considered proportions (unfortunately InsightMaker doesn't function properly if I give them all values from 0 to 1, which sum to 1 -- so, at the moment, I give them values that sum to 100, and consider the results percentages).

The new display includes the asymptotics: the three sub-populations will tend to fixed values as time goes to infinity; the infected population goes to zero if the recovery rate is greater than the infectivity rate -- i.e., the disease dies out.

Note the use of a "ghost" stock (for Total Population), which I think is a pretty cool idea. It cuts down on the number of arcs in the model graph.

A comparable model in Mathematica is available at
http://www.nku.edu/~longa/classes/2018spring/mat375/mathematica/SIRModel-rescaled.nb

This is an example from Cushing's book An Introduction to Structured Population Dynamics. ​

The parameters initially included reproduce the bifurcation results on p. 39 of Cushing's manuscript.
The tuning parameter is b, the birthrate.

p. 37: The LPA flour beetle model.

The bifurcation diagram for parameter b is on page 39;
The bifurcation diagram for mu adult is on p. 59;
The bifurcation diagram for C pa is on p. 60.

Andy Long