from modsim import *
from chap11 import make_system
from chap11 import update_func
from chap11 import run_simulation
from chap11 import plot_results
from chap12 import calc_total_infected
from modsim import *
def sweep_beta(beta_array, gamma):
sweep = SweepSeries()
for beta in beta_array:
system = make_system(beta, gamma)
results = run_simulation(system, update_func)
sweep[beta] = calc_total_infected(results, system)
return sweep
from modsim import *
def sweep_parameters(beta_array, gamma_array):
frame = SweepFrame(columns=gamma_array)
for gamma in gamma_array:
frame[gamma] = sweep_beta(beta_array, gamma)
return frame