MATH564 Homework 3: Population interaction and aging models

Topics

Population interaction

Consider interacting populations of prey and predator

{r,a,m,b}={2.5,0.001,.2,0.1}; (* model parameters *)
PreyDE = x'[t] == r x[t] - a x[t] y[t];
PredDE = y'[t] == -m y[t] + b x[t] y[t];
PreyInit = x[0]==1000;
PredInit = y[0] == 20;
LVmodel = {PreyDE,PredDE,PreyInit,PredInit};

T=100;
sol=NDSolve[LVmodel,{x[t],y[t]},{t,0,10}][[1]]

prey[t_] = x[t] /. sol;
pred[t_] = y[t] /. sol;
Plot[{prey[t],pred[t]},{t,0,1}, Frame->True,GridLines->Automatic,FrameLabel->{"t","x,y"},PlotLegends->"Expressions"]

Phase portrait

Redefine Lotka Volterra as an ordinary ODE for y(x), which gives an implicit analytical solution

ClearAll[m,b,r,a,x,y,x,y,sol];
sol[x_,r_,a_,m_,b_,c_]=(y[x] /. DSolve[{y'[x] == ((-m + b x)/(r-a y[x]))((y[x])/x)},y[x],x][[1,1]] )/. (C[1]) -> c

Build phase portrait.

Plot[Table[sol[x,2.5,0.001,.2,0.1,c],{c,0,10}],{x,0,20},Frame->True,FrameLabel->{"x","y"},GridLines->Automatic]

Manipulate[Plot[Table[sol[x,r,a,m,b,c],{c,0,10}],{x,0,100},Frame->True,FrameLabel->{"x","y"},GridLines->Automatic],{{r,2.5},0.1,4.},{{a,0.001},0,1},{{m,.2},0,1},{{b,0.1},0,1}]

Parametric curve phase portrait

{r,a,m,b}={1,1,1,1}; (*model parameters*)
PreyDE=x'[t]==r x[t]-a x[t] y[t];
PredDE=y'[t]==-m y[t]+b x[t] y[t];
PreyInit=x[0]==1.5;
PredInit=y[0]==0.5;
LVmodel={PreyDE,PredDE,PreyInit,PredInit};
T=10;
sol=NDSolve[LVmodel,{x[t],y[t]},{t,0,T}][[1]];
ParametricPlot[{x[t],y[t]}/. sol,{t,0,T},Frame->True,GridLines->Automatic,FrameLabel->{"x","y"}]

Competition model

SheepDE = x'[t] == x[t]( 3-  x[t]-2y[t]);
CowsDE = y'[t] ==  y[t] (2- x[t]-y[t]);
SInit = x[0]==1000;
CInit = y[0] == 20;
LVmodel = {SheepDE,CowsDE,SInit,CInit};

T=100;
sol=NDSolve[LVmodel,{x[t],y[t]},{t,0,10}][[1]]

sheep[t_] = x[t] /. sol;
cows[t_] = y[t] /. sol;
Plot[{sheep[t],cows[t]},{t,0,1}, Frame->True,GridLines->Automatic,FrameLabel->{"t","x,y"},PlotLegends->"Expressions"]

Three species model (Grass-sheep-wolf)

WolvesDE = x'[t] == x[t]( -1+y[t]);
SheepDE = y'[t] ==  y[t] (-1+2 z[t]-x[t]);
GrassDE = z'[t] ==  z[t] (2- z[t]-y[t]);
WInit = x[0]==0.1;
SInit = y[0] == 0.2;
GInit = z[0] == 0.4;
LVmodel = {WolvesDE,SheepDE,GrassDE,WInit,SInit,GInit};

T=100;
sol=NDSolve[LVmodel,{x[t],y[t],z[t]},{t,0,50}][[1]]

wolves[t_] = x[t] /. sol;
sheep[t_] = y[t] /. sol;
grass[t_] = z[t] /. sol;
Plot[{wolves[t],sheep[t],grass[t]},{t,0,50}, Frame->True,GridLines->Automatic,FrameLabel->{"t","x,y,z"},PlotLegends->"Expressions",PlotRange->All]

Age pyramid diagrams

A wealth of information is available online and can be extracted through queries such as WolframAlpha. Here, a default formatting of the data is returned

WolframAlpha["us population pyramid"]

WolframAlpha["france population pyramid"]

WolframAlpha["somalia population pyramid"]

One can select only a specific part through formatting keywords. Here, “Result” returns the diagram itself as an image

WolframAlpha["us population pyramid","Result"]

The data is also available in various formats, returned as replacement rules

fulldata=WolframAlpha["us population pyramid","DataRules"]

From the above, one can now extract computable data

Length[fulldata]

fulldata[[7]]

popdata=fulldata[[7,2]]

pop=ArrayReshape[Flatten[{popdata[[1;;-3]],{100},popdata[[-2;;]]}],{18,4}]

TableForm[pop]

Leslie matrices

Define a Leslie matrix

L1=DiagonalMatrix[{0.657,0.93,0.93,0.93,0.935,0.935}]

L2=Prepend[L1,{0,0,0,0,0.08,0.28}]

MatrixForm[L2]

L=Transpose[Append[Transpose[L2],{0.42,0,0,0,0,0,0}]]

MatrixForm[L]

MatrixPower[L,10] // MatrixForm

{λ,X}=Eigensystem[L];

λ1=λ[[1]]

X[[1]]

x1=Re[X[[1]]]; x1 = x1/x1[[1]]

Chop[L.x1-λ1 x1]

Problems

Problem 2 starts the transition from simple exercises to more realistic modeling problems. Exercises up to now build familiarity with using mathematical software to solve basic problems (e.g., ODE, ODE system). Modeling is the more realistic activity of using mathematical building blocks to study a problem of interest in biology. In Problem 2 the question is to determine the evolution of various age groups in a population. You can think of this in terms of human populations, but the same concepts apply to various stages of, say, cancerous cells. There is no “right answer” to Problem 2. Rather, full credit is awarded to an insightful study. For instance: are there initial population distributions that do not lead to an equilibrium point?

Problem 1: Discrete population model (1 point)

Exercise 1, p. 159

Problem 2: Discrete population model (3 points)

Question 1, p. 160

Carry out the study suggested in Questions for Thought and Discussion (1) with appropriately chosen parameters. Look up data from three different countries that have predominantly young, middle-aged, elderly populations.

In addition, formulate the ODE system governing the evolution in time for each case. Solve the ODE system and study whether a stable population structure is obtained from various initial conditions.