Little bit of outward current in IPSP

The basics of how to develop, test, and use models.
Post Reply
hyunn

Little bit of outward current in IPSP

Post by hyunn »

I simply linked NetStim and a HH neuron.

I made syn.e = -80 to make the synapse inhibitory.

I tried to measure net transmembrane current (ina + ik + il_hh)

And I see a little bit of positive current still.

How should it be removed?

is it a normal result?

The code is as following:

Code: Select all

// checking validity of inhibitory synapse

begintemplate Cell
public soma

create soma

proc init()	{
	x = $1
	y = $2
	z = $3
	d = $4
	
	create soma	
	
	soma	{
	nseg = 1
	diam = d	
	L = d		
	Ra = 150.0		
	insert hh 	
	
	pt3dclear()
	pt3dadd(x, y, z, d)
	pt3dadd(x+d, y, z, d)
		
	}
}
endtemplate Cell

objectvar neuron

neuron = new Cell(0, 0, 0, 20)

tstop = 500


objref Feedforward
Feedforward = new NetStim(0.5)
Feedforward.start = 200
Feedforward.interval = 40		// 2 Hz
Feedforward.number = tstop/40*1000
Feedforward.noise = 0

objref FFsyn
neuron.soma FFsyn = new Exp2Syn(0)
FFsyn.tau1 = 0.1
FFsyn.tau2 = 0.2
FFsyn.e = -80

objref FFcon
FFcon = new NetCon(Feedforward, FFsyn, 0.5, 0, 0.007)


objref apc0, apc1
neuron.soma apc0 = new APCount(0)


finitialize()
fcurrent()

objref g, h, gg
g = new Graph()
g.size(0,tstop,-80,40)
g.addvar("neuron.soma.v(0.5)")

h = new Graph()
h.size(0,tstop,-0.5,0.5)
h.addvar("FFsyn.i", 2, 0)

gg = new Graph()
gg.size(0,tstop,-0.02,0.02)
//gg.addvar("neuron.soma.i_cap(0.5)", 4, 0)
gg.addvar("neuron.soma.ik(0.5)", 4, 0)
gg.addvar("neuron.soma.il_hh(0.5)", 2, 0)
gg.addvar("neuron.soma.ina(0.5)", 3, 0)
gg.addexpr("ina+ik+il_hh", 1, 0)

g.begin()
h.begin()
gg.begin()
while (t<tstop) {
	fadvance()
	g.plot(t)
	h.plot(t)
	gg.plot(t)
}
g.flush()
h.flush()
gg.flush()



ted
Site Admin
Posts: 5784
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: Little bit of outward current in IPSP

Post by ted »

hyunn wrote:I tried to measure net transmembrane current (ina + ik + il_hh)
Sorry, that's total ionic current. You omitted capacitive current, which is called i_cap -- read about that in the Programmer's Reference under the documentation of the "capacitance" mechanism
http://www.neuron.yale.edu/neuron/stati ... ml#index-1
Net transmembrane current is ina + ik + il_hh + i_cap. That should get rid of the outward current.

Hint 1: NEURON comes with a powerful and flexible run time system that will take care of initialization and simulation execution, including initialization and updating of graphs. Put
load_file("nrngui.hoc")
at the start of your program (or if you don't want to see the NEURON Main Menu toolbar, load_file("stdgui.hoc")), and you'll be able to initialize and run a simulation with just one command:
run()
To make your graphs update automatically, append them to one of the standard run system's graphLists. graphList[0] will suffice for all of them, unless you're using the Crank-Nicolson integrator (secondorder = 1 or 2), in which case you'll want to use graphList[0] for the plot of membrane potential and graphList[1] for the plots of current.

The changes to your program would be:

1. get rid of these statements
finitialize()
fcurrent()

2. change
g.addvar("neuron.soma.v(0.5)")
to
g.addvar("neuron.soma.v(0.5)")
graphList[0].append(g)

3. change
h.addvar("FFsyn.i", 2, 0)
to
h.addvar("FFsyn.i", 2, 0)
graphList[0].append(g) // change to graphList[1] if secondorder is not 0

4. change
gg.addexpr("ina+ik+il_hh", 1, 0)
to
graphList[0].append(gg) // change to graphList[1] if secondorder is not 0

5. replace everything from g.begin() to gg.flush() with
run()

Result: you'll have less typing to do, and your program will be shorter and easier to read and debug.

Hint 2: To achieve maximum speed with fixed time step integration methods, NEURON uses a "staggered time step" algorithm. When secondorder==1 or 2, v is second order correct at t and i is second order correct at t-dt/2. When the default backwards Euler method is used (i.e. when secondorder == 0), each advance of the solution from t to t+dt begins by using v(t) to calculate i(t), then i(t) is used to update v from v(t) to v(t+dt), but the currents are not updated until the next time step. If you are using backward Euler integration and want to force updating of the currents, insert this procedure

Code: Select all

proc advance() {
  fadvance()
  fcurrent()
}
after the load_file("nrngui.hoc") statement but before the first time you call run().
Post Reply