run() inside loop
Posted: Sun Nov 30, 2008 10:56 am
Hi,
I'm having some problems using run() inside a while loop. I have inserted a Exp2Syn
in a dendrite and now want to see the effect of changing the time constants.
For each set of tau0 and tau1 values I increase the value of the peak conductance
until I get the desired response in soma (I do this using a while loop). For some reason, the value of tau1
changes inside the while loop (during run() ). Once the value has changed, it stays the same for the remaining iterations.
Here's the part of my code where things go wrong:
The problem seems to arise at the thrid iteration of the outside loop (setting tau1) regardless of the loop parameters.
Could the problem be my understanding of what run() actually does?
~Ulrik
I'm having some problems using run() inside a while loop. I have inserted a Exp2Syn
in a dendrite and now want to see the effect of changing the time constants.
For each set of tau0 and tau1 values I increase the value of the peak conductance
until I get the desired response in soma (I do this using a while loop). For some reason, the value of tau1
changes inside the while loop (during run() ). Once the value has changed, it stays the same for the remaining iterations.
Here's the part of my code where things go wrong:
Code: Select all
tau1_max = 1
tau1_bins = 100
incr1 = tau1_bins/tau1_max
tau2_max = 2.5
tau2_bins = 10
incr2 = tau1_bins/tau2_max
depol = 3
recsoma.record(&soma.v(0.5))
// _________________________________________________________________________
// ___________FOR LOOPS: VARYING TIME CONSTANTS AND PEAK CONDUCTANCE_______
for i=0,tau1_bins {
AMPAsyn.tau1 = (i+1)/incr1
for n=0,tau2_bins {
AMPAsyn.tau2 = (n+1)/incr2
nc.weight=0
run()
print "tau1 = ", AMPAsyn.tau1, "; tau1 = ", AMPAsyn.tau2
//increasing peak conductance until depolarization in soma is reached
while (recsoma.max+70 < depol) {
nc.weight = nc.weight+.0001
recsoma.resize(0)
run()
}
recsoma.resize(0)
//appending correct value to conductance vector
CondVector.append(nc.weight)
}
//saving CondVector to next column in matrix
CondMatrix.resize(CondVector.size(),i+1)
CondMatrix.setcol(i, CondVector)
CondVector.resize(0)
}
Could the problem be my understanding of what run() actually does?
~Ulrik