DATA 420 - Modeling and Simulation - Spring 2024
Systems Dynamics Models II
Possible experience: +50XP
Due: Wednesday, March 13,
midnight Friday, March 15, midnight
Overview
Create a Systems Dynamic model of a deadly disease as it sweeps through a
panicked population. It can (and should) be heavily based on the SIR model
from the class notes.
Your model will build upon SIR in several 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).
- Smart scientists have developed a vaccine for this disease, which some
fraction of the population takes immediately before the disease hits
society at large. Those Vaccinated people are 100% guaranteed to be
immune to the disease for their entire lifetime. As the disease progresses,
additional Susceptible people also get the vaccine, at an adjustable
rate.
- After the disease hits and bleakness sets in, 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/infected individuals) for some period of time, until they are deemed
recovered (or dead). (While an individual is in quarantine, he/she will at some
point move to become Infected, and then either Recover or
Die.) Note that exposed persons are normally not immediately
detected as being exposed; so there will be a non-instantaneous rate of flow
from the E stock to quarantine.
Big, big, non-obvious hint about quarantine: in addition to
other things, your simulation needs to know, at every point in time, (1) how
many exposed people there are running around in the general population, (2) how
many infected people there are running around in the general population, (3)
how many exposed people are in quarantine, and (4) how many infected people are
in quarantine. So it's not quite as simple, as you might have thought, as
adding a single "Q" stock to your simulation. Not all people in
quarantine are in the same state: some have not yet become Infectious, while
others have, and that rate-of-becoming-infectious is the same rate whether
you're holed up in a hotel room or mingling about the general population.)
Instructions
- Invent a clever name for your 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.
- On paper, or using some kind of electronic drawing tool, create a
stock-and-flow diagram that enhances the original SIR diagram by including
additional stocks, flows, and other parameters, as necessary. This will
take some focused, unrushed thinking to figure it out.
- Show Stephen your stock-and-flow diagram so he can sanity check it and
clear you to move on to the next stage.
- 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. This will include adding any extra parameters to the runsim()
function signature, and if plot=True, adding additional lines lines to
your plot. Warning: do not try to code all the above
changes all in one go. Instead, add your code to accommodate Death, and make
sure it works. Then, add your code to accommodate ongoing Vaccination (the code
from 2/22 only has the initial vaccination chunk), and make sure it works. Then
add your code to accommodate Quarantine, and make sure it works.
- 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 the various stock
populations on the y-axis. 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).
- A plot representing the results of a parameter sweep. You can choose
any variable you like as the independent variable, and anything you want to
measure (total fraction ever infected, max number of people infected at one
time, fraction of people who died, time to epidemic peak, etc.) as your
dependent variable. Ditto the previous comments about neatness, labels, and
colors.
- Using a word processing program, write a three-to-five-paragraph blurb of
text that (1) describes your fictitious disease and its humorous and/or grisly
symptoms and transmission method, (2) describes each of the two plots, and
specifies what the takeaway is from each, and (3) summarizes in words what you
learned about the model's behavior through running the simulation. 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 or middle 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. Type/write your
name on the writeup so I know it's you.
- Stick your finished packet of paper in the "420" manilla envelope hanging
outside my office door in Farmer basement.
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
System Dynamics II help!!"