component LeakyIAF = struct binding construct V t gL vL Isyn C theta tspike spike Vreset trefractory refractory_end h = binding subthreshold_eq = [ D (V t h) = (((- gL) * (V - vL)) + Isyn) / C ] binding threshold_detect = [ spike = (V >= theta) ] binding tspike_assignment = [ tspike = if spike then t else tspike ] binding subthreshold_regime = Diagram.SEQUENCE subthreshold_eq (Diagram.SEQUENCE threshold_detect tspike_assignment) binding refractory_regime = [ [ V = Vreset ] [ refractory_end = (t >= (tspike + trefractory)) ] [ t = t + h ] ] return Diagram.RTRANSITION subthreshold_regime refractory_regime spike refractory_end end