Skip to content

Commit

Permalink
setup a demonstration for Rita on Wednesday
Browse files Browse the repository at this point in the history
  • Loading branch information
twallema committed Sep 23, 2024
1 parent 5b794d0 commit 6b6f4bd
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
20 changes: 20 additions & 0 deletions tutorials/IDD/spatial_SIR/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,26 @@ def integrate(t, S, I, R, beta, gamma, f_v, N, M):

return dS, dI, dR

# @staticmethod
# def integrate(t, S, I, R, beta, gamma, f_v, N, M):

# # compute total population
# T = S + I + R

# # compute visiting populations
# I_v = I @ M
# T_v = T @ M

# # compute force of infection
# l = beta * (np.einsum ('lj, il -> ij', I/T, (1-f_v)*N) + np.einsum ('jk, lk, il -> ij', M, I_v/T_v, f_v*N))

# # calculate differentials
# dS = - l * S
# dI = l * S - 1/gamma*I
# dR = 1/gamma*I

# return dS, dI, dR

###################
### Stochastic ###
###################
Expand Down
5 changes: 4 additions & 1 deletion tutorials/IDD/spatial_SIR/simulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,12 @@
ax[1].legend(loc=1, framealpha=1)

plt.tight_layout()
# plt.show()
plt.show()
plt.close()

import sys
sys.exit()

######################
### initialize model #
######################
Expand Down

0 comments on commit 6b6f4bd

Please sign in to comment.