

 Download zip file   Auto-launch 
Help downloading and running models
Citations  Citation Browser
Model Type: Neuron or other electrically excitable cell;
Brain Region(s)/Organism:
Cell Type(s): Hippocampus CA1 pyramidal GLU cell;
Gap Junctions:
Simulation Environment: NEURON;
basic_graphics.hoc *
basic-graphics.hoc *
choose-secs.hoc *
current-balance.hoc *
cut-sections.hoc *
deduce-ratio.hoc *
find-gmax.hoc *
GABA_shiftsyn.hoc *
GABA_shiftsyn_bg.hoc *
ken.h *
map-segments-to-3d.hoc *
maxmin.hoc *
mod_func.c *
newshiftsyn.c *
newshiftsyn.exe *
num-rec.h *
salloc.hoc *
shiftsyn-init_bg.hoc *
shiftsyn-initA.hoc *
shiftsyn-initA.hoc~ *
spikecount.hoc *
tune-epsps.hoc *
vector-distance.hoc *
verbose-system.hoc *
// This function is used to calculate the AMPA coductance values 
// such that a single pulse stimulus gives rise to a 5mV local depolarization 
// at every synapse location along the cell (each synapse has both an AMPA and an NMDA mechanism).
// AMPA values for each location tested, along the sections tested are saved in the tune_epsp_list

strdef fast_file
strdef sec_str, recstr, tuning_code
objref epsp_glu, epsp_nmda, vmvec, epsp_ic, tmpvec

proc tune_epsp_fast () { 
//  printf("proc tune_epsp_fast (%s.v(%g))\n", secname(), $2)

  R = $2                 //  synapse location
  epsp_glu  = new GLU(R)
  epsp_nmda = new NMDA(R)
  tuned = 0             //  initial values before tuning
  old_GMAX = 0
  while (!tuned) {

   epsp_glu.gmax  = GMAX     // previously calculated maximum AMPA conductance
   epsp_nmda.gmax = GMAX*NMDA_AMPA_RATIO  // maximum NMDA conductance 

   fakecell {                            // single shock current injection to a fake cell
     epsp_ic = new IClamp(0.5)           
     epsp_ic.amp = 1
     epsp_ic.dur = 1
     epsp_ic.del = 0.1*tstop

   setpointer epsp_glu.pre,  epsp_ic.i
   setpointer epsp_nmda.pre, epsp_ic.i

   tmpvec = new Vector(tstop/dt)
   sprint(recstr, "tmpvec.record(&%s.v(%g))", secname(), R) // record depolarization at synapse

   vmvec = tmpvec.c
   // test if resulting depolarization is closed to the desired value (5mV)

   if (epsilon_equal(vmvec.max(),desired_voltage,$3)) {
     tuned = 1  // if yes, stop         

   } else {     // if no, update the GMAX value and test again

     diffa = desired_voltage-BASELINE
     diffb = vmvec.max()-BASELINE
     ratio = diffa/diffb
     GMAX = GMAX*ratio

     print "\t\tnew GMAX: ", GMAX

 sprint(tuning_code,"%s tune_epsp_list.append(new EPSPTuning(\"%s\",%f,%f,1))", secname(), secname(), x, GMAX)
 $o4.printf("%s\n", tuning_code)


// test if difference between desired and actual voltage is smaller than epsilon

func epsilon_equal() {
  printf("epsilon_equal(%f,%f,%f)\n", $1,$2,$3)
  diff = ($1-$2)
  if (abs(diff) < $3) {
  } else {