EoN.SIS_compact_pairwise(Sk0, Ik0, SI0, SS0, II0, tau, gamma, tmin=0, tmax=100, tcount=1001, return_full_data=False)[source]

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

[dot{S}_k] = gamma[I_k] - tau k [S_k] [SI]/[SX]

[dot{I}_k] = tau * k *[S_k] [SI]/SX - gamma [I_k] = -[dot{S}_k]

[dot{SI}] = gamma([II]-[SI]) + tau([SS]-[SI])[SI]Q - tau[SI]

[dot{SS}] = 2 gamma[SI] - 2 tau [SS] [SI] Q

[dot{II}] = 2 tau[SI] = 2 gamma[II] + 2 tau[SI]^2Q

[SX] = sum_k k [S_k]

Q = (1/[SX]^2) sum_k (k-1)k[S_k]

Conserved quantities:


SS + II + 2SI

Sk0 numpy array
number susceptible for each k
Ik0 numpy array
number infected for each k
SI0 number
number of SI edges
SS0 number
number of SS edges
II0 number
number of II edges
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
return_full_data boolean (default False)
if True, return times, S, I, Sk, Ik, SI, SS, II if False, return times, S, I

All numpy arrays

if return_full_data
return times, S, I, Sk, Ik, SI, SS, II
return times, S, I
import networkx as nx
import EoN