Question: Plz Help me on MATLAB !!! zombies.pdf is When Zombies Attack! by Munz et all This can searched at google simply. I did number one

Plz Help me on MATLAB!!!

zombies.pdf is When Zombies Attack! by Munz et all

This can searched at google simply.

Plz Help me on MATLAB!!! zombies.pdf is When Zombies Attack! by Munz

I did number one and I need help on number 2. This is my code for number1.

For basic model, substituting values for each parameter as given below. Fate of humanity after 20 weeks is shown in output.

a=0.005;

b=0.0095;

ze=0.0001;

d=0.0001;

T=20*7;

dt=1;

% This function will solve the system of ODEs for the basic model used in

% the Zombie Dynamics project for MAT 5187. It will then plot the curve of

% the zombie population based on time.

% Function Inputs: a - alpha value in model: "zombie destruction" rate

% b - beta value in model: "new zombie" rate

%When Zombies Attack! 147

% ze - zeta value in model: zombie resurrection rate

% d - delta value in model: background death rate

% T - Stopping time

% dt - time step for numerical solutions

% Created by Philip Munz, November 12, 2008

%Initial set up of solution vectors and an initial condition

N = 500; %N is the population

n = T/dt;

t = zeros(1,n+1);

s = zeros(1,n+1);

z = zeros(1,n+1);

r = zeros(1,n+1);

s(1) = N;

z(1) = 0;

r(1) = 0;

t = 0:dt:T;

% Define the ODEs of the model and solve numerically by Eulers method:

for i = 1:n

s(i+1) = s(i) + dt*(-b*s(i)*z(i)); %here we assume birth rate

%= background deathrate, so only term is -b term

z(i+1) = z(i) + dt*(b*s(i)*z(i) -a*s(i)*z(i) +ze*r(i));

r(i+1) = r(i) + dt*(a*s(i)*z(i) +d*s(i) - ze*r(i));

if s(i)N

break

end

if z(i) > N || z(i)

break

end

if r(i) N

break

end

end

hold on

plot(t,s,'b');

plot(t,z,'r');

legend('Suscepties','Zombies')

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!