conductance distribution

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

conductance distribution

Post by thats_karlo »

Hi,
I'm going to set different values for conductance in each compartment as follow:

Code: Select all

create A
A {L=100 diam=20 nseg=7}
insert pas
insert hh

A {                
      for (x){
            
                if (x==0){ 
                          gnabar_hh(x)= exp(-x*L+L)                          
                          print "x=",x,"          ",gnabar_hh(x)
                }else if (x==1){
                          gnabar_hh(x)= exp(-x*L+L/2)
                          print "x=",x,"          ",gnabar_hh(x)
                }else{  
                          gnabar_hh(x)= exp(-x*L+2*L)
                          print "x=",x,"          ",gnabar_hh(x)      
                }
                        
             }
    }
            
print "============================="

A {for (x) print "x=",x,"          ",gnabar_hh(x)  }     
but the results in the first loop and second one is not the same. do you have any idea why? did i make a mistake?
csh
Posts: 52
Joined: Mon Feb 06, 2006 12:45 pm
Location: University College London
Contact:

Re: conductance distribution

Post by csh »

thats_karlo wrote:

Code: Select all

create A
A {L=100 diam=20 nseg=7}
By specifying nseg=7, section A will have exactly 7 segments, no more and no less. Each of these segments will have one node at its midpoint "at which the voltage of the segment is defined", to cite from chapter 5 of the NEURON book. Although there are also terminal nodes at the 0 and 1 ends, "no membrane properties are associated with them so the voltage at these terminal nodes is defined by a simple algebraic equation (the weighted average of the potential at adjacent internal nodes) ..." (again, chapter 5). Hence, by specifying a range variable at a terminal node, you will in fact specify its value for the whole segment that this terminal end belongs to. In your example, you first specified gnabar_hh for the first segment (x == 0):

Code: Select all

if (x==0){ 
    gnabar_hh(x)= exp(-x*L+L)                          
    print "x=",x,"          ",gnabar_hh(x)      
}
and then, you overwrote this assignment during the next iteration of the loop (x == 0.5/7):

Code: Select all

} else {
    gnabar_hh(x)= exp(-x*L+2*L)
    print "x=",x,"          ",gnabar_hh(x)      
}
This means that gnabar_hh in the first segment had changed between the two calls to

Code: Select all

print "x=",x,"          ",gnabar_hh(x)
, which is why the second loop gave you a different output.
Christoph
Last edited by csh on Thu Dec 13, 2007 8:27 am, edited 1 time in total.
ted
Site Admin
Posts: 6305
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Post by ted »

Thank you, Christoph, that was an exellent explanation.
thats_karlo

Post by thats_karlo »

Thank you so much!
Post Reply