Page 1 of 1

Strange problem during fitting process: is it a bug of nrn?

Posted: Mon Dec 19, 2011 3:25 pm
by Keivan
I have a mechanism in my model which calculates amplitude of EPSPs for me. I have non-uniform model so I have to initialize my model to the steady state (when t<0). My synapse become active at t = 10. this is my mechanism.

Code: Select all

NEURON {
    SUFFIX vmax
    RANGE vm, tm, vrest, amp
}

ASSIGNED {
	v		(millivolt)
	vm		(millivolt)
	vrest	(millivolt)
	amp		(millivolt)
	tm		(ms)
}

INITIAL {
	reset(v)
}

PROCEDURE reset(v (mV)) { : callable from hoc
	vm = v
	vrest = v
	amp = 0
}

BREAKPOINT { 
	if (v>vm && t>9.9) { 
		vm=v
		tm=t 
	}
	if (t>1 && t<9.9) { vrest = v }
	amp = vm - vrest
}
I have a simple fitting tool which tries to find the weight of synapse in which EPSP become a specific value.

Now my problem #1 is that when I change conductance of one of my channels from 3 to 1.5, EPSP amplitude reported by the above mechanism become a fixed value for different values of synaptic weight. when I plot the membrane potential I can see that for different values of synaptic weight different EPSP is produced in the model. Also, when I use a vector mechanism to record the membrane potential and then find the maximum value of membrane potential I can calculate value of EPSPs.
However, the vmax mechanism always report a fix value for amp when conductance of my channel is 1.5 or 2 or 1.7. then again when I change the conductance of the channel to 3, vmax mechanism works fine.

I am really confused. It seem there is sth wrong.

Problem #2 When I change morphology of my neuron, variable time step tool cause similar problem reported above.

If you want my idea, I think there is nasty bug in the neuron or my vmax mechanism.

Re: Strange problem during fitting process: is it a bug of n

Posted: Mon Dec 26, 2011 5:44 pm
by ted
Without more information, the source of the problem cannot be discovered. If you send source code (just hoc, ses, and mod files) to me
ted dot carnevale at yale dot edu
I will let you know what I discover.

Re: Strange problem during fitting process: is it a bug of n

Posted: Thu Jan 12, 2012 7:41 pm
by ted
I guess you figured out what was wrong and fixed it.

Re: Strange problem during fitting process: is it a bug of n

Posted: Fri Jan 13, 2012 12:22 pm
by Keivan
Actually no. As I told you before I found another temporary solution for my problem because I had to send the revision of my article as soon as possible. Still, I think there is sth wrong with NMODL. I delayed sending my model to you because I wanted to write a simple test code for you but I could not simplify the problem. I will send you a test code soon.

If you see the results it is obvious that NMODL do not differentiate between the negative time (t < 0) and positive time (t > 0).