source: project/release/4/9ML-toolkit/trunk/examples/TestLeakyIAF.9ML @ 30917

Last change on this file since 30917 was 30917, checked in by Ivan Raikov, 6 years ago

9ML-toolkit: reformulation of regimes to use ON signal combinator; added LIF UL xml file; fixes to AEIF example

File size: 1.9 KB
Line 
1
2component S = Signal
3
4component LeakyIAF =
5struct
6
7 binding construct t V gL vL Isyn C theta tspike spike Vreset trefractory refractory_end rst h =
8
9        binding subthreshold_eq       = [ D (V t h) = (((- gL) * (V - vL)) + Isyn) / C ]
10        binding threshold_detect      = [ spike = (V >= theta) ]
11        binding tspike_assignment     = [ tspike = if spike then t else tspike ]
12        binding vreset_assignment     = [ V = Vreset ]
13        binding spike_assignments     = Diagram.SEQUENCE tspike_assignment vreset_assignment
14        binding subthreshold_regime   = Diagram.SEQUENCE subthreshold_eq (Diagram.SEQUENCE threshold_detect (Diagram.ON spike_assignments spike))
15        binding refractory_regime     = [
16                                          [ V = Vreset ]
17                                          [ refractory_end = (t >= (tspike + trefractory)) ]
18                                          [ t = t + h ]
19                                        ]
20        return Diagram.RTRANSITION subthreshold_regime refractory_regime spike refractory_end rst
21
22
23
24end
25
26component TestLeakyIAF =
27struct
28
29  binding diagram =
30    LeakyIAF.construct
31        ( S.realsig `t       (S.realconst 0.0 ))
32        ( S.realsig `V       (S.realconst -65.0 ))
33        ( S.realsig `gL      (S.realconst 0.2 ))
34        ( S.realsig `vL      (S.realconst -70.0 ))
35        ( S.realsig `Isyn    (S.realconst 20.0 ))
36        ( S.realsig `C       (S.realconst 1.0 ))
37        ( S.realsig `theta   (S.realconst -25.0 ))
38        ( S.realsig `tspike  (S.realconst 0.0 ))
39        ( S.boolsig `spike   (S.boolconst false ))
40        ( S.realsig `Vreset  (S.realconst -65.0 ))
41        ( S.realsig `trefractory (S.realconst 5.0 ))
42        ( S.boolsig `refractory_end (S.boolconst false ))
43        ( S.boolsig `rst     (S.boolconst false ))
44        ( S.realsig `h       (S.realconst 0.001 ))
45
46
47  binding TestLeakyIF = IVP.run diagram `t `h 0.0 100.0
48
49end
Note: See TracBrowser for help on using the repository browser.