//steady state  initialization of simulation according to
//http://www.neuron.yale.edu/phpBB/viewtopic.php?f=13&t=2225&p=8541&hilit=initialize+cvode#p8541


INITDUR = 300 // # ms to reach steady state

proc init() { local temp

  finitialize(v_init)
  t = -2*INITDUR // jump to a time "before" 0
  temp = cvode.active()
  if (temp != 0) { // if cvode is on, turn it off
    cvode.active(0)
    dt = 0.004
  }
  while (t < -INITDUR) {
    fadvance()
  }
  if (temp != 0) { cvode.active(1) } // turn cvode back on if necessary
  t = 0
  if (cvode.active()) {
    cvode.re_init()
  } else {
    fcurrent()
  }
  frecord_init()

}