Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
AllenDowney
GitHub Repository: AllenDowney/ModSimPy
Path: blob/master/chap06.py
1381 views
1
from modsim import *
2
3
def run_simulation(system, growth_func):
4
results = TimeSeries()
5
results[system.t_0] = system.p_0
6
7
for t in range(system.t_0, system.t_end):
8
growth = growth_func(t, results[t], system)
9
results[t+1] = results[t] + growth
10
11
return results
12
13
14