NEURON BOOK Chapter 8 (Initializing the mechanism)

The basics of how to develop, test, and use models.
Post Reply
nianwosuh
Posts: 39
Joined: Tue Jul 27, 2010 11:00 pm

NEURON BOOK Chapter 8 (Initializing the mechanism)

Post by nianwosuh »

I am working through the chapter eight of the NEURON book, sec 8.4.4.2 and repeating the hoc codes in the chapter as to help me understand what is being discussed in that chapter but I am running into difficulties, please I will need some help to understand the excericses.

I created the mod file of the "capmp" wrote the hoc code for one compartment (soma), inserted hh, and capmp into it., ran the simulation and plotted the graph of the time course of Cashell (cashell) and pump current (IIcapump). Saved all in a session file for ease of retrieval

As to help me understnad how the initialization of ca_init affects the time course of the parameters (plotted above).

I wrote the hoc code (called it initiCa) you have in the book (but only defined and assigned value for ca_init )as shown below :
objref ca_init

cashell = ca_init

ca_init = 0.2

proc init() {
cashell_capmp = ca_init
finitalize(v_init)
}

When I open the saved session file described above and then load the hoc "initiCa.hoc", and ran the simulation it gives me error message :
"bad stack access: expecting (double); really (Unknown)
nrniv: interpreter stack type error
in initia1.hoc near line 3
cashell = ca_init"

I have no clue what that means and what I have done wrong, If Itry to change the value of the ca_init from the interpreter, it closes (which confirms to me that there is an error)

Though the above initilaization method was not supposed to have any effect on the time course of the cashell and pump current as explained, but I have the same result when I load this version of the initiCa.hoc:
objref ca_init
ca_init = 0.4
proc init() {
finitialize(v_init)
cashell_capmp = ca_init

// we've change a state, so the following are needed

if (cvode.active()) {

cvode.re_init()

} else {

fcurent()

}
frecod_init()
}

Please I will appreciate you help to understand what I have not done right.

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

Re: NEURON BOOK Chapter 8 (Initializing the mechanism)

Post by ted »

Code: Select all

bad stack access: expecting (double); really (Unknown)
nrniv: interpreter stack type error
 in initia1.hoc near line 3
 cashell = ca_init
That's because cashell and ca_init have incompatible data types.

Code: Select all

objref  ca_init
tells NEURON that ca_init is an objref (a pointer to an instance of some object class)

Code: Select all

cashell = ca_init
If this is the first appearance of the name cashell, NEURON will automatically treat it as a double precision floating point number (AKA a double).

The problem will go away if you delete the declaration

Code: Select all

objref ca_init
and instead just assign a numerical value to ca_init.

The statement
cashell = ca_init
doesn't do anything useful and can be omitted. The only cashell that means anything in the example is the cashell that belongs to the capmp mechanism; this variable is known to hoc as cashell_capmp. The hoc statement
cashell = ca_init
merely creates a new double called cashell, but it isn't related to the capmp mechanism's cashell.
Though the above initilaization method was not supposed to have any effect on the time course of the cashell and pump current as explained, but I have the same result when I load this version of the initiCa.hoc:
objref ca_init
ca_init = 0.4
proc init() {
finitialize(v_init)
cashell_capmp = ca_init

// we've change a state, so the following are needed

if (cvode.active()) {

cvode.re_init()

} else {

fcurent()

}
frecod_init()
}
I'm not sure I understand "I have the same result" What result?
nianwosuh
Posts: 39
Joined: Tue Jul 27, 2010 11:00 pm

NEURON BOOK Chapter Listings 9.8 and 9.9

Post by nianwosuh »

Please can you check the codes of cadifus (calcium diffusion) of listing 9.8 in NEURON book. Itried to compile the mod file but it gives this error message :
syntax error:
Illegal expression:
Illegal reaction syntax:
Illegal integer expression:
FROM intvar = intexpr TO intexpr BY intexpr { statements }:
Illegal block at line 100 in file Calcium_Diffusiion.mod
~ ca + Buffer <-> CaBuffer (k1buf*dsgvol, \
^

The arrow is on the "backward slash "\"" is this correct.? I have not understood how to write the kinetics very well, so I'm not sure what that is supposed to be.

I have a similar error message when I tried to compile cdp (Calcium pump) after I have made the appropriate changes
Illegal reaction syntax:
Illegal block at line 117 in file Calcium_Pump.mod
~ ca[0] + pump <-> pumpca (k1*parea*(1e10), \
^

Thank you
Irene
nianwosuh
Posts: 39
Joined: Tue Jul 27, 2010 11:00 pm

Re: NEURON BOOK Chapter 8 (Initializing the mechanism)

Post by nianwosuh »

Thank you! It works now!

Thank you
Irene
nianwosuh
Posts: 39
Joined: Tue Jul 27, 2010 11:00 pm

Re: NEURON BOOK Chapter 8 (Initializing the mechanism)

Post by nianwosuh »

Please I am thanking you for your explaination for Chapter 8, not for chap 9, I have not resolved that yet.
Irene
ted
Site Admin
Posts: 6289
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: NEURON BOOK Chapter Listings 9.8 and 9.9

Post by ted »

nianwosuh wrote:Please can you check the codes of cadifus (calcium diffusion) of listing 9.8 in NEURON book. Itried to compile the mod file but it gives this error message :
syntax error:
Illegal expression:
Illegal reaction syntax:
Illegal integer expression:
FROM intvar = intexpr TO intexpr BY intexpr { statements }:
Illegal block at line 100 in file Calcium_Diffusiion.mod
~ ca + Buffer <-> CaBuffer (k1buf*dsgvol, \
^

The arrow is on the "backward slash "\""

Yes, and the arrow points to the cause of the error. This was my mistake. Just get rid of the backslash and the code should compile without a problem.

Explanation: when laying out the source code for the book, this line was too long to fit so I broke it after the comma, and inserted a backslash out of habit. Backslash is the "line continuation character" for many programming languages, but NMODL doesn't use "line continuation characters"--statements can continue over several lines without any special notation. Thanks for mentioning this; the error will be corrected in the next edition of the NEURON Book.
nianwosuh
Posts: 39
Joined: Tue Jul 27, 2010 11:00 pm

Re: NEURON BOOK Chapter 8 (Initializing the mechanism)

Post by nianwosuh »

Thank you! It is taken care of.

Irene
Post Reply