I tried to reproduce fig 10.2 in the NEURON book:
I created the pre and post cells using cell builder. (The precell is a basilar and the post cell is a soma), I used the specifications in the text, but was not sure what the length of the precell(basilar should be, as it is said to be a hermisphere) (If I used the circuference of the circle (l) to be 2*PI*r, for hermisphere, half the circle, it will be very small, as r is 0.5 which implies L= PI*0.5. Not being sure, I left L as 100um. I used the d'lambda of the cell builder for segmentation of both sections
The biophysical properties is as specified in the text, but I'm also not sure if the precell has either the hh or passive channels in addition to the cachan and cdp. Not being sure, I did not, include either. I saved the cell builder as a hoc file.
I created the instrumentation (syn (GradSyn)) and sinClamp using hoc file. Saved it
Using an initilazing file that has "load_file" I loaded the cell (created with cell builder), and the instrumentaion. There was no error.
I used the GUI to complete the instrumentation:ie create graphs and run the simulation, when I ran the simulation I have this error message:
at line 62 in file Calcium_Pump.mod:
BREAKPOINT { SOLVE state METHOD sparse
Error at section location precell(0.166667)
Convergence not achieved in maximum number of iterations
nrniv: scopmath library error
near line 20
{run()}
^
fadvance( )
advance( )
step( )
continuerun(200 )
and others
Please can you help to interprete the error and tell me what to do to fix it.
The calciumppump I inserted is the one created in example 9.9 of the NEURON book
Thank you
Irene
Simulating a model of graded synaptic transmission
Moderator: wwlytton

 Site Admin
 Posts: 5819
 Joined: Wed May 18, 2005 4:50 pm
 Location: Yale University School of Medicine
 Contact:
Re: Simulating a model of graded synaptic transmission
preterm (name of the section that is the presynaptic terminal) is described as "a 1 um diameter hemisphere" sonianwosuh wrote:was not sure what the length of the precell(basilar should be
volume = 1/2 * 4/3 * PI *(1/2)^3 = PI/12 um3
area = 1/2 * 4*PI*(1/2)^2 = PI/2 um2 (curved surface only; ignore the area of the flat face which in this model is presumed to be free of ion channels)
A section with length L and diameter diam has
volume = PI*L*(diam/2)^2 = PI*L*diam^2 / 4
area = PI*L*diam
so
diam = 4*volume/area = 2/3 um
L = area/PI/diam = 3/4 um
and surface/volume ratio is 6/um
But looking at the source code used to generate the figure I see that somehow the actual values employed were
diam = 1/PI/2 = 0.1591549 . . . um
L = 1 um
so the surface area of the presynaptic terminal was actually 0.5 um2
and its volume was 0.01989436 . . . um3
so surface/volume ratio was much largermore than 25.
This means that the computational model generated peak calcium concentrations that were too largemaybe more than 4 times too large. Ah, well, yet another item to fix in the second edition of The NEURON Book, and this one can't be blamed on the publisher (rats!).
No matter. For now it will be sufficient to plow ahead with the parameters that were used for Figure 10.2 as it stands.
nseg should be 1 for both the pre and postsynaptic compartments.I used the d_lambda of the cell builder for segmentation of both sections
The potential of preterm was clamped by an SEClamp with a low series resistance, so the only mechanisms that needed to be present were the calcium channel and the calcium accumulation mechanism.I'm also not sure if the precell has either the hh or passive channels in addition to the cachan and cdp. Not being sure, I did not, include either.
Do you mean that your pre and postsynaptic sections were actually part of the same model cell? In fact, attached to each other? That's not the way this model should be implemented. There should be two separate sections, not part of the same cell. The easiest way to do this is with hoc statements, e.g.I saved the cell builder as a hoc file.
Code: Select all
create preterm, postcell
preterm {
assign anat & biophys properties
}
postcell {
assign anat & biophys properties
}
Code: Select all
oc>topology()
 preterm(01)
 postcell(01)
OK with regard to the synapse, but how did you create the sinClamp? Did you find a mod file for a clamp that produced a sinusoidal command potential?I created the instrumentation (syn (GradSyn)) and sinClamp using hoc file.
Code: Select all
at line 62 in file Calcium_Pump.mod:
BREAKPOINT { SOLVE state METHOD sparse
Error at section location precell(0.166667)
Convergence not achieved in maximum number of iterations
So first thing to do is to use hoc to create the model sections, and make sure that the size and compartmentalization of the presynaptic terminal are correctand maybe that will help. Also let me know what you did to force presynaptic v to follow a sinusoidal time course.
Re: Simulating a model of graded synaptic transmission
Thank you for the explainatiions especially for reminding me the basic geometery.
Iinitially I had a basal dendrite attached to the soma, the basal dendrite being the precell that contains the cdp and cachan, andt he soma being the postcell.
With your explainations I have changed the geometry of the model to be two separate and unconnected sections,(tested with tolo() ) the precell, has L =100 (as L cacluated using r = 0.5 and using the geometry you called my attention to is still very small).Precell has cdp, and cachan with no other channels. All sections has cm specified and Ra of 100 (though not specified)
The postcell has both specified geometry and biophysical properties.
For the instrumentation, this is the code I used:
objref syn
postcell syn = new GradSyn(0.5)
setpointer syn.capre, precell.cai(0.5)
syn.k = 0.2
syn.e = 50
objref stim
precell stim = new SinClamp(0.8)
stim. del = 1
stim. dur = 200
stim. pkamp = 2.0
stim. freq = 5
stim.phase = 0
stim.bias = 0.
The SinClamp is the sinewave I got from the this forum (You referred me to the link sometime ago)
When I run the simulation this is the error message:
{ SOLVE state METHOD sparse
Error at section location precell(0.0454545)
Convergence not achieved in maximum number of iterations
nrniv: scopmath library error
near line 55
{run()}
^
fadvance( )
advance( )
step( )
continuerun(5 )
and others
Thank you
Irene
Iinitially I had a basal dendrite attached to the soma, the basal dendrite being the precell that contains the cdp and cachan, andt he soma being the postcell.
With your explainations I have changed the geometry of the model to be two separate and unconnected sections,(tested with tolo() ) the precell, has L =100 (as L cacluated using r = 0.5 and using the geometry you called my attention to is still very small).Precell has cdp, and cachan with no other channels. All sections has cm specified and Ra of 100 (though not specified)
The postcell has both specified geometry and biophysical properties.
For the instrumentation, this is the code I used:
objref syn
postcell syn = new GradSyn(0.5)
setpointer syn.capre, precell.cai(0.5)
syn.k = 0.2
syn.e = 50
objref stim
precell stim = new SinClamp(0.8)
stim. del = 1
stim. dur = 200
stim. pkamp = 2.0
stim. freq = 5
stim.phase = 0
stim.bias = 0.
The SinClamp is the sinewave I got from the this forum (You referred me to the link sometime ago)
When I run the simulation this is the error message:
{ SOLVE state METHOD sparse
Error at section location precell(0.0454545)
Convergence not achieved in maximum number of iterations
nrniv: scopmath library error
near line 55
{run()}
^
fadvance( )
advance( )
step( )
continuerun(5 )
and others
Thank you
Irene

 Site Admin
 Posts: 5819
 Joined: Wed May 18, 2005 4:50 pm
 Location: Yale University School of Medicine
 Contact:
Re: Simulating a model of graded synaptic transmission
Was there any earlier message similar to the following?nianwosuh wrote:When I run the simulation this is the error message:Code: Select all
{ SOLVE state METHOD sparse Error at section location precell(0.0454545) Convergence not achieved in maximum number of iterations . . .
Code: Select all
exp . . . out of range, returning exp(700)
This happens because SinClamp is a current clamp that delivers a current that is a sinusoidal function of time, and the maximum amplitude of this current has been set to 2 nAa very large current to inject into such a small cell. It forces preterm's membrane potential to a very large positive value, and there aren't any ionic currents strong enough to oppose itthe preterm compartment has only two ionic membrane currents, neither of which can generate a hyperpolarizing current big enough to counteract the depolarization forced by the SinClamp.
Even if no other current is injected into preterm, the predominance of cachan's current makes the compartment start to depolarize from the beginning of the simulation. This will eventually activate cachan's calcium conductance, producing a regenerative depolarization that pulls v up to ~ eca.
In an earlier msg you wondered if it was necessary to insert any other membrane currents into preterm; my answer was "no" but this is requires that preterm's membrane potential be controlled by a voltage clampwhich is the only way to compel preterm's membrane potential to follow a sinusoidal time course. This could be done with hoc by filling a Vector with the values of
50+20*sin(2*PI*f*i*dt/1000) where f is the frequency in Hz and i = 0, 1, 2 . . .
and then using the Vector class's play method to drive an SEClamp's amp1. This should do the job:
Code: Select all
f = 5 // Hz
objref cmd
cmd = new Vector(tstop/dt) // create a Vector of the required size
cmd.indgen // cmd contains i where i = 0, 1, 2 . . .
cmd.mul(2*PI*f*dt/1000) // dt/1000 because t is in ms
cmd.apply("sin") // contains sin(2*PI*f*i*dt/1000)
cmd.mul(20)
cmd.sub(50)
objref sec
preterm sec = new SEClamp(0.5)
sec.rs = 0.1 // make series resistance very low
sec.dur1 = 1e9
cmd.play(&sec.amp1, dt)
Re: Simulating a model of graded synaptic transmission
Thank you for the explainations. I have made the corrections you suggested, first I changed the amp of the SinClamp from 2.0nA to 0.1nA, I ran the simulation, this is the error msg generated:
"at line 62 in file Calcium_Pump.mod:
BREAKPOINT { SOLVE state METHOD sparse
Error at section location precell(0.1)
Convergence not achieved in maximum number of iterations
nrniv: scopmath library error
near line 54
{run()}
^
fadvance( )
advance( )
step( )
continuerun(5 )
and others"
Second I replaced the hoc code for the SinClamp I hade written in the program with the hoc code for the vector class play , exactly as you have it (copied and pasted ) "...and then using the Vector class's play method to drive an SEClamp's amp1. This should do the job...."
When I ran the simulation the error msg is the same as I have it above
"at line 62 in file Calcium_Pump.mod:
BREAKPOINT { SOLVE state METHOD sparse
Error at section location precell(0.1)
Convergence not achieved in maximum number of iterations
nrniv: scopmath library error
near line 57
{run()}
^
fadvance( )
advance( )
step( )
continuerun(5 )
and other."
Third, to be sure I did not make any mistake in copying the vector class 's play code as you have it,
I opened the hoc code I had written ealier that has the precell and postcell, without any SinClamp code or any code for any other external current written, so as to use the GUI to implement the SEClamp and use the sinewave to drive the SEClamp as you explained in the online course under "Model Control: Arbitrary forcing functions".
I ran the simulation, I have the same exact error as the above ones.
I'm still not sure what I am not doing right.
Thank you for you time and patience
"at line 62 in file Calcium_Pump.mod:
BREAKPOINT { SOLVE state METHOD sparse
Error at section location precell(0.1)
Convergence not achieved in maximum number of iterations
nrniv: scopmath library error
near line 54
{run()}
^
fadvance( )
advance( )
step( )
continuerun(5 )
and others"
Second I replaced the hoc code for the SinClamp I hade written in the program with the hoc code for the vector class play , exactly as you have it (copied and pasted ) "...and then using the Vector class's play method to drive an SEClamp's amp1. This should do the job...."
When I ran the simulation the error msg is the same as I have it above
"at line 62 in file Calcium_Pump.mod:
BREAKPOINT { SOLVE state METHOD sparse
Error at section location precell(0.1)
Convergence not achieved in maximum number of iterations
nrniv: scopmath library error
near line 57
{run()}
^
fadvance( )
advance( )
step( )
continuerun(5 )
and other."
Third, to be sure I did not make any mistake in copying the vector class 's play code as you have it,
I opened the hoc code I had written ealier that has the precell and postcell, without any SinClamp code or any code for any other external current written, so as to use the GUI to implement the SEClamp and use the sinewave to drive the SEClamp as you explained in the online course under "Model Control: Arbitrary forcing functions".
I ran the simulation, I have the same exact error as the above ones.
I'm still not sure what I am not doing right.
Thank you for you time and patience

 Site Admin
 Posts: 5819
 Joined: Wed May 18, 2005 4:50 pm
 Location: Yale University School of Medicine
 Contact:
Re: Simulating a model of graded synaptic transmission
At this point I can't come up with a likely diagnosis without seeing the codeif you zip up your hoc, mod, and ses files and email them to me, I'll take a look.