EoN.SIR_homogeneous_meanfield

EoN.SIR_homogeneous_meanfield(S0, I0, R0, n, tau, gamma, tmin=0, tmax=100, tcount=1001)[source]

Encodes System (4.9) of Kiss, Miller, & Simon. Please cite the book if using this algorithm.

In the text this is often referred to as the “mean-field model closed at the level of pairs”

These are often referred to as the “Kermack-McKendrick equations”

[dot{S}] = - tau n[S][I]/N [dot{I}] = au n[S][I]/N - gamma [I] [dot{R}] = gamma [I]

Arguments:

S0 number

initial number susceptible

I0 number

initial number infected

R0 number

initial number recovered

n number

(average) degree of each node

tau positive float

transmission rate

gamma number

recovery rate

tmin number (default 0)

minimum report time

tmax number (default 100)

maximum report time

tcount integer (default 1001)

number of reports

Returns:

times, S, I, R all numpy arrays

SAMPLE USE:

import networkx as nx
import EoN
S0 = 999
I0 = 1
n = 4 #degree
tau = 1
gamma = 2
t, S, I, R = EoN.SIR_homogeneous_meanfield(S0, I0, 0, n, tau, gamma)