population simulation using matlab
Download
Skip this Video
Download Presentation
Population Simulation Using MatLab

Loading in 2 Seconds...

play fullscreen
1 / 6

Population Simulation Using MatLab - PowerPoint PPT Presentation


  • 265 Views
  • Uploaded on

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 .

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about ' Population Simulation Using MatLab' - bairn


An Image/Link below is provided (as is) to download presentation

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.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
population simulation using matlab

Population Simulation Using MatLab

Jie Ma

EPS 109

Professor. Militzer

fox vs rabbit
Fox vs. Rabbit
  • 1. Predator-prey Function: (Lab3)
  • Predator: Fox
  • Prey: Rabbit
  • 2. Solve Differential Equation (Lab 13)
  • RungeKutta Method
  • Stable when dx/dt = 0; dr/ dt = 0;
population changes
Population changes

How to visualize?

Red: Fox

Blue: rabbit

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.

slide4

Red for Fox and Blue for rabbit

  • When the rabbit population increase, the fox population increase, and rabbit population decrease.

for j = 1:numFox

%calculte the index of the location

while 1

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;

break

end

end

end

peppered moth evolution
Peppered Moth evolution

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

slide6

Background color : gray

Yellow: white peppered moth

Black: black peppered moth

  • Their dark color blend them in the polluted trees and makes it
  • difficult to find by their predators. As a result they are more likely to
  • survive and reproduce. As a result, the black moth population increase.
ad