/* ----------------------------------------------------------------
    Define the Axon Geometry
    
    Layer 5 cortical pyramidal cell has a long unmyelinated axon!
    Similar to Mainen et al (Neuron, 1995)
------------------------------------------------------------------*/ 


create ais[10],hill  // forward declaration

xopen("P_Hill_AIS.hoc")

proc create_axon() {

  //create ais[10],hill
  
  // Acquire the equivalent diameter of soma
  soma {  equiv_diam = sqrt(area(0.5)*nseg/(4*PI))  }   // "*nseg" is needed !!
  if (numarg()) equiv_diam = $1
  
  // Set axonal diameters
  diamAis=equiv_diam/10


hill {                							
    //L = 10							
    nseg = 10							
    diam(	0	:	0.25	) = 	6	:	3.8
    diam(	0.25	:	0.5	) = 	3.8	:	2.8
    diam(	0.5	:	0.75	) = 	2.8	:	1.7
    diam(	0.75	:	1	) = 	1.7	:	1.3
     							
  }							
				
							
for i=0,9 ais[i] {                 
    //L = 5
    nseg = 10
    diam = 1.22
  }

ais[0]	{						
    diam(	0	:	1	) = 	1.7	:	1.5
	}						
							
ais[1]	{						
    diam(	0	:	1	) = 	1.5	:	1.22
	}		  
	
	

  // Connecting
  
  soma connect hill(0), axonOnSoma       // dend11 -> soma(0) -> soma(1) -> hill
  hill connect ais[0] (0), 1      // hill -> ais[0]
  for i=0,8 ais[i] {              // ais[0] -> ... -> ais[9]
    connect ais[i+1] (0), 1
  }
//  ais[9] connect nakeaxon(0), 1        // ais[9] -> nakeaxon, set elsewhere


}