Page 1 of 1

Gap junction between artificial cells, problem with fadvance

Posted: Fri Jul 27, 2007 11:16 am
by Nefeli
Hello,

I have used pointer to connect instances of my artificial cells with gaps with

setpointer ICOcells.ICO.Vgap, ICOcells[i+1].ICO.V

and included POINTER Vgap in the mod file.

The problem is that although I can plot ICOcells.ICO.Vgap at the hoc level, I can not use the variable Vgap within the mod file, for example include it in the differential equation for the membrane potential V.

I should note that I use a batch file of the style:

Code: Select all

integrate() {
finitialize()
fcurrent()
while (t<tstop) {
          fadvance()
(save data commands here)
}
doEvents()
}
Any help would be greatly appreciated!
Please find the mod code below:

Code: Select all

TITLE LIF model for Coupled Oscillator net

NEURON      { 
  POINT_PROCESS Oscillator
  RANGE I, we, wi, VV, refrac, event, inh, exc, nspike, tau, ggap
  GLOBAL ae, ai, epse, epsi, Vreset 
  POINTER Vgap
}

UNITS {
  (uA)= (microamp)
  (mV)= (millivolt)
  (uF)= (microfarad)
  (mS)= (millisiemens)
}

PARAMETER { 

:INPUT
I=1      :(uA/cm2)
tau=1

:SYNAPTIC PARAMETERS-RECURRENT
ae=0.2 
ai=0.2  
epse=1
epsi=1
we=1
wi=-1
        

:Initial values
VV=-1
Vreset=-1
refrac=0

:Gaps
ggap=1
}

ASSIGNED {
event
inh 
exc
nspike
Vgap

}

STATE { V gi si ge se Iexc Iinh Igap} 

BREAKPOINT {
SOLVE states METHOD runge
}

INITIAL {
V=VV
Iexc=0  
Igap=0

}

DERIVATIVE states {
  
:CELL
V' = -V/tau + epse*we*ge + epsi*wi*gi + I : + Vgap

:SYN
si'=-2*ai*si - ai*ai*gi
gi'=si
se'=-2*ae*se - ae*ae*ge
ge'=se
}


NET_RECEIVE (w) {

if (w==-1)        { si=si+ai*ai
                    inh=t
                   }
       
if (w==1)         { se=se+ae*ae
                    exc=t
                  } 

if (w==17)        { event=t
                    net_event(t+refrac)
                    nspike = nspike + 1  
                    V=Vreset    
                  }

}

Posted: Sat Jul 28, 2007 9:02 am
by ted
I can not use the variable Vgap within the mod file
Why not? What happens?

Posted: Sun Jul 29, 2007 8:42 am
by Nefeli
I get the following error message:

nrniv: Segmentation violation
in C:/Users/Margarita/Desktop/CoupledOsci/RUNSIM.hoc near line 50
^
fadvance( )
integrate( )


when for example I include Vgap in the ode
V' = -V/tau + epse*we*ge + epsi*wi*gi + I +Vgap

Posted: Sun Jul 29, 2007 9:50 am
by ted
V' = . . . + Vgap
establishes pretty tight coupling between V and Vgap. Is that what you really want?

I can't recall ever seeing a mod file for NEURON that uses runge. Why use that explicit
method, rather than cnexp?

Just out of curiosity: is there any particular reason for declaring Iexc Iinh Igap as STATEs
and then not using them for anything?

Posted: Sun Jul 29, 2007 12:37 pm
by Nefeli
I just added Vgap in V' for testing purposes, I'm planning to use something like

V'=....+g_gap(V-Vgap)

Iexc, Inh ang Igap were ment to be Iexc=we*ge, Iinh=wi*gi and Igap=g_gap(V-Vgap), so that I can plot or store them.

I used runge method since I was using the same in XPP and wanted to compare teh two simulations, otherwise I can use the cnexp.

The problem though is at the fadvance() when NEUROn crashes.

Posted: Sun Jul 29, 2007 12:52 pm
by ted
runge is an explicit integrator, not as robust as cnexp, and also not extensively tested in the
context of NEURON. What happens if you use cnexp instead of runge?

Posted: Sun Jul 29, 2007 1:34 pm
by Nefeli
I get the same error with cnexp

Posted: Sun Jul 29, 2007 3:39 pm
by ted
To diagnose the source of the error and suggest how to fix it, it will be necessary to
reproduce the model that generates the error message. Can you provide a minimal amount
of hoc code that will, when executed, produce the error message?

Posted: Tue Aug 14, 2007 10:13 am
by ted
I made a few changes to the NMODL source code for the sake of consistency of units
but the only "substantive" change from your original posted code was to make the
integration method be cnexp. Then built a toy net

Code: Select all

load_file("nrngui.hoc")

create dummy
access dummy

objref os1, os2
os1 = new Oscillator(0.5)
os2 = new Oscillator(0.5)

setpointer os1.Vgap, os2.V
setpointer os2.Vgap, os1.V
and was able to run a simulation without generating an error message. I'll email you a
zip file that includes a working example.

I don't see why your setpointer statements were so complex, but then I haven't seen
the rest of your hoc code either.

Posted: Tue Aug 14, 2007 10:50 am
by Nefeli
Thank you very much for your help!

It seems I didn't set up the pointer in the hoc file for all N instances of the artificial neuron.

Posted: Tue Aug 14, 2007 11:30 am
by ted
Good luck with your project--that's an interesting approach to modeling integrate and fire
cells. Be sure to let me know when you publish, so we can add your paper to the NEURON
bibliography http://www.neuron.yale.edu/neuron/bib/usednrn.html
ted dot carnevale at yale dot edu