How to use area(x) and L

The basics of how to develop, test, and use models.
Post Reply
CCohen
Posts: 27
Joined: Thu Apr 26, 2012 8:41 am

How to use area(x) and L

Post by CCohen »

Hi,

Very basic question... still learning how to talk to NEURON...

Wondering how to get lengths and areas of segments that are subsections of a section in the oc> prompt.

So for example, I wish to know the area of segments 0-5 of a given section that has 100 segments. How would I ask the oc> prompt for this information?

Something like:

finitialize()
_sum = 0
forsec SectionName for ?? _sum+= area(?)
_sum

Similarly for L, which I understand works a little differently from area(x)...

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

Re: How to use area(x) and L

Post by ted »

It would be useful to read chapters 5 and 6 of The NEURON Book. If you don't have the book, try
"The NEURON simulation environment" (not the "overview") and "NEURON: a tool for neuroscientists,"
both of which are available from http://www.neuron.yale.edu/neuron/docs. Let me also suggest the Programmer's Reference entry on nseg.
charles1 wrote:I wish to know the area of segments 0-5 of a given section that has 100 segments.
An aside: after reading about nseg you'll see why you might want to use an odd value for nseg.
Now for your question.

secname for (x,0) print x, area(x)
where secname is the name of the section
will tell you everything about segment areas.

If you want to know the total area of the first n segments

Code: Select all

func arean() { localobj tobj
  tobj = new Vector()
  for (x,0) tobj.append(area(x))
  return tobj.sum(0,$1-1)
}
foo arean(4) // print total area of the first 4 segments of the section called foo
This has no bulletproofing against arguments valued < 1.

All segments in a section have equal length. The total length of the first i segments of a section is i*L/nseg, where i lies in the range [1..nseg].

Note that NEURON computes the values of range variables at internal nodes, where each node is located at the midpoint of its segment. Membrane potential v is special in the sense that its value at the 0 or 1 end of a section depends not only on the potential at the adjacent internal node of that section, but also on the boundary condition at that point i.e. whether any other sections or signal sources (e.g. SEClamp, IClamp, synaptic mechanism) are attached to that point.
CCohen
Posts: 27
Joined: Thu Apr 26, 2012 8:41 am

Re: How to use area(x) and L

Post by CCohen »

I created a bunch of segments that comprise a section with Neuroleucida. I import my morphology into NEURON and implement an nseg strategy based on d_lambda... It is the area of a subset of these bunch of segments that I still wish to obtain.

I have understood how to use L: if I want the total length of any given subset of segments of a section, I write in the oc prompt the following:

print secname[0].L + secname[1].L ++


I still do not understand how to do the same with area(x), even with what you wrote:
ted wrote:secname for (x,0) print x, area(x)
where secname is the name of the section
will tell you everything about segment areas.
I do not understand how to use this to obtain the area of a subset of segments of my section.

I do not understand what area is returned in "secname for (x,0) print x, area(x)." For example, the only parameter I can change is the "0" in (x,0), yet the area printed is always the same... secname for (x,0) print x, area(x) = secname for (x,1) print x, area(x)... any other variation does not work...

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

Re: How to use area(x) and L

Post by ted »

Time to make a very simple model, specified in hoc, and play with the code until you understand what's going on. You might start with

Code: Select all

load_file("nrngui.hoc")
create soma
access soma
soma {
  L = 10
  diam = 1
}
Use this simple model to figure out what total area is, what segment area should be for different values of nseg, etc.
Post Reply