DATA 420 - Modeling and Simulation - Spring 2026
Homework #3 — Systems Dynamics Models III
Possible experience: +40XP
Due: Friday, March 13, 5pm
Enhancing the SIR model
Invent a clever name for an infectious disease. It can be light-hearted and
whimsical, or grisly and macabre. Come up with some symptoms for it, and a
method by which it will be passed from human to human.
Then, build upon the SIR model we did in class in the following ways:
- This disease is often fatal. You'll thus have a Dead stock with a
morbid flow into it.
- This disease (as is fairly common among diseases) has an incubation
period during which an individual who has caught the disease is not yet
infectious him/herself. We'll use standard epidemiological terminology here,
even though I find it confusing: such individuals are called "Exposed."
The "Infected" population, on the other hand, are those who are actually
infectious. (So to be clear: both Exposed and Infected individuals
are sick. The difference is that the former are in the early stages of
the disease, and cannot yet pass it on to others; the latter are at the point
where they're communicable.) So the lifecycle for an individual who recovers is
S→E→I→R, and for those who die, S→E→I→D. (This is
assuming that the individual is not quarantined, as explained in the next
bullet.)
- The panicked society reacts to this epidemic by implementing a
Quarantine procedure. When individuals become Exposed (and show
symptoms indicating this) some fraction of them are immediately moved to an
isolated location (with other exposed individuals) for some period of time,
until they are deemed recovered (or dead). Thus during their infectious period,
they are unable to contaminate others. After they are no longer infectious,
they are returned to the general population to resume their lives. So the
lifecycle for an individual who gets quarantined is
S→E→QE→QI→R (and for those who die,
S→E→QE→QI→D).
To do
- On paper, or using some kind of electronic drawing tool, create a
stock-and-flow diagram that enhances the original SIR diagram by including
the following additional four stocks:
- E -- exposed individuals who are mingling in the general earth
population. (As described above, these individuals do exhibit
symptoms of the disease, but they are not yet contagious.
- QE -- exposed individuals who are isolated from the rest of
humanity and are bored.
- QI -- infected individuals who are isolated from
the rest of humanity and are bored. They are contagious, but s'aight,
they're locked in a cell and can't infect anybody else.
- D -- dead. :(
Obviously, your stock-and-flow diagram will also have additional flows.
Consider carefully what those should be. It will also contain additional
parameters (little circles). Consider carefully what those should be, and what
units they should be in.
-
For the code, begin with the SIR model we wrote in class. Do a git pull or just
copy the file to your system from github.
- Modify your Python code to incorporate your changes to the stock-and-flow
diagram.
- Carefully experiment with different values of your parameters to ensure
that the simulation's behavior makes sense. (Take your time here. Don't
rush.) Investigate anomalies and curiosities, debugging if necessary.
- When you're confident it passes sanity check, produce two plots:
- A representative plot using a single set of reasonable parameter
choices. This plot should have time on the x-axis, and should show a line
for the populations of each of the seven stocks. It should be well-labeled
and neat. It should have a legend and a title. It should either be in color
(if you have access to a color printer) or use different line widths/styles
to distinguish between the different stocks (if you don't).
- Two plots representing the results of a parameter sweep on some
independent variable (your choice). One plot should show the total
percentage of the population that gets the disease on the y-axis, and
your independent variable on the x-axis. The other should show the total
percentage of the population that dies on the y-axis, and your
independent variable on the x-axis. Ditto the previous comments about
neatness, labels, and colors.
- Using a word processing program, write a three-paragraph blurb of text
that (1) describes your fictitious disease and its humorous and/or grisly
symptoms and transmission method, and (2) summarizes in words what you learned
about the model's behavior through running the simulation in the previous
step. These paragraphs should be grammatically correct, with no spelling
errors; they should be compelling, intriguing, inspiring, and contain writing
worthy of a college student, not a high school student.
- Print out (on a printer) your code, your write-up, and your two
plots. Staple them (with a stapler) together with your legible
and beautiful stock-and-flow diagram from step 2, above.
- Stick your finished packet of paper in the "420" manilla envelope hanging
outside my office door in James Farmer 044.
Warnings and notes
DO NOT wait anywhere remotely close to the deadline before
completing your stock-and-flow diagram. You cannot do that successfully
at the last minute. It will require unrushed, uncluttered, unpanicked thought
to get right.
I am more than happy — nay, overjoyed — to discuss the
stock-and-flow diagram with you in office hours or to answer questions about
it over email. Ditto the Python implementation.
Getting help
Come to office hours, or send me email with subject line "DATA 420
Homework #3 help!!"