CVODE: record, play, events
Posted: Tue Mar 18, 2014 4:36 pm
I'm using CVODE for the first time, and I have a few implementation questions. Sorry for the long post; I'm just missing some basics despite digging through the documentation/forum/book.
1) I'm running my simulation multiple times (parameter sweep). Should I call cvode.record(...) just once (outside my simulation procedure) or for every simulation (within the simulation procedure)?
2) I want to use cvode.record(...) to record the current of my IClamp point process. Is it possible to use the cvode class's record function for a point process? If so, what should the first argument be? If not, how else could I record the current time course?
3) I would also like to use cvode.record(...) to record Vm. However, I'm not clear on the syntax for the first argument (pointer to the voltage) given that my nodes are a vector:
Let’s say I want to record Vm for node[0]. I’ve tried two ways:
But in both cases, after running my simulation, Vm_vec and t_vec are empty (size = 0).
4) I’m using extracellular current point source stimulation (phi = I/(4*pi*sigma*r) at each node, where I is a current pulse from an IClamp). I want to set up the extracellular potential time course for each node and use myvec.play(…) to apply them. I’ve tried looking at the folder "extracellular_stim_and_rec", but I’m having trouble grasping the pieces that I need. From calcrxc.hoc, I understand that I can create a vector (rx_xtra) that contains the transfer impedance from the extracellular point source to each node of my axon. Then, using rx_xtra, I could just loop through all the nodes and all time points with a fixed time step…
Is there a more efficient way, in which I’d actually use the IClamp rather than figuring out if the stimulation is on or not manually as I did above?
Then I think I’d have to apply (i.e. play) the potentials with something like…
I will also use cvode.event(t) to add events signaling the step up and step down of my current pulse.
Thank you!
1) I'm running my simulation multiple times (parameter sweep). Should I call cvode.record(...) just once (outside my simulation procedure) or for every simulation (within the simulation procedure)?
2) I want to use cvode.record(...) to record the current of my IClamp point process. Is it possible to use the cvode class's record function for a point process? If so, what should the first argument be? If not, how else could I record the current time course?
3) I would also like to use cvode.record(...) to record Vm. However, I'm not clear on the syntax for the first argument (pointer to the voltage) given that my nodes are a vector:
Code: Select all
create node[axonnodes]
Code: Select all
objref t_vec
t_vec = new Vector()
objref Vm_vec
Vm_vec = new Vector()
cvode.record(&node[0].v(0.5),Vm_vec,t_vec)
Code: Select all
objref t_vec
t_vec = new Vector()
objref Vm_vec
Vm_vec = new Vector()
node[0] {
cvode.record(&v(0.5),Vm_vec,t_vec)
}
4) I’m using extracellular current point source stimulation (phi = I/(4*pi*sigma*r) at each node, where I is a current pulse from an IClamp). I want to set up the extracellular potential time course for each node and use myvec.play(…) to apply them. I’ve tried looking at the folder "extracellular_stim_and_rec", but I’m having trouble grasping the pieces that I need. From calcrxc.hoc, I understand that I can create a vector (rx_xtra) that contains the transfer impedance from the extracellular point source to each node of my axon. Then, using rx_xtra, I could just loop through all the nodes and all time points with a fixed time step…
Code: Select all
for K = 0, axonnodes-1 {
for J = 0, ntsteps – 1 {
// compute Ve at each node at each time point
if ((J*dt > delay) && (J*dt < delay + dur)) {
Ve[K].x[J] = I/(4*pi*sigma*r.x[K])
}
}
}
Then I think I’d have to apply (i.e. play) the potentials with something like…
Code: Select all
for K = 0, axonnodes-1 {
Ve[K].play(&node[K].e_extracellular(0.5), dt)
}
Thank you!