exponential Times
◀ Previous

SIR models and Covid-19 spread

5 Update December 2020

It’s near the end of 2020. “People” [in the Trumpian sense of “it is my impression that people . . .”] now know something about “R” numbers, even if only vaguely. I have also learned stuff in the intervening period, mainly about how to code graphs and tables in javascript, with the help of Plotly.js, as opposed to my early clumsy attempts to code svg graphs directly. At some point I may also learn D3.js, on which Plotly is based, in the hope of more efficient code. Anyway, I thought it was time to deploy this new knowledge to remove the need for spreadsheets in the model implementation. I guess I could also work out a way to import live data to update the input parameters, but I am not at the stage yet in knowing how to do that.
It probably doesn’t need me to tell you that I have changed the “R” trace colour to green (although it may be a problem for those who find distinguishing colors difficult — is it just me that finds the violet and brown resistor colour codes hard to separate?). The Plotly “yellow” seemed confusing to me when I tried to use it on the “beige” background I have implemented to give nice svg downloads. I have also included an option to put in your own SIR values, and normalize them to 1 if you want (press/click the button). The α value assumes normalized values, so I have adjusted the js functions to take account of this, giving the same qualitative behaviour whether or not you normalize the absolute values or not.

SIR graph

R0: γ: β: α:
t:0 S: I: R: