Mathematical modelling of zombies in a galaxy far
and far away
Zombie outbreaks occur frequently. Therefore, we should expect them to occur in the future as well,
during the era of space colonization. We must be prepared when it happens. Our goal is to find good
ways to protect us from these inevitable events. To achieve this goal, we will simulate the spread
of the disease in a specific galactic system: the galaxy from Legend of Galactic Heroes written by
Galactic Empire versus Alliance of Free Planets
In order to understand the setting of our model, some background knowledge on the situation of the
galaxy is needed.
Figure 1: The Galaxy
The galaxy is divided in two parts. The Alliance of Free Planets is situated on the left of our
map and the Empire on the right. The two nations are connected by two corridors in the middle
of the map. These are called the Iserlohn corridor and the Phezzan corridor, named after the two
strategic points situated on the corridors: the Iserlohn fortress and the free-trade zone Phezzan.
The economy relies on the routes of merchant ships, which transport economic goods from planet
to planet. The free-trade zone Phezzan is an important zone of trading, which fuels the economy.
It is known that it takes about 2 weeks to travel from the capital of the Empire, Odin, to Phezzan.
The two nations are at war with each other. The battles are conducted by large number of
military fleets. However, for simplicity, we assume peace in the situation of our project. Military
fleets will nevertheless be used in government intervention during the zombie outbreak.
Our system is written in C++ programming language. Using the above map, we create a discrete
network model. At each vertex, we include a local system governed by a set of differential equations.
Moreover, the local system can change and evolve by interacting with the global network system.
To be more precise, our model includes static points, which are planets. Each planets will have
its own population that is subject to zombie ourbreak. To spread the disease, we have merchant
ships travelling from one static point to another. Goverment interventions are described by military
Knowing that it takes about 2 weeks to travel from Odin to Phezzan, we define the distance
between the two to be 3300 distance units. All other distances are chosen so that the map is to
The population of a merchant ship is modelled by the following set of simple equations:
dS = -SZ
dZ = ( - )SZ
where S is the number of susceptibles, Z is the number of zombies. In the equations, is the rate at
which zombies convert humans and is the rate at which humans kill zombies, both involve mass-
action terms since we believe that the rates must be dependent of the humans-zombies interactions.
We assume that > . Moreover, as the equations suggested, we ignore any possible input to the
population of a ship because births on travelling ships are unusual.
The local system for a planet is very similar to that of a ship with additional information. The
evolution of the population of each static point is governed by the following equations:
= -SZ + rS
dZ = ( - )SZ
where S, Z, and are as in the merchant ship case. Here, r represents the growth rate of the
population and K is the carrying capacity of the planet. We assume that the growth is logistic.
Note that the interactions between merchant ships and planets do not change the local system of
differential equations at each planet since we assume that merchant ships do nothing more but
spreading the disease and changing the inputs on the planets.
When military fleets arrives on a planet, the set of differential equations governing the system of a
planet is modified as follows:
= -SZ + rS
dZ = ( - )SZ - nQZ,
where Q is the rate at which zombies are killed by the fleets (we call it the fleet kill rate), and n is
the number of fleets.
Military fleets are assumed to be very efficient, in the sense that they cannot be infected. More-
over, as seen in the equations, compared to merchant ships, the presence of a military fleet on a
planet modifies the local system. The reason for this is that military fleets employ totally different
actions from the merchants.
Initial values and assumptions
In order to do realistic simulations on the system, we need initial given values and initial assumptions
on ships and military fleets. The assumptions reflect the interactions between fleets, ships and
planets. Moreover, some of these values and these assumptions are not parameters and will remain
unchanged when we do the analysis.
Planets Heinessen (the capital of the Alliance of Free Planets) and Odin are assumed to have
populations of 10 billion. All other planets have populations of 2 billion. Additionally, there will be
100 zombies on Heinessen. Military fleets will be put on Odin at time zero.
Merchant ships are programmed to randomly travel between planets.
1. When a ship lands on a planet, it releases 50% of its zombies.
2. Reciprocally, while being on a planet, a ship has f % chance to be infected, where f = c*
(c is a constant called the ship infection chance). The explanation for this choice of f is that
we want it to be 0 when either S or Z is 0, and that if S and Z are not 0 at the same time,
then (S + Z)2 can be made to be greater than SZ with appropriate choice of constant c. For
example, for c = 1.0, we have that (S + Z)2 = S2 + Z2 + 2SZ 1.0 * SZ. Hence, their ratio
is smaller than or equal to 1.
3. Moreover, if a ship does get infected on a planet then we assume that a random number
between 1 and 5 zombies has invaded the ship.
4. Our model assumes that ships land on a planet and then take-off again in the next time step.
However, this is only possible if the ratio of zombies-to-("living" population of the ship) does
not exceed 30%.
For simplicity, military fleets are also programmed to randomly travel between planets. On a planet,
military fleets can have different actions. Let us consider a particular situation where there are
currently n-fleets (n N) on the planets and there is a new fleet arriving onto the planet.
T %, where T is a parameter called the nuke threshold, the fleet stays and the
term nQZ in the differential equations changes to (n + 1)QZ,
> T %, all fleets destroy the planet using nuclear weapon,
3. If n 1 then the planet is assumed to be in quarantine. In this case, no merchant ship can
take off from the planet. Any infected merchant ship arriving on the planet is destroyed. Any
uninfected merchant ship arriving on the planet will be sent away and then they randomly
choose a new destination.
Methods of simulation
The simulation will consist of two parts. The first part will be a military-free analysis and the second
will add military interventions.
We will generate many examples, export numerical results from our program to Microsoft Excel.
And then, using Excel, we will calculate the average of the results and then draw graphs of these
Here are several intesresting questions that we will study in details in the statistical analysis:
1. What is the evolution of the population of the global system?
2. What is the evolution of the population on a planet? (For example, Heinessen)
3. How do the number of ships per planet, the velocity of these ships and chance of ship infection
affect the speed at which the disease spreads?
Simulations with military interventions
In this part, military fleets are added to the system. For this part, we will fix most parameters and
put emphasis on the military fleets. Here is the list of several questions that we will study:
1. How does the number of fleets affect the spread of the disease?
2. At what percentage of the zombie population should military fleets start nuking planets?
3. How does the efficiency of fleets affect the gloabl spread of the disease?
Preliminary analysis of the three models
The steady states for the ship model are given when
dS = 0 = -SZ
dZ = 0 = ( - )SZ
From these equations we can deduce two steady states : (S,0) or (0,Z), where S and Z are arbitrary.
Since S and Z are arbitrary, the Jacobi Matrix method will fail along the lines S = 0 or Z = 0.
However, along the line S = 0 and for any given Z > 0, for positive values of S, dS < 0. Therefore,
for any given Z > 0, the line S = 0 is stable. Similarly, along the line Z = 0, and for any given
S > 0, for positive values of Z, dZ > 0 (because > ). Therefore, for any given S > 0, the line
Z = 0 is unstable.
On Figure 2, we can visualize the situation drawn by pplane.
Figure 2: The ship model
Planet stability, no military
The steady states for the planetary model are given when
= 0 = -SZ + rS
dZ = 0 = ( - )SZ
From the second equation, we have that either S = 0 or Z = 0. If S = 0, then the first equation is
already satisfied and so Z can be arbitrary. Let Z 0, we have, for small S > 0, dS -SZ + rS
which is negative whenever Z > r and positive otherwise. Therefore, the endemic equilibrium is
unstable whenever Z < r and stable whenever Z > r
If Z = 0, the first equation will be satisfied whenever rS 1 - S
= 0, which is the case when
S = 0 or S = K. We have already discussed the case (0,0). For (K,0), the Jacobi Matrix is
-Z + r - 2rS
( - )Z
( - )S
For the steady state (K,0), the determinant is -r( - )K which is negative and so this is a saddle
The situation is drawn on Figure 3.
Figure 3: The planet model with no military
Planet stability, with military
The steady states for the planetary model are then given when
= 0 = -SZ + rS
dZ = 0 = ( - )SZ - nQZ,
The second equation is 0 whenever Z = 0 or S = nQ . If Z = 0, the first equation is 0 either when
S = 0 or S = K. If S = nQ , then S = 0 and the first equation is 0 whenever -Z +r 1 - S S
K( - )
The Jacobi Matrix is
-Z + r - 2rS
( - )Z
( - )S - nQ
1. Steady state (0,0)
In this case, the determinant of the matrix is -rnQ, and thus this is a
2. Steady state (K,0)
In this case, the determinant of the matrix is -r(( - )K - nQ) =
(nQ - ( - )K)r and trace -r + ( - )K - nQ. This case is difficult to predict because we can
have any number of fleets on a planet. When Q is large enough, it will often happen that this will
be an equilibrium state.
Figure 4: The planet model with military (Steady state (K, 0) when nQ is small)
If the nullcline S = nQ is on the left of K (K = 1.5 * 1010) as on figure 4, (K, 0) is a saddle.
Otherwise, it is an equilibrium state.
3. Steady state
nQ , r 1 -
The Jacobi matrix is
( - ) r (1 -
the trace will be -rnQ < 0 and the determinant nQr 1 -
> 0 which is stable when the
previous one is not.
The close-up of the equilibrium state can be seen on Figure 5 (on next page).
Simulations and Analysis
We simulate each test 250 times and average the result.
The goal of our project is not to investigate the effect of , , r and K on the spread of the disease.
Therefore, we have picked reasonable values for them corresponding to a time step of 1 hour. For
planets, we pick = 5 * 10-11, = 1.0 * 10-10, r = 2.5 * 10-6 and K = 1.5 * 1010. For ships, we choose
= 0.01, = 0.02. The goal for and is to simulate an infection that lasts several days. The
Figure 5: The planet model with military
parameter r was chosen to be higher than Earth's to account for better technology. K = 1.5 * 1010
was chosen arbitrarily to allow population similar to Earth's.
1. Single planet analysis
Once infected, all planets behave as predicted in section 5.1.2. Figure
6 is an example of Heinessen starting from the time it was infected.
Figure 6: Heinessen
As we can see, it takes about 300 hours for the population of Heinessen to be wiped out by the
disease. This is long enough for ships to land and leave the planet with zombies.
2. Global analysis with variation of ship infection chance
We pick 20 ships per planet with
speed 10 distance unit per hour and vary the ship infection chance. Here, we obtain the results of
the total galatic population as a function of time in Figure 7.
Figure 7: Ship infection chances
We observe that our chosen values of c have slightly different effects. We believe that a ship will
eventually get infected no matter the value of c that we choose. Of course, if c were very small, a
ship would never get infected. However, such values of c would be unrealistic.
3. Global analysis with different number of ships per planet
In this part, we choose the
speed of ships to be 10 distance units per hour, and pick c = 1. We obtain the following graph of
total galactic population as a function of time in Figure 8.
As in the previous part, the differences are small. We believe that it is not much different than
changing the ship infection chance since having more ships only increases the chance of one getting
4. Global analysis with ships having different velocities
We pick 20 ships per planet and
choose c = 1. We obtain the following results of the total galatic population as a function of time
in Figure 9.
We remark that the speed of ships greatly influence the evolution of the total population. At
high speeds, we observe that there is not much difference. We speculate that this is because fast
ships will travel to more destination and hence has more chance of getting infected. However, if the
ship were slow, its population would be wiped out by the zombies onboard.
Analysis of military actions
Since we have already varied the merchant ships parameters, we let them be fixed here. Namely,
we assume that there are 20 merchant ships per planet with speed with speed 10 distance units per
hour and pick ship infection chance c = 1.
Figure 8: Ships per planet
Figure 9: Ship infection chances
1. Single planet analysis
We have observed two different scenarios. In the first case, the ships
stay on, protect the planet and eliminate the outbreaks as in section 5.1.2. In this case, the planet
population keeps growing to either (K, 0) or to another outbreak if the nullcline is to the left of K.
An example can be seen on Figure 10.
- Galactic Empire versus Alliance of Free Planets
- The Model
- Merchant ships
- Adding Military
- Simulation methods
- Initial values and assumptions
- Initual values
- Merchant ships
- Military fleets
- Methods of simulation
- Military-free simulations
- Simulations with military interventions
- Preliminary analysis of the three models
- Ship stability
- Planet stability, no military
- Planet stability, with military
- Simulations and Analysis
- Military-free analysis
- Analysis of military actions
- Discussion and Limitations of the Model
- How to use defense better against zombies