Population Simulation Using MatLab. Jie Ma EPS 109 Professor. Militzer. Fox vs. Rabbit. 1. Predator-prey Function: (Lab3) Predator : Fox Prey : Rabbit 2. Solve Differential Equation (Lab 13) Runge Kutta Method Stable when dx/ dt = 0; dr / dt = 0;. Population changes .
Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.
Population Simulation Using MatLab
How to visualize?
Reference the Random walk Lab5:
Generate a white matrix
to represent the total population
Using Red grad to represent fox
population and blue grad to represent the rabbit population
Use random number to generate a random location of Fox or Rabbit.
for j = 1:numFox
%calculte the index of the location
randloc = round(rand()*maxPoP);
rand_row = round(mod(randloc,sn))+1;
rand_col = round(randloc/sn)+1;
%if the poistion has already be not been taken, reject to move
if(A(rand_row,rand_col,2) == 255)
A(rand_row,rand_col,1) = 255;
A(rand_row,rand_col,2) = 0;
A(rand_row,rand_col,3) = 0;
X for bird: dx/dt= (-d +e * y+ et *z) * x;
Y for White Moth: dy/dt= (kr*( m â€“y )- c * x) *y;
Z for Bluemoth: dz/dt= (kt*(mt- z)-ct* x )* z;
C > Ct
Background color : gray
Yellow: white peppered moth
Black: black peppered moth