EoN.SIR_compact_pairwise¶
-
EoN.
SIR_compact_pairwise
(Sk0, I0, R0, SS0, SI0, tau, gamma, tmin=0, tmax=100, tcount=1001, return_full_data=False)[source]¶ Encodes system (5.19) of Kiss, Miller, & Simon. Please cite the book if using this algorithm.
[dot{S}_k] = -tau k [S_k] [SI]/[SX]
[dot{SS}] = -2 tau [SS] [SI] Q
[dot{SI}] = -gamma [SI] + tau([SS]-[SI])[SI]Q - tau [SI]
[dot{R} = gamma [I]
[SX] = sum_k k[S_k]
Q = (1/[SX]^2) sum_k (k-1) k [S_k]
[S] = sum [S_k]
I = N-[S]-R
Arguments: - Sk0 numpy array
- initial number of suscetibles of each degree k
- I0 number
- initial number infected
- R0 number
- initial number recovered
- SS0 number
- initial number of SS edges
- SI0 number
- initial number of SI 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
- tells whether to just return times, S, I, R or all calculated data.
Returns: - if return_full_data:
- times, Sk, I, R, SS, SI
- else:
- times, S, I, R
SAMPLE USE: import networkx as nx import EoN