コード例 #1
0
sim.run(0,4)

# fig=sim.figures[0]
# fig.savefig('mice.pdf')
# fig.savefig('mice.png')

# <markdowncell>

# ### Specifying the Inflows/Outflows

# <codecell>

sim=Simulation()   # get a simulation object

sim.stock("mice",100,plot=False)
sim.inflow("mice","b*mice")
sim.outflow("mice","d*mice")

sim.params(b=1.1,d=0.08)

sim.run(0,4)

# <markdowncell>

# ### Plotting Manually

# <codecell>

x,y=sim.t,sim.mice
plot(x,y,'r--')
コード例 #2
0
    100,  # initial value
    plot=True)  # display a plot

sim.params(b=1.1, d=0.08)

sim.run(0, 4)

# <markdowncell>

# ### Specifying the Inflows/Outflows

# <codecell>

sim = Simulation()  # get a simulation object

sim.stock("mice", 100, plot=False)
sim.inflow("mice", "b*mice")
sim.outflow("mice", "d*mice")

sim.params(b=1.1, d=0.08)

sim.run(0, 4)

# <markdowncell>

# ### Plotting Manually

# <codecell>

x, y = sim.t, sim.mice
plot(x, y, 'r--')