-
Notifications
You must be signed in to change notification settings - Fork 1
/
Report-B.tex
299 lines (252 loc) · 21.5 KB
/
Report-B.tex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
\documentclass[a4paper,12pt]{article}
\usepackage{enumerate,amsmath,graphicx,float,epstopdf,subcaption}
\graphicspath{ {./} }
\usepackage{verbatim}
\begin{document}
\title{PHY566 Group Project 2 \\
Eco-system: Predator and Prey}
\date{\today}
\author{David Hicks\\ Weiyao Ke \\ Shagun Maheshwari \\ Fan Zhang}
\maketitle
\section{Abstract}
Predator prey models are used to determine behaviors of competitive "species". Any type of loss-win situation is basically a predator prey model in one of its many forms.
These models can be used to describe systems out of the eco-system context. For example, in economics, they are used to predict demand supply models, etc., in the field of public health they may be used to model interactions between infected and healthy populations.
In this paper, the Lotka-Voltera equations were used as a basis to simulate a "predator-prey ecosystem", where, "predator" and "prey" populations were randomly generated and they exhibited the random walk in the ecosystem where the "predator" ate the "prey" and both species "reproduced" similar to how a microbe reproduces, after reaching a set "age" value.
An analysis of the various parameters was also carried out, and an attempt to find a relation between parameters which give rise to stable systems was made.\\
The following is the link to the GitHub account of the work done in this paper: \\
\begin{center}
https://github.com/keweiyao/Project-B-PHY566.git
\end{center}
\section{Introduction to eco-system modelling}
The dynamics of biological systems consisting of one predator and one prey can be described by Lotka-Volterra equations:
\begin{eqnarray*}
\frac{dx}{dt} &=& \alpha x - \beta x y = x(\alpha - \beta y) \\
\frac{dy}{dt} &=& - \gamma y + \delta x y = - y (\gamma - \delta x)
\end{eqnarray*}
Where, x is the number of prey, y is the number of predator, $\frac{dx}{dt}$ and $\frac{dy}{dt}$ represent the growth rates of two populations, and $\alpha, \beta, \gamma$ and $\delta$ are parameters describing the interaction of two species. \\
When the biological system has reached eco-equilibrium, the number of predator and prey will evolve through time like in Fig.~\ref{Fig:evolution}.
\begin{figure}[!htb]
\centering
\includegraphics[width=0.8\textwidth]{./pics/evolution.png}
\caption{}\label{Fig:evolution}
\end{figure}
Where, the peak of the predator population is always $90^{\circ}$ ahead of that of prey population. \\
On the other hand, in mathematical prospect, the L-V equations have two solutions:
\begin{eqnarray*}
\textrm{(i) } x &=& 0, y = 0 \\
\textrm{(ii) } x &=& \frac{\gamma}{\delta}, y = \frac{\alpha}{\beta}
\end{eqnarray*}
Which is, either the two species will distinct, or they will reach a periodic stable situation. And, in the later situation, the evolution of the system doesn't depend on the size of the eco-system, or the initial numbers of two species. It only depends on the behavioral characteristics of the predator and the prey. \\
The result of this model matches with the evolution of our nature roughly. However, it can only simulate the situation when there's only one predator and one prey, it cannot simulate the situation when there are several predators in the eco-system, or several species are competing for one common resources. \\
When, several species are competing for a common resource, the competitive L-V equation can be adopted to modelize the situation:
\begin{eqnarray*}
\frac{dx}{dt} &=& \alpha_1 x (1- (\frac{x + \beta_{xy} y}{K_1})) \\
\frac{dy}{dt} &=& \alpha_2 y (1 - (\frac{y + \beta_{yx} x}{K_2}))
\end{eqnarray*}
The trophic interactions are included to the simulated system. \\
In addition, the generalized L-V equation can be used to model direct competition and trophic relationships between arbitrary number of species. But, in this study, we will just use L-V equation to produce a simple model between wolf and deer. \\
\section{Model description and implementation}
We intend to solve the problem of predator and prey not by the set of coupled differential equation, but by monte-carol simulation of the system. Of course, the simulation must keep the essential features of the L-V equations:
\begin{enumerate}
\item Procreation of deer and wolves when reproduction age is reached.
\item Death of deer and wolves.
\item Wolves feed on deer.
\end{enumerate}
The simulation actually mimics a real time interaction of the two populations on a world of $N \times N$ 2D gird with periodic boundary conditions (equivalent to a torus). Each animal is free to move, feed, procreate and die under certain conditions. Their populations are then tracked as time evolves. Each animal record its previous and presentation location, starving age and reproduction age variables. A $N \times N$ occupation matrix tracks the position of all the animals, with vacant, deer, and wolves labeled by $0, 1$ and $2$ respectively.
Initially, populations of deer and wolves sampled with certain age structure is generated with each of their members occupied a randomly chosen but mutually exclusive location on the 2D gird. The age structure of the population is assumed to be uniform initially. Members of the same species share the same age of sexual maturity and starvation.
The evolution of the system definitely depends on the order with which we loop over the individuals of each population and also on the order of operations sequence of moving, ageing, feeding, procreating and dying. We will assume that the order of individual does not make much differences; while the sequence operation is designed as follows:
\begin{enumerate}
\item Step1: reproducing and starving age variable of each member of wolf and deer population are increased by $1$; then we check whether the starving age variable reaches the starvation age of this animal. Only if the animal is still alive shall we keep it in the animal list for the operations below.
\item Step2: loop over all wolf members and generate a list of its neighbours and take down its present location on the grid as previous location. If there is one or more deer around, then the wolf chooses one deer randomly and "eat" it by take over its spatial location and reset its own age back to zero. If there is no deer around but vacant position, the wolf move to one randomly chosen neighbouring position. The new position is then stored and compared with its previous location. If they are not equal and the wolves is mature, it deposits a new-born wolf at the vacant place left behind and reset its reproducing age variable to 0.
\item Step3: loop over all deer and check if its location is currently occupied by a wolf which means the deer is captured! Only those deer not captured will be kept in the animal list for the operations below.
\item Step4: loop over all deer left and move it to a randomly chosen vacant neighbouring position. If the new position is not equal to its previous location and the deer is mature, it deposits a new-born deer at the vacant position left behind and reset its own reproducing age to 0.
\item Step5: go back to Step1 and increase the system time by $1$
\end{enumerate}
We comment that as long as the steps above are done in serial manner there will be no conflict between the animals such as two wolves try to access to the same location or eat the same deer.
A few remarks on the rule of choosing appropriate parameters in actual simulation: first the starvation age of deer is always chosen to be extremely large ($10^9$) so that deer will not die out of starvation as we are assuming there are always enough plants for deer; second we restrict that the starvation age of wolves is always smaller than their reproduction age, or else the wolves population can maintain themselves simply by procreation and is totally independent on the presence of deer population, which is certainly unreasonable ( Although more realistic treatment do exist. For example, we can to assign each animal an "energy" such that zero energy sentence the animal to death and a certain portion of the energy must be transferred to its offspring during procreation).
With the initialisation and time updating procedures, we are able to "predict" the time evolution of the populations. However, due to the random nature of the Monte-Carlo simulation, we cannot guarantee that two runs with same parameters gives exactly (or even qualitatively) similar results, which is in contrast to the deterministic nature of the L-V equation. But this is not a drawback of simulation, in fact the randomness nature makes the simulation approach more realistic than L-V equation prediction as the eco-system itself is subject to all kinds of random process all the time.
\section{Results and discussion}
\subsection{Generic results}
A detailed investigation of the full parameter space is in next section "Parameter Search", here we just conduct a few sanity test of our code with a few set of parameters. The parameters for Fig. (\ref{gen}) are listed in Table (\ref{Few_parameters}). Two of them are initialised with uniform age structure and the other two with all members the same age.
The left panel is the time evolution of the populations. We observe some discontinuities in subfigure 2 and 4, this is because each generation of the population have the same age, so they procreate at the same time step. A population with age structure is certainly more realistic and the evolution curves are smooth. We can see that for some parameter set, the eco-system behaves as what is expected by the LV equation, though the random nature introduce large fluctuation. The population of the wolf and deer exhibit quasi-periodic features. The maximum of the wolf is off by a phase angle compared to the maximum of the deer. The structure within each period also changes across different parameter set. It seems long reproduction period of wolf leads to a flattened top of the deer population; because in this case, the wolf population would remain very low for a comparatively longer time period. We observe that in subfigure 3, both deer and wolf finally die out; however, this does not always happen for the same set of parameters, which is result of the randomness of the simulation.
The right panel displays the phase-space trajectory of the system. The quasi-periodic behaviour of time evolution is translated into a quasi-loop trajectory in the phase space. We display the phase space on semi-log scale, so it is obvious that the population can fluctuate over orders of magnitude during evolution.
\begin{table}[htdp]
\caption{default}
\begin{center}
\begin{tabular}{c|cccc}
\hline
Fig. $\#$ & 1 & 2 & 3 & 4 \\
\hline
World size N & 50 & 50 & 50 & 50 \\
initial deer $\#$ & 150 & 150 & 150 & 150 \\
initial wolf $\#$ & 50 & 50 & 50 & 50 \\
wolf reproduction age& 15 & 15 & 50 & 50 \\
deer reproduction age& 5 & 5 & 10 & 10 \\
wolf starvation age & 10 & 10 & 30 & 30 \\
deer starvation age & $10^{10}$ & $10^{10}$ & $10^{10}$ & $10^{10}$ \\
initial age structure & uniform & uniform & all 0 & all 0 \\
\hline
\end{tabular}
\end{center}
\label{Few_parameters}
\end{table}
\begin{figure}[htbp]
\begin{center}
\includegraphics[width=0.7\textwidth]{./pics/gen-5-10-15-uniform.jpeg}
\includegraphics[width=0.7\textwidth]{./pics/gen-5-10-15-delta.jpeg}
\includegraphics[width=0.7\textwidth]{./pics/gen-10-30-50-uniform.jpeg}
\includegraphics[width=0.7\textwidth]{./pics/gen-10-30-50-delta.jpeg}
\caption{The parameters for subfigure 1-4 (top to bottom) is listed in Table (\ref{Few_parameters}). Within each subfigure, the left panel is the time evolution of the wolf and deer population; the right panel displays the phase space $(N_{deer}, N_{wolf})$ evolution of the eco-system.}
\label{gen}
\end{center}
\end{figure}
\subsection{Parameter Search}
\indent
\indent The goal of this endeavor is to determine the parameters of our predator-prey system which provide a stable ecosystem. In other words, we wish to find a
system which satisfy the equilibrium condition of the Lotka-Volterra equations (i.e. when $\frac{dx}{dt} = \frac{dy}{dt} = 0$). There are two possible solutions to
this equilibirum condition: (1) when x=y=0 (the trivial solution), and (2) when $x=\frac{\gamma}{\delta}$ and $y=\frac{\alpha}{\beta}$ (non-trivial solution).
There are many possible solutions to the non-trivial case. Therefore, in order to determine a wide range of possible solutions, we attempt a full parameter search
of our algorithm. In this case, there are five parameters which must be explored simultaneously (5-D parameter space):
\begin{itemize}
\item{Initial population of deer}
\item{Initial population of wolves}
\item{Reproduction age of deer}
\item{Reproduction age of wolf}
\item{Starvation "age" of wolf}
\end{itemize}
Since it is difficult to explore a 5-D space and represent it visually, we attempt to reduce the dimensionality of the parameter space by considering the
relationship between the inital populations of the deer and the wolves, as opposed to their distinct values. Therefore, we can reduce the dimension by taking
the ratio between the deer and the wolf populations. To display this visually, we take the reproduction age of the deer, the reproduction age of the wolf, and
the starvation age of the wolf to be the cartesian axes in 3D, respectively. The ratio of the populations is represented by the size of the point in our space.
To determine whether or not these parameters satisfy the equilibrium condition, we determine whether or not the populations are nonzero after a sufficiently long time.
If a population is found to die out, then the data point is colored red. On the other hand,if the populations do not die out after a certian amount of time, the
ecosystem may be stable, so it is colored blue.
\subsection{Full Parameter Search}
\indent Fig.(\ref{full_para}) shows a scatter plot, where each point marks the stability (blue) or instability (red) of the system after 300 time points for a 1000 trials. The parameters of reproductive age for the deer and wolf as well as wolf starvation age were randomly selected.
The initial number of wold and deer populations was also randomly selected for each data point, the size of the points denote the ratio of the deer population to the wolf population.
As can be seen, there is no obvious trend observed in this kind of parameter sweep. It was observed that at some parameter configurations, a blue point was superimposed by a red point, this shows that even though parameter values remain constant, the randomness of the system, can give rise to both stable and unstable configurations.
Another way to rationalize this result of having found no obvious trend is that, maybe the parameters are related to each other in a different way, say for instance, a parameter is related to only pne other and not the rest, or maybe it is related to the diference in some other parameter values and not the basolute parameter value itself.
It shoud also be noted that the grid size during these trials was kept constant as it was reasoned that as the initial number of populations are randomly selected, it automatically covers a wide rande of "resource" to individual ratio and hence the grid size does not matter. Obviously, this is not a physical system and so the term "resource" has no meaning, hence the grid size is a redundant quantity anyways.
This however was not tested.
\begin{figure}
\includegraphics[width = 1\textwidth]{./pics/Eco_All_param_front.png}
\caption{}\label{full_para}
\end{figure}
\subsection{Restricted Parameter Search}
\indent
\indent Since the full parameter search did not yield any striking trends, we select fixed ratios of the initial deer and wolf populations. The ratios chosen to provide
a small sample were 10, 5, 1, 0.20, and 0.10. The results are shown below.
\begin{figure}[H]
\centering
\begin{minipage}[b]{.45\linewidth}
\includegraphics[width = 1\linewidth]{./pics/Restricted_Parameter_space_d2500_w250.png}
\caption{Init. $\#$ deer: 2500; Init $\#$ wolves: 250}
\end{minipage}
\quad
\begin{minipage}[b]{.45\linewidth}
\includegraphics[width = 1\linewidth]{./pics/Restricted_Parameter_space_d3000_w500.png}
\caption{Init. $\#$ deer: 3000; Init $\#$ wolves: 500}
\end{minipage}
\end{figure}
\begin{figure}[H]
\centering
\begin{minipage}[b]{.45\linewidth}
\includegraphics[width = 1\linewidth]{./pics/Restricted_Parameter_space_d2000_w2000.png}
\caption{Init. $\#$ deer: 2000; Init $\#$ wolves: 2000}
\end{minipage}
\quad
\begin{minipage}[b]{.45\linewidth}
\includegraphics[width = 1\linewidth]{./pics/Restricted_Parameter_space_d500_w3000.png}
\caption{Init. $\#$ deer: 500; Init $\#$ wolves: 3000}
\end{minipage}
\end{figure}
\begin{figure}[H]
\centering
\begin{subfigure}[t]{.45\linewidth}
\includegraphics[width = 1\linewidth]{./pics/Restricted_Parameter_space_d250_w2500.png}
\caption{Init. $\#$ deer: 250; Init $\#$ wolves: 2500}
\end{subfigure}
\label{RestrictParam}
\end{figure}
From the data above, it appears that as the ratio of deer to wolves decreases, the instabilities of the system for the other 3 free parameters increase. This
makes sense because if there are too many wolves at the start of our system time, then the first generation of wolves will eat all of the deer. This is especially
true when the reproduction age of the deer is high. As for the regions in each parameter space, we notice common trends across all ratios. It appears that for
ratios that are small and when large deer reproduction, this results in an unstable ecosystem unstable. Conversely, there is a "sweet spot"
of the parameter space which consistently yields a stable ecosystem. This occurs when the reproduction age of the deer is low and the wolf starvation age is low.
This also seems to be a fair assumption for any wolf starvation age according to the results.
Additionally, the data suggests that there are instabilities in the system when the wolf starvation age and the wolf reproduction
age are similar. There are many instances in this parameter region of space where the ecosystem will become unstable. This indicates that the wolves may
either starve or reproduce depending on the random configuration of the system. Therefore, this suggests that the randomness plays a significant role in this
region.
\subsection{Stable System}
\indent
\indent Out of the possible stable configurations, one set of parameters was chosen to further exemplify a stable system. The parameters used for the following
stable system were:
\begin{itemize}
\item{Initial number of deer: 2,500}
\item{Initial number of wolves: 250}
\item{Deer reproduction rate: 5}
\item{Wolf reproduction rate: 14}
\item{Wolf starvation rate: 11}
\end{itemize}
Additionally, to show the dynamics of the system in "real-time" the python function \textit{
animation.FuncAnimation} was used to animate the ecosystem and display the 2D ecosystem after each time step. (To view the animation, run the python code using
method 1.) However, snapshots of the system were taken at various times and are shown below.
\begin{figure}[H]
\centering
\begin{minipage}[b]{.45\linewidth}
\includegraphics[width = 1\linewidth]{./pics/ecosystem_snapshot_1.png}
\caption{t=1}
\end{minipage}
\quad
\begin{minipage}[b]{.45\linewidth}
\includegraphics[width = 1\linewidth]{./pics/ecosystem_snapshot_50.png}
\caption{t=50}
\end{minipage}
\end{figure}
\begin{figure}[H]
\centering
\begin{minipage}[b]{.45\linewidth}
\includegraphics[width = 1\linewidth]{./pics/ecosystem_snapshot_100.png}
\caption{t=100}
\end{minipage}
\quad
\begin{minipage}[b]{.45\linewidth}
\includegraphics[width = 1\linewidth]{./pics/ecosystem_snapshot_150.png}
\caption{t=150}
\end{minipage}
\end{figure}
\begin{figure}[H]
\centering
\begin{minipage}[b]{.45\linewidth}
\includegraphics[width = 1\linewidth]{./pics/ecosystem_snapshot_200.png}
\caption{t=200}
\end{minipage}
\quad
\begin{minipage}[b]{.45\linewidth}
\includegraphics[width = 1\linewidth]{./pics/ecosystem_snapshot_250.png}
\caption{t=250}
\end{minipage}
\end{figure}
\begin{figure}[H]
\centering
\begin{minipage}[b]{.45\linewidth}
\includegraphics[width = 1\linewidth]{./pics/ecosystem_snapshot_300.png}
\caption{t=300}
\end{minipage}
\quad
\begin{minipage}[b]{.45\linewidth}
\includegraphics[width = 1\linewidth]{./pics/ecosystem_snapshot_350.png}
\caption{t=350}
\end{minipage}
\end{figure}
Finally, from the Lotka-Volterra equations, we expect semi-sinusoidal behavior of our system at equilibrium. When the predator population is at a maximum,
we expect the prey population to be a minimum and vise versa. As a result, the populations were plotted as a function of time and are shown below.
\begin{figure}[H]
\centering
\includegraphics[width = 0.7\textwidth]{./pics/Stable_time_evo.png}
\end{figure}
As expected, the populations exhibit a sinusoidal-type behavior with the population maxima and minima being opposite for each population. Moreover, we notice
the behavior continues for the duration of the time shown. Therefore, it is reasonable to assume an ecosystem with these parameters is expected to persist
over time, as long as there are no other outside influences.
\end{document}