Go to content ALT+c

Intro to Research Computing with Python  (Nov. 2014) (Old site; new site is at https://scinet.courses)
Registration is closed

Tuesday May 28, 2024 - 22:10

3.4 Homework 4: Zombie Apocalypse ODE

Consider this scenario:

You live in Buffalo, in an apartment building which holds 500 people. After 2 metres of snow, everyone is trapped in the building. One apartment's dwellers suddenly become zombies. The zombies go rampaging through the building, turning the other apartment dwellers into zombies.

Fortunately, some (9) people know how to kill zombies, and they are able to teach the other people who live in the apartment building. The chance of surviving a zombie encounter differs between zombie killers and non-zombie killers, but if a person doesn't survive the encounter, they become a zombie.

Consider the Modified Zombie Apocalypse equations:

\frac{\partial S}{\partial t} = -BSZ-ESK

\frac{\partial K}{\partial t} = -CKZ+ESK

\frac{\partial Z}{\partial t} = BSZ+CKZ-AKZ

where

  • S: number of regular people, who can't kill zombies
  • K: number of zombie killers
  • Z: number of zombies
  • A: rate at which zombies are killed, by K
  • B: rate at which regular people are turned into zombies
  • C: rate at which zombie killers are turned into zombies
  • E: rate at which zombie killers teach regular people how to kill zombies

(inspired by Munz et al., Infectious Disease Modelling Research Progress, 2009)

Use ODEINT to solve this system of equations.

Assuming values

B=0.02, E=0.015, A=0.03, C=0.01, K_0=9

(the latter is K at t=0), how many initial zombies, Z0, does it take to turn the whole building population into zombies? Note that

S_0=491-Z_0.

Solve this for several values of Z0. Produce at least 2 plots, of the three populations versus time, one where the zombies win, and all normal people disappear, and one where they lose, and the zombies disappear. Submit your code, plots and 'hg log' output.

Last Modified: Thursday Nov 27, 2014 - 12:32. Revision: 5. Release Date: Thursday Nov 27, 2014 - 11:00.


Content Navigation


Course Calendar



Questions? Contact Support.
Web site engine's code is copyright © ATutor®.
Modifications and code of added modules are copyright of SciNet.