I have 2 questions. (1) I have a requirement to solve a differential equation where:
from time = [t0, t1, ...., tn]
for excitatory neurons = [u1, u2, ...., um]
for inhibitory neurons = [v1, v2, ...., vm]
where,
with the initial value for all u's and v's = numpy.zeros([m, 2]) for the first time step, I need to solve the differential equation du/dt = f(u, v) and dv/dt = g(u, v) for all u's and v's; take this response as the initial value for the next time step, solve the differential equations for all u's and v's; .... until the last time step, to which the initial values will be the neuronal response (or result from the differential equation) for time step tn-1.
I am not sure how to do this with odeint in python. Please clarify.
(2) I think (1) is possible in a much easier way using Brian but I am really not able to understand Brian from its documentation alone. Are there any tutorials available for Brian? Please advice.
I was asked for what I tried before posting my question here. For my requirement, I tried adding a for loop for each time step and another for loop for each neuron:
state = np.zeros([25, 2]) # one for excitatory and one for inhibitory
# neurons
for i in range(len(timeStep)):
for j in range(len(state)):
state[j] = odeint(derivativeFunc, state[j], timeStep[i])
This doesn't even go into my solver function! I then understood that the time step needs to be an array of at least 2 elements in it! Now if I give like, [timeStep[i], 0] for the time step, which I feel is really stupid and weird, I don't know which value to consider from the solver response since I get a [[0.0, 0.0], [x, y]] where x and y are floating-point response values. If I consider the first value [0.0, 0.0], then the response is always 0.0! and if I consider the second value [x, y], then I do get some response but I am not sure if I should be considering this since my actual time-step is the 1st value in the time step array and not the second value!
I am totally confused and really need help. I am sure I am not the first person facing this problem and hence, if anybody out there has found a way to solve this problem in python (as it is already there in Matlab), please help me (since I really don't want to rewrite my whole implementation in Matlab in the last minute now, unless that's the only choice I have!).
Really, thanks a lot, in advance.
Esash