Using the SIR Model for infectious disease in Excel, but have a miscalculation somewhere

gravanoc

Active Member
Joined
Oct 20, 2015
Messages
351
Office Version
  1. 365
Platform
  1. Windows
  2. Mobile
Hi, I'm trying to follow a prescribed model for the spread of infectious disease using the SIR model, but somehow my columns are not summing up to N, which is always supposed to be a constant.

Formula is here: SIR Model

Snapshot of Excel file: Sir.png

Ok t is pretty much just the number of days starting with 0 - 65. The only variability in the overall formula is that when the day/t hits 22 some random factor changes, represented by 0.04663495 and later 0.05498259. In the column S(t) it starts at S(0) = 6,810,005, I(t) starts with I(0) = 94, R(t) starts with R(0) = 1. Next row is where I put the main formula: t is just a constant that increases by 1, S(1) =C4-(IF(B5<=21,$L$5/$H$8,$L$6/$H$8)*C4*D4); I(1) =D4+(C4*D4/$H$8)-(D4/$L$8), R(1)=E4+(D4/$L$8). Those seem to match up exactly to what the formula states, but my N value keeps increasing when it should always remain 6,810,100.

Here are links to a couple files, the first is my failed attempt to calculate: SIR2.xlsx

Next is a link to a file I found on the Internet that accounts for the model in a different way: SIR.xlsx

Help is greatly appreciated!
 

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop

Forum statistics

Threads
1,224,305
Messages
6,177,784
Members
452,805
Latest member
drew_aldana

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top