Hi Joelle,
In the simplest scenario, I suggest writing a function that does your single simulation, given the varying parameters, then calling it in a for loop:
import numpy as np
import tvb.simulator.lab as tvb
def runsim(a_i):
mod = tvb.models.Generic2dOscillator(a=a_i)
sim = tvb.simulator.Simulator(model=mod)
sim.configure()
results = []
for (t, data), in sim(simulation_length=10.0):
results.append(data)
return np.array(results)
a = np.array([1.0, 2.0])
for i, a_i in enumerate(a):
results = runsim(a_i)
np.save('results_%03d.npy', results)
Multidimensional parameter explorations are slightly more elaborate and can be done in several ways; I do the following
from itertools import product
a = np.r_[-1:2:0.1]
b = np.r_[-0.3:0:0.05]
c = np.r_[-10:20:2]
for i, (ai, bi, ci) in product(a, b, c):
np.save('results_%06.npy', runsim(ai, bi, ci))
Let us know if you have further questions on this,
cheers,
Marmaduke
--
You received this message because you are subscribed to the Google Groups "TVB Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tvb-users+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To unsubscribe from this group and stop receiving emails from it, send an email to tvb-...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "TVB Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tvb-...@googlegroups.com.
From: tvb-...@googlegroups.com <tvb-...@googlegroups.com> on behalf of Jan Stasiński <ja.st...@gmail.com>
To unsubscribe from this group and stop receiving emails from it, send an email to tvb-...@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to tvb-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tvb-users/e5d2d93b-cb0f-4c22-a8ba-13a4ef830a9en%40googlegroups.com.