(* Brunel (2000) Model A Integrate-and-fire model *) component BrunelIaFdelta = struct binding construct t V Vreset tau theta tau_rp spike rpend rpstate tspike Isyn R h = binding subthreshold_V_eq = [ D (V t h) = (((- V) + (R * Isyn)) / tau) ] binding threshold_detect = [ spike = (V >= theta) ] binding tspike_set = [ tspike = (if spike then t else tspike) ] binding subthreshold_regime = Diagram.SEQUENCE subthreshold_V_eq (Diagram.SEQUENCE threshold_detect tspike_set) binding refractory_assignments = [ [ V = Vreset ] [ spike = false ] [ rpend = (t >= (tspike + tau_rp)) ] [ t = t + h ] ] return Diagram.RTRANSITION subthreshold_regime refractory_assignments spike rpend rpstate end component S = Signal component TestBrunelIaFdelta = struct val h = S.realsig `h (S.realconst 0.01) (* Parameters common to all spiking regimes *) val Vreset = S.realsig `Vreset (S.realconst 10.0) val tau = S.realsig `tau (S.realconst 20.0) val theta = S.realsig `theta (S.realconst 20.0) val tau_rp = S.realsig `tau_rp (S.realconst 2.0) val Isyn = S.realsig `Isyn (S.realconst 0.0) val R = S.realsig `R (S.realconst 20.0) (* State initial values *) val t = S.realsig `t (S.realconst 0.0) val V = S.realsig `V (S.realconst 0.0) val tspike = S.realsig `tspike (S.realconst 0.0) val spike = S.boolsig `spike (S.boolconst false) val rpend = S.boolsig `rpend (S.boolconst false) val rpstate = S.boolsig `rpstate (S.boolconst false) val TestBrunelIaFdelta_fn = BrunelIaFdelta.construct t V Vreset tau theta tau_rp spike rpend rpstate tspike Isyn R h val TestBrunelIaFdelta = IVP.construct TestBrunelIaFdelta_fn `t `h 0.0 800.0 end