Lab 7 Math 119A: Time Series with SIR
As in Lab 6 we will be studying the SIR system modeling an epidemic. is the number (in millions) of susceptible people, is the number (in millions) of infectious people, and is the number (in millions) of recovered and immune people. If we ignore births and deaths, the equations that describe the changes in these populations are: We will assume that our total population is million people. We start with 100 infected people, , million people and . (No one has recovered yet.)
We will continue to use the Euler2D program used in Lab 6, and unless otherwise specified we will continue to use and .
Now we we are going to create time series plots. Here is an example using Euler2D to create time series plots for our Romeo and Juliet example:
Exercise 1. Plot the time series for the susceptible population and infected population together on a single graph. (Make sure to include a legend showing which time series goes with which population.)
Exercise 2. Ignore fatalities, so that the number of recovered people equals . Create the time series of and graph it along with the time series you've found for and .
From your plots you should see that the maximum number of infected people at any time is a little more than 100 million. In the next exercise we will give a more accurate estimate for the number of infected people.
Exercise 3. Find the maximum number of infected people.
(Hint: In CoCalc the function max()
allows you to find the maximum of a list. For example max([4,7,3,-1])
will return 7, the maximum value in the list [4,7,3,-1].)
Exercise 4. Across the world people are practicing social distancing in order to decrease the rate at which coronavirus is being spread by decreasing the number of interactions between people. In a comment, identify which parameter in our model is proportional to the average number of interactions between people per day and explain how this variable changes with social distancing.
Exercise 5. From your time series you should see that the peak number of infected people was a little over million people. Change the variable you identified in the previous exercise so that the peak is near million.
In the next exercise we will need to create an interactive. Here is an example of an interactive with our Romeo and Juliet model:
In this exercise we will create an interactive allowing us to 'flatten the curve.'
Exercise 6. Create an interactive version of your time series with a slider for which goes from (at most) to (at least) in steps (no larger than) .
Exercise 7. Create a new version of you interactive which also displays the maximum number of infected people.
(Hint: Use the text()
function introduced in lab 5., you will probably want to combine tow text() calls, one for a string, "Max =" and the second for actual maximum value. You will want to play with the coordinates where you put the text to get it to look right.)