source: project/release/4/nemo/trunk/examples/Golgi/Golgi_DeSouza10.nemo @ 31355

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

nemo: fixed SK2 rate constant units

File size: 88.9 KB
Line 
1
2;; Simoes de Souza FM and De Schutter E (2011) Robustness effect of
3;; gap junctions between Golgi cells on cerebellar cortex
4;; oscillations.  Neural Systems & Circuits 1:7.
5
6(nemo-model Golgi
7
8  (
9   (input (v (unit mV))
10          (celsius (unit degC)))
11
12   (const F = 96485.309)
13   (const R = 8.31342)
14
15   (defun ktf (celsius) (1000.0 * R * (celsius + 273.15) / F ))
16
17   (defun nernst (celsius ci co z)
18     (if (ci <= 0)
19         then 1e6
20         else (if (co <= 0)
21                  then -1e6
22                  else (ktf (celsius) / z * (ln (co / ci))))
23         ))
24   
25
26   (component (type defaults)
27      (const V_t     =  -35  (unit mV))
28      (const celsius =   23  (unit degC))
29      (const Ra      = 0.01  (unit ohm.cm))
30      (output celsius V_t Ra)
31      )
32
33
34   (component (type membrane-capacitance)
35         (const c = 1 (unit uf/cm2))
36         (output c )
37         )
38
39
40   (component (type geometry) (name soma)
41         (const L = 27    (unit um))
42         (const diam = 27 (unit um))
43         (output L diam ))
44
45
46   (component (type post-synaptic-conductance) (name AMPA)
47
48        (input (w from event (unit uS)))
49
50        (const tauA = 0.03 (unit ms)) ;; rise time
51        (const tauB = 0.5  (unit ms)) ;; decay time
52
53        (const  e = 0 (unit mV))
54
55        (const tau1 = (if ((tauA / tauB) > .9999) then (0.9999 * tauB) else tauA) (unit ms))
56        (const tau2 = tauB (unit ms))
57
58        (const tp = ((tau1 * tau2) / (tau2 - tau1) * ln (tau2 / tau1)))
59        (const scale_factor  = (1 / (neg (exp(neg (tp) / tau1)) + exp (neg (tp) / tau2))))
60
61        (transient (A) = (neg (A) / tau1) (onevent (A + (w * scale_factor))) (initial 0) (unit uS))
62        (transient (B) = (neg (B) / tau2) (onevent (B + (w * scale_factor))) (initial 0) (unit uS))
63
64        (g =  (B - A) (unit uS))
65
66        (output g e scale_factor)
67
68      )
69
70   (component (type decaying-pool) (name ca)
71
72      (input (ica from ion-currents))
73
74      (const  d       = 0.2  (unit um))
75      (const  cao     = 2.0  (unit mM))
76      (const  cai0    = 5e-5 (unit mM))
77      (const  beta    = 1.3  (unit /ms))
78     
79      (d (ca) =  ((neg (ica) / (2 * F * d)) * 1e4 -
80                  (beta * (ca - cai0)))
81         (initial cai0))
82     
83      (output ca cao)
84      )
85
86
87   (component (type decaying-pool) (name ca2)
88
89      (input (ica2 from ion-currents))
90
91      (const valence  = 2)
92      (const  d       = 0.2  (unit um))
93      (const  ca2o    = 2.0  (unit mM))
94      (const  ca2i0   = 5e-5 (unit mM))
95      (const  beta    = 1.3  (unit /ms))
96     
97      (d (ca2) =  ((neg (ica2) / (2 * F * d)) * 1e4 -
98                   (beta * (ca2 - ca2i0)))
99         (initial ca2i0) (unit mM))
100     
101      (output ca2 ca2o valence)
102      )
103
104
105   (component (type decaying-pool) (name naconc)
106
107      (input (ina from ion-currents))
108
109      (const  d       = 0.2   (unit um))
110      (const  nao0    = 140.0 (unit mM))
111      (const  nai0    = 5.0   (unit mM))
112      (const  beta    = 0.075 (unit /ms))
113     
114      (d (nai) =  ((neg (ina) / (2 * F * d)) * 1e4 - (beta * (nai - nai0)))
115         (initial nai0) (unit mM))
116     
117      (d (nao) =  ((ina / (2 * F * d)) * 1e4 - (beta * (nao - nao0)))
118         (initial nao0) (unit mM))
119
120      (component (type accumulating-ion) (name na))
121     
122      (output nai nao)
123      )
124
125
126   (component (type decaying-pool) (name k)
127
128      (input (ik from ion-currents))
129
130      (const  d       = 0.2   (unit um))
131      (const  ko0     = 5.0   (unit mM))
132      (const  ki0     = 140.0 (unit mM))
133      (const  beta    = 0.075 (unit /ms))
134     
135      (d (ki) =  ((neg (ik) / (2 * F * d)) * 1e4 - (beta * (ki - ki0)))
136         (initial ki0) (unit mM))
137     
138      (d (ko) =  ((ik / (2 * F * d)) * 1e4 - (beta * (ko - ko0)))
139         (initial ko0) (unit mM))
140
141      (component (type permeating-ion) (name k)
142                         (e = (nernst (celsius ki ko 1)) (unit mV))
143                         (output e ))
144
145     
146      (output ki ko)
147      )
148
149
150   (component (type ionic-current) (name CaHVA )
151             
152      (input
153       (cai from ion-pools)
154       (cao from ion-pools))
155             
156      (component (type gate)
157
158                 ;; rate constants
159                 
160                 (Q10 = (pow (3 ((celsius - 20) / 10))))
161                 
162                 (const Aalpha_s  = 0.04944 (unit /ms))
163                 (const Kalpha_s  = 15.87301587302 (unit mV))
164                 (const V0alpha_s = -29.06 (unit mV))
165                 
166                 (const Abeta_s  = 0.08298 (unit /ms))
167                 (const Kbeta_s  = -25.641 (unit mV))
168                 (const V0beta_s = -18.66  (unit mV))
169                 
170                 (const Aalpha_u  = 0.0013  (unit /ms))
171                 (const Kalpha_u  = -18.183 (unit mV))
172                 (const V0alpha_u = -48     (unit mV))
173                 
174                 (const Abeta_u   = 0.0013  (unit /ms))
175                 (const Kbeta_u   = 83.33   (unit mV))
176                 (const V0beta_u  = -48     (unit mV))
177                 
178                 ;; rate functions
179                 
180                 (defun alpha_s (v Q10)
181                   (Q10 * Aalpha_s * exp ((v - V0alpha_s) / Kalpha_s)))
182                 
183                 (defun beta_s (v Q10)
184                   (Q10 * Abeta_s * exp ((v - V0beta_s) / Kbeta_s)))
185                 
186                 (defun alpha_u (v Q10)
187                   (Q10 * Aalpha_u * exp ((v - V0alpha_u) / Kalpha_u)))
188                 
189                 (defun beta_u (v Q10)
190                   (Q10 * Abeta_u * exp ((v - V0beta_u) / Kbeta_u)))
191
192                 (s_inf = ((alpha_s (v Q10)) / (alpha_s (v Q10) + beta_s (v Q10))))
193                 (tau_s = (1 / (alpha_s (v Q10) + beta_s (v Q10)) ) (unit ms))
194
195                 (u_inf = ((alpha_u (v Q10)) / (alpha_u (v Q10) + beta_u (v Q10)) ))
196                 (tau_u = (1 / (alpha_u (v Q10) + beta_u (v Q10)) ) (unit ms))
197
198                 (hh-ionic-gate
199                  (CaHVA  ;; ion name: exported variables will be of the form {ion}_{id}
200                   (initial-m  s_inf)
201                   (initial-h  u_inf)
202                   (m-power    2)
203                   (h-power    1)
204                   (m-inf      s_inf)
205                   (m-tau      tau_s)
206                   (h-inf      u_inf)
207                   (h-tau      tau_u)
208                   ))
209                 
210                 )
211             
212              (component (type pore)
213                         (const  gbar  = 460e-6 (unit S/cm2))
214                         (output gbar ))
215             
216              (component (type permeating-ion) (name ca)
217                         (e = (nernst (celsius cai cao 2)) (unit mV))
218                         (output e)
219                         )
220             
221              ) ;; end CaHVA current
222
223
224   (component (type voltage-clamp) (name CaHVA)
225             
226              (const vchold   = -71)
227              (const vcbase   = -69)
228              (const vcinc    = 10)
229              (const vcsteps  = 8)
230              (const vchdur   = 30)
231              (const vcbdur   = 100)
232
233              (component (type default-concentration) (name ca)
234                      (const cn       = 5e-5)
235                      (const cnout    = 2)
236                      (output cn cnout))
237             
238              (output vchold vcbase vcinc vcsteps vchdur vcbdur)
239              )
240
241   
242   (component (type ionic-current) (name CaLVA )
243             
244      (input
245       (ca2i from ion-pools)
246       (ca2o from ion-pools))
247
248      (component (type gate)
249
250                 (const shift   = 2 (unit mV)) ; screening charge for Ca_o = 2 mM
251                 
252                 (const v0_m_inf = -50  (unit mV))
253                 (const v0_h_inf = -78  (unit mV))
254                 (const k_m_inf  = -7.4 (unit mV))
255                 (const k_h_inf  = 5.0  (unit mV))
256       
257                 (const C_tau_m   = 3)
258                 (const A_tau_m   = 1.0)
259                 (const v0_tau_m1 = -25  (unit mV))
260                 (const v0_tau_m2 = -100 (unit mV))
261                 (const k_tau_m1  = 10   (unit mV))
262                 (const k_tau_m2 = -15   (unit mV))
263                 
264                 (const C_tau_h   = 85)
265                 (const A_tau_h   = 1.0  (unit mV))
266                 (const v0_tau_h1 = -46  (unit mV))
267                 (const v0_tau_h2 = -405 (unit mV))
268                 (const k_tau_h1  = 4    (unit mV))
269                 (const k_tau_h2  = -50  (unit mV))
270                         
271                 ;; rate functions
272                 
273                 (phi_m = (pow (5.0 ((celsius - 24) / 10))))
274                 (phi_h = (pow (3.0 ((celsius - 24) / 10))))
275                 
276                 (m_inf = (1.0 / ( 1 + exp ((v + shift - v0_m_inf) / k_m_inf)) ))
277                 (h_inf = (1.0 / ( 1 + exp ((v + shift - v0_h_inf) / k_h_inf)) ))
278                 
279                 (tau_m = ( (C_tau_m + A_tau_m / ( exp ((v + shift - v0_tau_m1) / k_tau_m1) +
280                                                       exp ((v + shift - v0_tau_m2) / k_tau_m2) ) ) / phi_m)
281                        (unit ms))
282                 
283                 (tau_h = ( (C_tau_h + A_tau_h / ( exp ((v + shift - v0_tau_h1 ) / k_tau_h1) +
284                                                       exp ((v + shift - v0_tau_h2) / k_tau_h2) ) ) / phi_h)
285                        (unit ms))
286                 
287
288                 (hh-ionic-gate
289                  (CaLVA  ;; ion name: exported variables will be of the form {ion}_{id}
290                   (initial-m  m_inf)
291                   (initial-h  h_inf)
292                   (m-power    2)
293                   (h-power    1)
294                   (m-inf      m_inf)
295                   (m-tau      tau_m)
296                   (h-inf      h_inf)
297                   (h-tau      tau_h)
298                   ))
299                 )
300     
301     
302      (component (type pore)
303                 (const  gbar  = 2.5e-4 (unit S/cm2))
304                 (output gbar ))
305
306             
307      (component (type permeating-ion) (name ca2)
308                 (const valence = 2)
309                 (e = (nernst (celsius ca2i ca2o valence)) (unit mV))
310                 (output e valence))
311
312             
313      ) ;; end CaLVA current
314
315
316
317   (component (type voltage-clamp) (name CaLVA)
318             
319              (const vchold   = -71)
320              (const vcbase   = -69)
321              (const vcinc    = 10)
322              (const vcsteps  = 8)
323              (const vchdur   = 200)
324              (const vcbdur   = 30)
325
326              (component (type default-concentration) (name ca2)
327                      (const cn       = 5e-5)
328                      (const cnout    = 2)
329                      (output cn cnout))
330             
331              (output vchold vcbase vcinc vcsteps vchdur vcbdur)
332              )
333
334
335     
336   (component (type ionic-current) (name HCN1)
337
338              (const Ehalf = -72.49 (unit mV))
339              (const c     = 0.11305 (unit /mV))
340             
341              (const rA = 0.002096 (unit /mV))
342              (const rB = 0.97596 )
343             
344              (defun r (potential)
345                ((rA * potential) + rB))
346             
347              (defun tau (potential t1 t2 t3)
348                (exp (((t1 * potential) - t2) * t3)))
349             
350              (defun o_inf (potential Ehalf c)
351                (1 / (1 + exp ((potential - Ehalf) * c))))
352             
353
354              (component (type gate)
355
356                         ;; rate constants
357       
358                         (const tCs = 0.01451)
359                         (const tDs = -4.056 (unit mV))
360                         (const tEs = 2.302585092 (unit /mV))
361
362                         (o_slow_inf = ((1 - r (v)) * o_inf (v Ehalf c)))
363                       
364                         (tau_s =  (tau (v tCs tDs tEs)) )
365
366                         (d (o_slow) = ((o_slow_inf - o_slow) / tau_s)
367                            (initial o_slow_inf))
368                         
369                         (output o_slow)
370
371                         )
372             
373              (component (type gate)
374                         
375
376                         ;; rate constants
377       
378                         (const tCf = 0.01371)
379                         (const tDf = -3.368      (unit mV))
380                         (const tEf = 2.302585092 (unit /mV))
381
382                         (o_fast_inf = (r (v) * o_inf (v Ehalf c)))
383                       
384                         (tau_f =  (tau (v tCf tDf tEf)) (unit ms))
385
386                         (d (o_fast) = ((o_fast_inf - o_fast) / tau_f)
387                            (initial o_fast_inf))
388                         
389                         (output o_fast)
390
391                         )
392             
393              (component (type pore)
394                         (const  gbar  = 5e-5 (unit S/cm2))
395                         (output gbar))
396             
397              (component (type permeating-ion) (name non-specific)
398                         (const e = -20 (unit mV))
399                         (output e ))
400             
401              ) ;; end HCN1 current
402
403
404             
405   (component (type voltage-clamp) (name HCN1)
406             
407              (const vchold   = -71)
408              (const vcbase   = -69)
409              (const vcinc    = 10)
410              (const vcsteps  = 8)
411              (const vchdur   = 30)
412              (const vcbdur   = 100)
413             
414              (output vchold vcbase vcinc vcsteps vchdur vcbdur)
415              )
416
417
418     
419   (component (type ionic-current) (name HCN2)
420                         
421
422              (const Ehalf = -81.95 (unit mV))
423              (const c     = 0.1661 (unit /mV))
424             
425              ;; rate constants
426
427              (const rA = -0.0227 (unit /mV))
428              (const rB = -1.4694 )
429
430              (defun r (potential r1 r2)
431                (if (potential >= -64.70)
432                    then  0.0
433                    else (if (potential <= -108.70)
434                             then 1.0
435                             else (r1 * potential) + r2)))
436
437              (defun o_inf (potential Ehalf c)
438                (1 / (1 + exp((potential - Ehalf) * c))))
439             
440              (component (type gate)
441                         
442                         ;; rate constants
443                         
444                         (const tCs = 0.0152 )
445                         (const tDs = -5.2944 (unit mV))
446                         (const tEs = 2.3026  (unit /mV))
447                         
448                         (defun tau_slow (potential t1 t2 t3)
449                           (exp (t3 * ((t1 * potential) - t2))))
450
451                         (o_slow_inf = ((1 - r (v rA rB)) * o_inf (v Ehalf c)))
452
453                         (tau_s =  (tau_slow (v tCs tDs tEs)) (unit ms))
454
455                         (d (o_slow) = ((o_slow_inf - o_slow) / tau_s)
456                            (initial o_slow_inf))
457
458                         (output o_slow)
459
460                         )
461             
462              (component (type gate)
463                         
464
465                         ;; rate constants
466
467                         (const tCf = 0.0269)
468                         (const tDf = -5.6111 (unit mV))
469                         (const tEf = 2.3026  (unit /mV))
470                         
471                         (defun tau_fast (potential t1 t2 t3)
472                           (exp (t3 * ((t1 * potential) - t2))))
473
474                         (o_fast_inf = (r (v rA rB) * o_inf (v Ehalf c)))
475
476                         (tau_f =  (tau_fast (v tCf tDf tEf)) (unit ms))
477
478                         (d (o_fast) = ((o_fast_inf - o_fast) / tau_f)
479                            (initial o_fast_inf))
480
481                         (output o_fast)
482
483                         )
484             
485              (component (type pore)
486                         (const  gbar  = 8e-5 (unit S/cm2))
487                         (output gbar))
488             
489              (component (type permeating-ion) (name non-specific)
490                         (const e = -20 (unit mV))
491                         (output e ))
492             
493              ) ;; end HCN2 current
494
495
496
497   (component (type voltage-clamp) (name HCN2)
498             
499              (const vchold   = -71)
500              (const vcbase   = -69)
501              (const vcinc    = 10)
502              (const vcsteps  = 8)
503              (const vchdur   = 30)
504              (const vcbdur   = 100)
505             
506              (output vchold vcbase vcinc vcsteps vchdur vcbdur)
507              )
508
509   
510
511   (component (type ionic-current) (name KA )
512
513              (input
514               (ki from ion-pools)
515               (ko from ion-pools)
516               )
517
518              (defun sigm (x y) (1 / (exp (x / y) + 1)))
519             
520              (component (type gate)
521                         
522                         ;; rate constants
523                         
524                         (Q10 = (pow (3 ((celsius - 25.5) / 10))))
525
526                         (const Aalpha_a  = 0.8147    (unit /ms))
527                         (const Kalpha_a  = -23.32708 (unit mV))
528                         (const V0alpha_a = -9.17203  (unit mV))
529                         (const Abeta_a   = 0.1655    (unit /ms))
530                         (const Kbeta_a   = 19.47175  (unit mV))
531                         (const V0beta_a  = -18.27914 (unit mV))
532
533                         (const Aalpha_b  = 0.0368    (unit /ms))
534                         (const Kalpha_b  = 12.8433   (unit mV))
535                         (const V0alpha_b = -111.33209 (unit mV))
536                         (const Abeta_b   = 0.0345    (unit /ms))
537                         (const Kbeta_b   = -8.90123  (unit mV))
538                         (const V0beta_b  = -49.9537  (unit mV))
539
540                         (const V0_ainf = -38 (unit mV))
541                         (const  K_ainf = -17 (unit mV))
542
543                         (const V0_binf   = -78.8 (unit mV))
544                         (const K_binf    = 8.4   (unit mV))
545
546                         
547                         ;; rate functions
548
549                         (defun alpha_a (v Q10)
550                           (Q10 * Aalpha_a * sigm((v - V0alpha_a) Kalpha_a)))
551
552                         (defun beta_a (v Q10)
553                           (Q10 * (Abeta_a / exp((v - V0beta_a) / Kbeta_a))))
554
555                         (defun alpha_b (v Q10)
556                           (Q10 * Aalpha_b * sigm((v - V0alpha_b) Kalpha_b)))
557
558                         (defun beta_b (v Q10)
559                           (Q10 * Abeta_b * sigm((v - V0beta_b) Kbeta_b)))
560
561
562
563                         (a_inf = (1 / (1 + exp ((v - V0_ainf) / K_ainf))))
564                         (tau_a = (1 / (alpha_a (v Q10) + beta_a (v Q10)) ))
565                         (b_inf = (1 / (1 + exp ((v - V0_binf) / K_binf))))
566                         (tau_b = (1 / (alpha_b (v Q10) + beta_b (v Q10)) ))
567
568
569                         (hh-ionic-gate
570                          (KA  ;; ion name: exported variables will be of the form {ion}_{id}
571                           (initial-m  (a_inf))
572                           (initial-h  (b_inf))
573                           (m-power    3)
574                           (h-power    1)
575                           (m-inf      a_inf)
576                           (m-tau      tau_a)
577                           (h-inf      b_inf)
578                           (h-tau      tau_b)
579                           ))
580
581                         )
582
583                     
584              (component (type pore)
585                         (const  gbar  = 0.008 (unit S/cm2))
586                         (output gbar ))
587
588             
589              (component (type permeating-ion) (name k)
590                         (e = (nernst (celsius ki ko 1)) (unit mV))
591                         (output e ))
592             
593              ) ;; end KA current
594             
595
596
597   (component (type voltage-clamp) (name KA)
598             
599              (const vchold   = -71)
600              (const vcbase   = -69)
601              (const vcinc    = 10)
602              (const vcsteps  = 8)
603              (const vchdur   = 30)
604              (const vcbdur   = 100)
605
606              (component (type default-concentration) (name k)
607                      (const cn    = 140)
608                      (const cnout = 5)
609                      (output cn cnout))
610             
611              (output vchold vcbase vcinc vcsteps vchdur vcbdur)
612              )
613
614   
615
616   (component (type ionic-current) (name KCa )
617
618      (input
619       (cai from ion-pools)
620       (ki from ion-pools)
621       (ko from ion-pools)
622       )
623
624      (component (type gate)
625
626                 ;; rate constants
627                 (Q10 = (pow (3 ((celsius - 30) / 10))))
628                 
629                 (const Aalpha_c = 7 (unit /ms))
630                 (const Balpha_c = 1.5e-3 (unit mM))
631                 
632                 (const Kalpha_c =  -11.765 (unit mV))
633                 
634                 (const Abeta_c = 1 (unit /ms))
635                 (const Bbeta_c = 0.15e-3 (unit mM))
636
637                 (const Kbeta_c = -11.765 (unit mV))
638                 
639                 ;; rate functions
640                 (defun alpha_c (v cai Q10)
641                   (Q10 * Aalpha_c / (1 + (Balpha_c * exp(v / Kalpha_c) / cai))))
642                 
643                 (defun beta_c (v cai Q10)
644                   (Q10 * Abeta_c / (1 + cai / (Bbeta_c * exp (v / Kbeta_c)) )))
645             
646                 (c_inf = ((alpha_c (v cai Q10)) / (alpha_c (v cai Q10) + beta_c (v cai Q10)) ))
647                 (tau_c = (1 / (alpha_c (v cai Q10) + beta_c (v cai Q10))) (unit ms))
648
649                 (hh-ionic-gate
650                  (KCa  ;; ion name: exported variables will be of the form {ion}_{id}
651                   (initial-m  c_inf)
652                   (m-power    1)
653                   (h-power    0)
654                   (m-inf      c_inf)
655                   (m-tau      tau_c)
656                   ))
657                 
658                 )
659     
660      (component (type pore)
661                 (const  gbar  = 0.003 (unit S/cm2))
662                 (output gbar ))
663     
664     
665      (component (type permeating-ion) (name k)
666                 (e = (nernst (celsius ki ko 1)) (unit mV))
667                 (output e ))
668     
669      (component (type modulating-ion) (name ca) )
670     
671      ) ;; end KCa current
672
673   
674   (component (type voltage-clamp) (name KCa)
675             
676              (const vchold   = -71)
677              (const vcbase   = -69)
678              (const vcinc    = 10)
679              (const vcsteps  = 8)
680              (const vchdur   = 30)
681              (const vcbdur   = 100)
682
683              (component (type default-concentration) (name k)
684                      (const kcn    = 140)
685                      (const kcnout = 5)
686                      (output kcn kcnout))
687
688              (const cnhold   = 5e-5)
689              (const cnbase   = 5e-5)
690              (const cninc    = 1e3)
691              (const cnsteps  = 1)
692              (const cnout    = 2)
693             
694              (output vchold vcbase vcinc vcsteps vchdur vcbdur
695                      cnhold cnbase cninc cnsteps cnout)
696              )
697
698
699   (component (type ionic-current) (name KM )
700             
701              (input
702               (ki from ion-pools)
703               (ko from ion-pools)
704               )
705             
706              (component (type gate)
707
708                         ;; rate constants
709                         (const Aalpha_n = 0.0033 (unit /ms))
710
711                         (const Kalpha_n  = 40  (unit mV))
712                         (const V0alpha_n = -30 (unit mV))
713                         (const Abeta_n   = 0.0033 (unit /ms))
714
715                         (const Kbeta_n  = -20 (unit mV))
716                         (const V0beta_n = -30 (unit mV))
717                         (const V0_ninf  = -35 (unit mV))
718                         (const B_ninf   = 6   (unit mV))
719                         
720                         (Q10 = (pow (3 ((celsius - 22) / 10))))
721                         
722                         ;; rate equations
723                         (defun alpha_n (v Q10)
724                           (Q10 * Aalpha_n * exp((v - V0alpha_n) / Kalpha_n) ))
725
726                         (defun beta_n (v Q10)
727                           (Q10 * Abeta_n * exp((v - V0beta_n) / Kbeta_n) ))
728
729                         (hh-ionic-gate
730                          (KM  ;; ion name: exported variables will be of the form {ion}_{id}
731                           (initial-m  ((1 / (1 + exp((neg (v - V0_ninf)) / B_ninf)))))
732                           (m-power    1)
733                           (h-power    0)
734                           (m-tau      ((1 / (alpha_n(v Q10) + beta_n (v Q10)) )))
735                           (m-inf      ((1 / (1 + exp((neg (v - V0_ninf)) / B_ninf)))))
736                           ))
737                         )
738             
739              (component (type pore)
740                         (const  gbar  = 0.001 (unit S/cm2))
741                         (output gbar ))
742             
743              (component (type permeating-ion) (name k)
744                         (e = (nernst (celsius ki ko 1)) (unit mV))
745                         (output e ))
746             
747              ) ;; end KM current
748
749
750
751   (component (type voltage-clamp) (name KM)
752             
753              (const vchold   = -71)
754              (const vcbase   = -69)
755              (const vcinc    = 10)
756              (const vcsteps  = 8)
757              (const vchdur   = 30)
758              (const vcbdur   = 100)
759
760              (component (type default-concentration) (name k)
761                      (const cn    = 140)
762                      (const cnout = 5)
763                      (output cn cnout))
764             
765              (output vchold vcbase vcinc vcsteps vchdur vcbdur)
766              )
767
768   
769
770   (component (type ionic-current) (name KV )
771
772             
773              (input
774               (ki from ion-pools)
775               (ko from ion-pools)
776               )
777             
778              (defun linoid (x y)
779                (if ((abs (x / y)) < 1e-6)
780                    then (y * (1 - (x / y / 2)))
781                    else (x / (exp (x / y) - 1))
782                    ))
783
784
785              (component (type gate)
786
787                         ;; rate constants
788
789                         (const Aalpha_n  = -0.01 (unit /mV-ms))
790                         (const Kalpha_n  = -10   (unit mV))
791                         (const V0alpha_n = -26   (unit mV))
792                         (const Abeta_n   = 0.125 (unit /ms))
793       
794                         (const Kbeta_n  = -80 (unit mV))
795                         (const V0beta_n = -36 (unit mV))
796
797                         ;; rate functions
798                         (Q10 = (pow (3 ((celsius - 6.3) / 10))))
799
800                         (defun alpha_n (v Q10)
801                           (Q10 * Aalpha_n * linoid ((v - V0alpha_n) Kalpha_n)))
802
803                         (defun beta_n (v Q10)
804                           (Q10 * Abeta_n * exp((v - V0beta_n) / Kbeta_n) ))
805
806                         (n_inf = ((alpha_n (v Q10)) / (alpha_n (v Q10) + beta_n (v Q10)) ))
807                         (tau_n = (1 / (alpha_n (v Q10) + beta_n (v Q10))) (unit ms))
808
809                         (hh-ionic-gate
810                          (KV  ;; ion name: exported variables will be of the form {ion}_{id}
811                           (initial-m  n_inf)
812                           (m-power    4)
813                           (h-power    0)
814                           (m-inf     (n_inf))
815                           (m-tau     (tau_n))
816                           ))
817                         )
818
819              (component (type pore)
820                         (const  gbar  = 0.032 (unit S/cm2))
821                         (output gbar ))
822             
823              (component (type permeating-ion) (name k)
824                         (e = (nernst (celsius ki ko 1)) (unit mV))
825                         (output e ))
826             
827              ) ;; end KV current
828             
829
830   (component (type voltage-clamp) (name KV)
831             
832              (const vchold   = -71)
833              (const vcbase   = -69)
834              (const vcinc    = 10)
835              (const vcsteps  = 8)
836              (const vchdur   = 30)
837              (const vcbdur   = 100)
838
839              (component (type default-concentration) (name k)
840                      (const cn    = 140)
841                      (const cnout = 5)
842                      (output cn cnout))
843             
844              (output vchold vcbase vcinc vcsteps vchdur vcbdur)
845              )
846
847
848
849   
850   (component (type ionic-current) (name SK2 )
851
852      (input
853       (cai from ion-pools)
854       (ki from ion-pools)
855       (ko from ion-pools)
856       )
857
858      (component (type gate)
859
860                 (Q10 = (pow (3 ((celsius - 23) / 10))))
861                 
862                 (const diff = 3) ;; Diffusion factor
863                 
864                 ;; rates ca-independent
865                 (const invc1 = 80e-3  (unit /ms))
866                 (const invc2 = 80e-3  (unit /ms))
867                 (const invc3 = 200e-3 (unit /ms))
868
869                 (const invo1 = 1      (unit /ms))
870                 (const invo2 = 100e-3 (unit /ms))
871                 (const diro1 = 160e-3 (unit /ms))
872                 (const diro2 = 1.2    (unit /ms))
873
874                 ;; rates ca-dependent
875                 (const dirc2 = 200 (unit /mM-ms))
876                 (const dirc3 = 160 (unit /mM-ms))
877                 (const dirc4 = 80  (unit /mM-ms))
878
879                 (invc1_t = (invc1 * Q10)  (unit /ms))
880                 (invc2_t = (invc2 * Q10)  (unit /ms))
881                 (invc3_t = (invc3 * Q10)  (unit /ms))
882                 (invo1_t = (invo1 * Q10)  (unit /ms))
883                 (invo2_t = (invo2 * Q10)  (unit /ms))
884                 (diro1_t = (diro1 * Q10)  (unit /ms))
885                 (diro2_t = (diro2 * Q10)  (unit /ms))
886                 (dirc2_t = (dirc2 * Q10)  (unit /ms))
887                 (dirc3_t = (dirc3 * Q10)  (unit /ms))
888                 (dirc4_t = (dirc4 * Q10)  (unit /ms))
889
890
891                 (dirc2_t_ca = (dirc2_t * (cai / diff)) )
892                 (dirc3_t_ca = (dirc3_t * (cai / diff)) )
893                 (dirc4_t_ca = (dirc4_t * (cai / diff)) )
894
895                 
896                 (reaction
897                  (SK2_z
898                   (transitions
899                    (<-> c1 c2 dirc2_t_ca invc1_t)
900                    (<-> c2 c3 dirc3_t_ca invc2_t)
901                    (<-> c3 c4 dirc4_t_ca invc3_t)
902                    (<-> c3 o1 diro1_t invo1_t)
903                    (<-> c4 o2 diro2_t invo2_t)
904                    )
905                   (conserve  ((1 = (c1 + c2 + c3 + c4 + o2 + o1))))
906                   (open o1 o2)
907                   (power 1)))
908                 
909                 (output SK2_z)
910                 
911                 )
912
913      (component (type pore)
914                 (const  gbar  = 0.038 (unit S/cm2))
915                 (output gbar ))
916     
917     
918      (component (type permeating-ion) (name k)
919                 (e = (nernst (celsius ki ko 1)) (unit mV))
920                 (output e ))
921
922      (component (type modulating-ion) (name ca) )
923     
924      ) ;; end SK2 current
925
926
927
928   (component (type voltage-clamp) (name SK2)
929           
930              (const vchold   = -71)
931              (const vcbase   = -69)
932              (const vcinc    = 10)
933              (const vcsteps  = 8)
934              (const vchdur   = 30)
935              (const vcbdur   = 100)
936
937              (component (type default-concentration) (name k)
938                      (const kcn    = 140)
939                      (const kcnout = 5)
940                      (output kcn kcnout))
941
942              (const cnhold   = 5e-5)
943              (const cnbase   = 5e-5)
944              (const cninc    = 1e3)
945              (const cnsteps  = 1)
946              (const cnout    = 2)
947             
948              (output vchold vcbase vcinc vcsteps vchdur vcbdur
949                      cnhold cnbase cninc cnsteps cnout)
950              )
951   
952   (component (type ionic-current) (name Na )
953
954              (input
955               (nai from ion-pools)
956               (nao from ion-pools)
957               )
958
959              (defun linoid (x y)
960                (if ((abs (x / y)) < 1e-6)
961                    then (y * (1 - ((x / y) / 2)))
962                    else (x / (1 - exp (x / y) ))
963                    ))
964             
965             
966              (component (type gate)
967             
968              ;; rate constants
969                         
970                         (Q10 = (pow (3 ((celsius - 20) / 10))))
971                         
972                         (const Aalpha_u  = 0.3 (unit /mV-ms))
973                         (const Kalpha_u  = -10 (unit mV))
974                         (const V0alpha_u = -25 (unit mV))
975       
976                         (const Abeta_u  = 12      (unit /ms))
977                         (const Kbeta_u  = -18.182 (unit mV))
978                         (const V0beta_u = -50     (unit mV))
979
980                         (const Aalpha_v  = 0.21 (unit /ms))
981                         (const Kalpha_v  = -3.333 (unit mV))
982                         (const V0alpha_v = -50    (unit mV))
983 
984                         (const Abeta_v  = 3   (unit /ms))
985                         (const Kbeta_v  = -5  (unit mV))
986                         (const V0beta_v = -17 (unit mV))
987
988                         ;; rate functions
989                         (defun alpha_u (v Q10)
990                           (Q10 * Aalpha_u * linoid((v - V0alpha_u) Kalpha_u) ))
991
992                         (defun beta_u (v Q10)
993                           (Q10 * Abeta_u * exp((v - V0beta_u) / Kbeta_u) ))
994
995                         (defun alpha_v (v Q10)
996                           (Q10 * Aalpha_v * exp((v - V0alpha_v) / Kalpha_v) ))
997                               
998                         (defun beta_v (v Q10)
999                           (Q10 * Abeta_v / (1 + exp((v - V0beta_v) / Kbeta_v) )))
1000
1001                         (u_inf = ((alpha_u (v Q10)) / (alpha_u (v Q10) + beta_u (v Q10)) ))
1002                         (tau_u = (1 / (alpha_u (v Q10) + beta_u (v Q10))))
1003
1004                         (v_inf = ((alpha_v (v Q10)) / (alpha_v (v Q10) + beta_v (v Q10)) ))
1005                         (tau_v = (1 / (alpha_v (v Q10) + beta_v (v Q10)) ))
1006                         
1007                         (hh-ionic-gate
1008                          (Na  ;; ion name: exported variables will be of the form {ion}_{id}
1009                           (initial-m  (u_inf))
1010                           (initial-h  (v_inf))
1011                           (m-power    3)
1012                           (h-power    1)
1013                           (m-inf     (u_inf))
1014                           (m-tau     (tau_u))
1015                           (h-inf     (v_inf))
1016                           (h-tau     (tau_v))
1017                           ))
1018                         
1019                         )
1020             
1021              (component (type pore)
1022                         (const  gbar  = 0.048 (unit S/cm2))
1023                         (output gbar ))
1024
1025             
1026              (component (type permeating-ion) (name na)
1027                         (e = (nernst (celsius nai nao 1)) (unit mV))
1028                         (output e ))
1029             
1030              ) ;; end Na current
1031
1032
1033   (component (type voltage-clamp) (name Na)
1034
1035              (const vchold   = -71)
1036              (const vcbase   = -60)
1037              (const vcinc    = 10)
1038              (const vcsteps  = 9)
1039              (const vchdur   = 30)
1040              (const vcbdur   = 100)
1041
1042              (component (type default-concentration) (name na)
1043                      (const cn    = 5)
1044                      (const cnout = 140)
1045                      (output cn cnout))
1046           
1047              (output vchold vcbase vcinc vcsteps vchdur vcbdur))
1048
1049   
1050   (component (type ionic-current) (name NaP )
1051             
1052              (input
1053               (nai from ion-pools)
1054               (nao from ion-pools)
1055               )
1056
1057              (defun linoid (x y)
1058                (if ((abs (x / y)) < 1e-6)
1059                    then (y * (1 - ((x / y) / 2)))
1060                    else (x / (exp (x / y) - 1))
1061                    ))
1062
1063
1064              (component (type gate)
1065
1066                         ;; rate constants
1067                         ( Q10 = (pow (3 ((celsius - 30) / 10))))
1068
1069                         (const Aalpha_m  = -0.91 (unit /mV-ms))
1070                         (const Kalpha_m  = -5    (unit mV))
1071                         (const V0alpha_m = -40   (unit mV))
1072
1073                         (const Abeta_m   = 0.62 (unit /mV-ms))
1074                         (const Kbeta_m   = 5    (unit mV))
1075                         (const V0beta_m  = -40  (unit mV))
1076
1077                         (const V0_minf   = -43  (unit mV))
1078                         (const B_minf    = 5    (unit mV))
1079
1080                         ;; rate functions
1081
1082                         (defun alpha_m (v Q10)
1083                           (Q10 * Aalpha_m * linoid( ( v - V0alpha_m ) Kalpha_m) ))
1084
1085                         (defun beta_m (v Q10)
1086                           (Q10 * Abeta_m * linoid( ( v - V0beta_m )  Kbeta_m ) ))
1087
1088                         (hh-ionic-gate
1089                          (NaP  ;; ion name: exported variables will be of the form {ion}_{id}
1090                           (initial-m  ((1 / (1 + exp ((neg (v - V0_minf)) / B_minf)))))
1091                           (m-power    1)
1092                           (h-power    0)
1093                           (m-inf     ((1 / (1 + exp ((neg (v - V0_minf)) / B_minf)))))
1094                           (m-tau     ((5 / (alpha_m (v Q10) + beta_m (v Q10)) )))
1095                           ))
1096                         )
1097
1098              (component (type pore)
1099                         (const  gbar  = 0.00019 (unit S/cm2))
1100                         (output gbar ))
1101
1102              (component (type permeating-ion) (name na)
1103                         (e = (nernst (celsius nai nao 1)) (unit mV))
1104                         (output e ))
1105             
1106              ) ;; end NaP current
1107
1108
1109   (component (type voltage-clamp) (name NaP)
1110
1111              (const vchold   = -71)
1112              (const vcbase   = -60)
1113              (const vcinc    = 10)
1114              (const vcsteps  = 9)
1115              (const vchdur   = 30)
1116              (const vcbdur   = 100)
1117
1118              (component (type default-concentration) (name na)
1119                      (const cn    = 5)
1120                      (const cnout = 140)
1121                      (output cn cnout))
1122           
1123              (output vchold vcbase vcinc vcsteps vchdur vcbdur))
1124
1125   
1126   (component (type ionic-current) (name NaR )
1127             
1128              (input
1129               (nai from ion-pools)
1130               (nao from ion-pools)
1131               )
1132
1133              (component (type gate)
1134
1135                         ;; rate constants
1136                         (Q10 = (pow (3 ((celsius - 20) / 10))))
1137
1138                         (const Aalpha_s     = -0.00493 (unit /ms))
1139                         (const V0alpha_s    = -4.48754 (unit mV))
1140                         (const Kalpha_s     = -6.81881 (unit mV))
1141                         (const Shiftalpha_s = 0.00008  (unit /ms))
1142
1143                         (const Abeta_s     = 0.01558   (unit /ms))
1144                         (const V0beta_s    = 43.97494  (unit mV))
1145                         (const Kbeta_s     = 0.10818   (unit mV))
1146                         (const Shiftbeta_s = 0.04752   (unit /ms))
1147
1148                         (const Aalpha_f  = 0.31836   (unit /ms))
1149                         (const V0alpha_f = -80       (unit mV))
1150                         (const Kalpha_f  = -62.52621 (unit mV))
1151
1152                         (const Abeta_f  = 0.01014    (unit /ms))
1153                         (const V0beta_f = -83.3332   (unit mV))
1154                         (const Kbeta_f  = 16.05379   (unit mV))
1155
1156                         ;; rate functions
1157                         (defun alpha_s (v Q10)
1158                           (Q10 * (Shiftalpha_s + ((Aalpha_s * ((v + V0alpha_s) )) / (exp ((v + V0alpha_s) / Kalpha_s) - 1)))))
1159
1160                         (defun beta_s (v Q10)
1161                           (let ((x1 ((v + V0beta_s) / Kbeta_s)))
1162                             (Q10 * (Shiftbeta_s + Abeta_s * ((v + V0beta_s) / (exp((if (x1 > 200) then 200 else x1)) - 1))))))
1163
1164                         (defun alpha_f (v Q10)
1165                           (Q10 * Aalpha_f * exp( ( v - V0alpha_f ) / Kalpha_f)))
1166
1167                         (defun beta_f (v Q10)
1168                           (Q10 * Abeta_f * exp( ( v - V0beta_f ) / Kbeta_f )  ))
1169
1170                         (s_inf = ((alpha_s (v Q10)) / (alpha_s (v Q10) + beta_s (v Q10)) ))
1171                         (tau_s = (1 / (alpha_s (v Q10) + beta_s (v Q10)) ))
1172                         (f_inf = ((alpha_f (v Q10)) / (alpha_f (v Q10) + beta_f (v Q10)) ))
1173                         (tau_f = (1 / (alpha_f (v Q10) + beta_f (v Q10)) ))
1174
1175                         (hh-ionic-gate
1176                          (NaR  ;; ion name: exported variables will be of the form {ion}_{id}
1177                           (initial-m  (s_inf))
1178                           (initial-h  (f_inf))
1179                           (m-power    1)
1180                           (h-power    1)
1181                           (m-inf     (s_inf))
1182                           (m-tau     (tau_s))
1183                           (h-inf     (f_inf))
1184                           (h-tau     (tau_f))
1185
1186                           ))
1187                         )
1188
1189              (component (type pore)
1190                         (const  gbar  = 0.0017 (unit S/cm2))
1191                         (output gbar ))
1192
1193              (component (type permeating-ion) (name na)
1194                         (e = (nernst (celsius nai nao 1)) (unit mV))
1195                         (output e ))
1196             
1197              ) ;; end Nar current
1198   
1199
1200   (component (type voltage-clamp) (name NaR)
1201
1202              (const vchold   = -71)
1203              (const vcbase   = -60)
1204              (const vcinc    = 10)
1205              (const vcsteps  = 9)
1206              (const vchdur   = 30)
1207              (const vcbdur   = 100)
1208
1209              (component (type default-concentration) (name na)
1210                      (const cn    = 5)
1211                      (const cnout = 140)
1212                      (output cn cnout))
1213           
1214              (output vchold vcbase vcinc vcsteps vchdur vcbdur))
1215
1216     
1217   (component (type ionic-current) (name Lkg)
1218             
1219              (component (type pore)
1220                         (const  gbar  = 21e-6 (unit S/cm2))
1221                         (output gbar))
1222             
1223              (component (type permeating-ion) (name non-specific)
1224                         (const e = -55 (unit mV))
1225                         (output e ))
1226             
1227              ) ;; end leak current
1228   )
1229
1230   ;; Following are templates for various driver scripts used to run this model
1231   (
1232
1233    ("syn_template.hoc" () 
1234#<<EOF
1235/*******Cerebellar Golgi Cell Model **********
1236
1237Developers:    Sergio Solinas & Egidio D'Angelo
1238Code contributors:  Thierry Neius, Shyam Diwakar, Lia Forti
1239Data Analysis: Sergio Solinas
1240
1241Work Progress: April 2004 - May 2007
1242
1243Developed At:  Università Degli Studi Di Pavia
1244               Dipartimento Di Scienze Fisiologiche
1245               Pavia - Italia
1246               
1247Model Published in:
1248             Sergio M. Solinas, Lia Forti, Elisabetta Cesana,
1249             Jonathan Mapelli, Erik De Schutter and Egidio D`Angelo (2008)
1250             Computational reconstruction of pacemaking and intrinsic
1251             electroresponsiveness in cerebellar golgi cells
1252             Frontiers in Cellular Neuroscience 2:2
1253
1254
1255********************************************/
1256
1257// In this configuration the ion channels
1258// were not corrected for the Liquid Junction potential.
1259// The ion reversal potential were corrected in agreement
1260// with the voltage shift.
1261// See Table 1 Solinas et al. 2008 Frontiers Neurosci 2:2
1262
1263begintemplate GoC
1264public soma,elec,seal,dend,nclist,syn
1265public SpikeTrain, RT_Vm, EL_Vm
1266
1267create soma
1268create dend[3]
1269
1270objref syn[3]
1271objref nclist, SpikeTrain, netcon, nil
1272objref RT_Vm, EL_Vm
1273
1274proc init() {
1275
1276    nclist = new List()
1277    RT_Vm = new Vector()
1278    EL_Vm = new Vector()
1279    create soma
1280    soma {
1281        nseg = 1
1282        diam = 27 // 22 pF Dieudonne98
1283        L = 27
1284        Ra = 100 // From Roth&Hausser2000
1285        celsius = 23
1286       
1287        insert Golgi_Lkg
1288       
1289        insert Golgi_Na
1290        insert Golgi_NaR
1291        insert Golgi_NaP
1292       
1293        insert Golgi_CaHVA
1294        insert Golgi_CaLVA
1295               
1296        insert Golgi_KV
1297        insert Golgi_KM
1298        insert Golgi_KA
1299
1300        insert Golgi_KCa
1301        insert Golgi_SK2
1302       
1303        insert Golgi_HCN1
1304        insert Golgi_HCN2
1305
1306        insert Golgi_ca
1307        insert Golgi_ca2
1308        insert Golgi_naconc
1309        insert Golgi_k
1310       
1311        cai0_ca_ion = 50e-6
1312        ca2i0_ca2_ion = cai0_ca_ion
1313       
1314        cai = cai0_ca_ion
1315        ca2i = cai
1316        ca2o = cao
1317
1318        nai0_na_ion = 5
1319        nai = nai0_na_ion
1320        ki0_k_ion = 140
1321        ki = ki0_k_ion
1322 
1323        SpikeTrain = new Vector()
1324        netcon = new NetCon(&v(0.5),nil)
1325        netcon.threshold=-20
1326        netcon.record(SpikeTrain)
1327       
1328        RT_Vm.record(&v(0.5))
1329    }
1330   
1331    create dend[3]
1332    for i=0,2 {
1333        dend[i] {
1334            nseg = 10
1335            diam = 3
1336            L = 113
1337            Ra = 100
1338            celsius = 23
1339           
1340            insert Golgi_Lkg
1341
1342            syn[i] = new Golgi_AMPA(0)
1343        }
1344        connect dend[i](0), soma(1)     
1345    }
1346   
1347
1348}
1349
1350                   
1351endtemplate GoC
1352EOF
1353)
1354
1355
1356    ("template.hoc" () 
1357#<<EOF
1358/*******Cerebellar Golgi Cell Model **********
1359
1360Developers:    Sergio Solinas & Egidio D'Angelo
1361Code contributors:  Thierry Neius, Shyam Diwakar, Lia Forti
1362Data Analysis: Sergio Solinas
1363
1364Work Progress: April 2004 - May 2007
1365
1366Developed At:  Università Degli Studi Di Pavia
1367               Dipartimento Di Scienze Fisiologiche
1368               Pavia - Italia
1369               
1370Model Published in:
1371             Sergio M. Solinas, Lia Forti, Elisabetta Cesana,
1372             Jonathan Mapelli, Erik De Schutter and Egidio D`Angelo (2008)
1373             Computational reconstruction of pacemaking and intrinsic
1374             electroresponsiveness in cerebellar golgi cells
1375             Frontiers in Cellular Neuroscience 2:2
1376
1377
1378********************************************/
1379
1380// In this configuration the ion channels
1381// were not corrected for the Liquid Junction potential.
1382// The ion reversal potential were corrected in agreement
1383// with the voltage shift.
1384// See Table 1 Solinas et al. 2008 Frontiers Neurosci 2:2
1385
1386begintemplate GoC
1387public soma,elec,seal,dend
1388public SpikeTrain, RT_Vm, EL_Vm
1389
1390create soma
1391create dend[3]
1392
1393objref SpikeTrain, netcon, nil
1394objref RT_Vm, EL_Vm
1395
1396proc init() {
1397
1398    RT_Vm = new Vector()
1399    EL_Vm = new Vector()
1400    create soma
1401    soma {
1402        nseg = 1
1403        diam = 27 // 22 pF Dieudonne98
1404        L = 27
1405        Ra = 100 // From Roth&Hausser2000
1406        celsius = 23
1407       
1408        insert Golgi_Lkg
1409       
1410        insert Golgi_Na
1411        insert Golgi_NaR
1412        insert Golgi_NaP
1413       
1414        insert Golgi_CaHVA
1415        insert Golgi_CaLVA
1416               
1417        insert Golgi_KV
1418        insert Golgi_KM
1419        insert Golgi_KA
1420
1421        insert Golgi_KCa
1422        insert Golgi_SK2
1423       
1424        insert Golgi_HCN1
1425        insert Golgi_HCN2
1426
1427        insert Golgi_ca
1428        insert Golgi_ca2
1429        insert Golgi_naconc
1430        insert Golgi_k
1431       
1432        cai0_ca_ion = 50e-6
1433        ca2i0_ca2_ion = cai0_ca_ion
1434       
1435        cai = cai0_ca_ion
1436        ca2i = cai
1437        ca2o = cao
1438
1439        nai0_na_ion = 5
1440        nai = nai0_na_ion
1441        ki0_k_ion = 140
1442        ki = ki0_k_ion
1443 
1444        SpikeTrain = new Vector()
1445        netcon = new NetCon(&v(0.5),nil)
1446        netcon.threshold=-20
1447        netcon.record(SpikeTrain)
1448       
1449        RT_Vm.record(&v(0.5))
1450    }
1451   
1452    create dend[3]
1453    for i=0,2 {
1454        dend[i] {
1455            nseg = 10
1456            diam = 3
1457            L = 113
1458            Ra = 100
1459            celsius = 23
1460           
1461            insert Golgi_Lkg
1462        }
1463        connect dend[i](0), soma(1)     
1464    }
1465   
1466
1467}
1468
1469                   
1470endtemplate GoC
1471EOF
1472)
1473
1474
1475    ("reduced_template.hoc" () 
1476#<<EOF
1477/*******Cerebellar Golgi Cell Model **********
1478
1479Reduced single-compartment cerebellar Golgi cell model
1480
1481Developers:    Sergio Solinas & Egidio D'Angelo
1482Code contributors:  Thierry Neius, Shyam Diwakar, Lia Forti
1483Data Analysis: Sergio Solinas
1484
1485Work Progress: April 2004 - May 2007
1486
1487Developed At:  Università Degli Studi Di Pavia
1488               Dipartimento Di Scienze Fisiologiche
1489               Pavia - Italia
1490               
1491Model Published in:
1492             Sergio M. Solinas, Lia Forti, Elisabetta Cesana,
1493             Jonathan Mapelli, Erik De Schutter and Egidio D`Angelo (2008)
1494             Computational reconstruction of pacemaking and intrinsic
1495             electroresponsiveness in cerebellar golgi cells
1496             Frontiers in Cellular Neuroscience 2:2
1497
1498
1499********************************************/
1500
1501// In this configuration the ion channels
1502// were not corrected for the Liquid Junction potential.
1503// The ion reversal potential were corrected in agreement
1504// with the voltage shift.
1505// See Table 1 Solinas et al. 2008 Frontiers Neurosci 2:2
1506
1507begintemplate GoC
1508public soma,axon,elec,seal,dend,syn
1509public nclist, SpikeTrain, RT_Vm, EL_Vm
1510
1511create soma
1512
1513objref nclist, SpikeTrain, netcon, nil
1514objref RT_Vm, EL_Vm
1515objref syn[3]
1516
1517proc init() {
1518
1519    nclist = new List()
1520    RT_Vm = new Vector()
1521    EL_Vm = new Vector()
1522    create soma
1523    soma {
1524        nseg = 1
1525        diam = 27 // 22 pF Dieudonne98
1526        L = 27
1527        Ra = 100 // From Roth&Hausser2000
1528        celsius = 23
1529       
1530        insert Golgi_Lkg
1531       
1532        insert Golgi_Na
1533        insert Golgi_NaR
1534        insert Golgi_NaP
1535       
1536        insert Golgi_CaHVA
1537        insert Golgi_CaLVA
1538               
1539        insert Golgi_KV
1540        insert Golgi_KM
1541        insert Golgi_KA
1542
1543        insert Golgi_KCa
1544        insert Golgi_SK2
1545       
1546        insert Golgi_HCN1
1547        insert Golgi_HCN2
1548
1549        insert Golgi_ca
1550        insert Golgi_ca2
1551        insert Golgi_naconc
1552        insert Golgi_k
1553
1554        cai0_ca_ion = 50e-6
1555        ca2i0_ca2_ion = cai0_ca_ion
1556       
1557        cai = cai0_ca_ion
1558        ca2i = cai
1559        ca2o = cao
1560       
1561        ena =  87.39
1562        ek  = -84.69
1563
1564        for i=0,2 {
1565            syn[i] = new Golgi_AMPA(0)
1566        }
1567
1568        SpikeTrain = new Vector()
1569        netcon = new NetCon(&v(0.5),nil)
1570        netcon.threshold=-20
1571        netcon.record(SpikeTrain)
1572       
1573        RT_Vm.record(&v(0.5))
1574    }
1575}
1576
1577                   
1578endtemplate GoC
1579EOF
1580)
1581
1582    ("netstim_protocol.hoc" () 
1583#<<EOF
1584load_file("nrngui.hoc")
1585load_file("Golgi_protocol.ses")
1586
1587// Load the Golgi cell template
1588xopen("Golgi_syn_template.hoc")
1589
1590objref goc
1591goc = new GoC()
1592
1593prelength = 1000
1594mainlength = 6000
1595
1596
1597//**********************************************************************
1598proc simulate() { local preDT, mainDT, logsize  localobj logfile, tlog, Vlog, iklog, inalog, icalog, ica2log
1599   
1600    mainDT = 0.025
1601    preDT = 0.025
1602   
1603    dt = preDT
1604    tstop = prelength
1605    run()
1606   
1607   
1608    if ( stoprun == 1) return
1609   
1610    dt = mainDT
1611    continuerun(prelength + mainlength)
1612    if ( stoprun == 1) return
1613   
1614    logfile=$o1
1615    tlog=$o2
1616    Vlog=$o3
1617    iklog=$o4
1618    inalog=$o5
1619    icalog=$o6
1620    ica2log=$o7
1621   
1622    logsize = tlog.size()
1623   
1624    for i=0,tlog.size()-1 {
1625        logfile.printf("%g %g %g %g %g\n", tlog.x[i], Vlog.x[i], iklog.x[i], inalog.x[i], icalog.x[i], ica2log.x[i])
1626    }
1627
1628}
1629
1630
1631//*************User-Interface*******************************************
1632
1633nrnsecmenu(0.5, 1)
1634
1635xpanel("Spontaneous firing")
1636xvalue("Time for Initialization", "prelength")
1637xvalue("Main duration", "mainlength")
1638
1639xvalue("dt", "dt")
1640xvalue("t", "t")
1641xlabel("")
1642xbutton("Start", "simulate()")
1643xbutton("Stop", "stoprun = 1")
1644xpanel()
1645
1646vec_sizes = (prelength+mainlength)/dt + 1       // recorded traces are all this size
1647
1648strdef logfn
1649objref ns, iklog, inalog, icalog, ica2log, Vlog, tlog, logfile
1650
1651objref stim_rates // input stimulus rates
1652
1653nrates = 5
1654stim_rates = new Vector (nrates)
1655stim_rates.x[0] = 1
1656stim_rates.x[1] = 20
1657stim_rates.x[2] = 50
1658stim_rates.x[3] = 100
1659stim_rates.x[4] = 200
1660
1661for (k=0; k < nrates; k = k + 1) {
1662
1663  ns = new NetStim()
1664  ns.start    = 1000
1665  ns.number   = 100000
1666  ns.noise    = 1
1667  ns.interval = (1 / stim_rates.x[k]) * 1000
1668
1669  goc.nclist.append (new NetCon(ns,goc.syn[0],-20,1,0.1))
1670  goc.nclist.append (new NetCon(ns,goc.syn[1],-20,12,0.1))
1671  goc.nclist.append (new NetCon(ns,goc.syn[2],-20,15,0.1))
1672
1673  iklog = new Vector(vec_sizes)
1674  iklog.record (&goc.soma.ik(0.5))
1675
1676  inalog = new Vector(vec_sizes)
1677  inalog.record (&goc.soma.ina(0.5))
1678
1679  icalog = new Vector(vec_sizes)
1680  icalog.record (&goc.soma.ica(0.5))
1681
1682  ica2log = new Vector(vec_sizes)
1683  ica2log.record (&goc.soma.ica2(0.5))
1684
1685  Vlog = new Vector(vec_sizes)
1686  Vlog.record (&goc.soma.v(0.5))
1687
1688  tlog = new Vector(vec_sizes,0)
1689  tlog.record (&t)
1690
1691  sprint (logfn, "Golgi_netstim_protocol_%d_Hz.dat", stim_rates.x[k] )
1692
1693  logfile = new File()
1694  logfile.wopen ( logfn  )
1695
1696  simulate(logfile,tlog,Vlog,iklog,inalog,icalog,ica2log)
1697  logfile.close()
1698}
1699
1700quit()
1701EOF
1702)
1703
1704
1705    ("reduced_netstim_protocol.hoc" () 
1706#<<EOF
1707load_file("nrngui.hoc")
1708load_file("Golgi_protocol.ses")
1709
1710// Load the Golgi cell template
1711xopen("Golgi_reduced_template.hoc")
1712
1713objref goc
1714goc = new GoC()
1715
1716prelength = 1000
1717mainlength = 5000
1718
1719
1720//**********************************************************************
1721proc simulate() { local preDT, mainDT, logsize  localobj logfile, tlog, Vlog, iklog, inalog, icalog, ica2log
1722   
1723    mainDT = 0.025
1724    preDT = 0.025
1725   
1726    dt = preDT
1727    tstop = prelength
1728    run()
1729   
1730   
1731    if ( stoprun == 1) return
1732   
1733    dt = mainDT
1734    continuerun(prelength + mainlength)
1735    if ( stoprun == 1) return
1736   
1737    logfile=$o1
1738    tlog=$o2
1739    Vlog=$o3
1740    iklog=$o4
1741    inalog=$o5
1742    icalog=$o6
1743    ica2log=$o7
1744   
1745    logsize = tlog.size()
1746   
1747    for i=0,tlog.size()-1 {
1748        logfile.printf("%g %g %g %g %g\n", tlog.x[i], Vlog.x[i], iklog.x[i], inalog.x[i], icalog.x[i], ica2log.x[i])
1749    }
1750
1751}
1752
1753
1754//*************User-Interface*******************************************
1755
1756nrnsecmenu(0.5, 1)
1757
1758xpanel("Spontaneous firing")
1759xvalue("Time for Initialization", "prelength")
1760xvalue("Main duration", "mainlength")
1761
1762xvalue("dt", "dt")
1763xvalue("t", "t")
1764xlabel("")
1765xbutton("Start", "simulate()")
1766xbutton("Stop", "stoprun = 1")
1767xpanel()
1768
1769vec_sizes = (prelength+mainlength)/dt + 1       // recorded traces are all this size
1770
1771strdef logfn
1772objref ns, iklog, inalog, icalog, ica2log, Vlog, tlog, logfile
1773
1774objref stim_rates // input stimulus rates
1775
1776nrates = 5
1777stim_rates = new Vector (nrates)
1778stim_rates.x[0] = 1
1779stim_rates.x[1] = 20
1780stim_rates.x[2] = 50
1781stim_rates.x[3] = 100
1782stim_rates.x[4] = 200
1783
1784for (k=0; k < nrates; k = k + 1) {
1785
1786   ns = new NetStim()
1787   ns.start    = 1000
1788   ns.number   = 1000000
1789   ns.noise    = 1
1790   ns.interval = (1 / stim_rates.x[k]) * 1000
1791   ns.seed (1)
1792
1793   goc.nclist.append (new NetCon(ns,goc.syn[0],-20,1,0.1))
1794   goc.nclist.append (new NetCon(ns,goc.syn[1],-20,12,0.1))
1795   goc.nclist.append (new NetCon(ns,goc.syn[2],-20,15,0.1))
1796
1797   iklog = new Vector(vec_sizes)
1798   iklog.record (&goc.soma.ik(0.5))
1799
1800   inalog = new Vector(vec_sizes)
1801   inalog.record (&goc.soma.ina(0.5))
1802
1803   icalog = new Vector(vec_sizes)
1804   icalog.record (&goc.soma.ica(0.5))
1805
1806   ica2log = new Vector(vec_sizes)
1807   ica2log.record (&goc.soma.ica2(0.5))
1808
1809   Vlog = new Vector(vec_sizes)
1810   Vlog.record (&goc.soma.v(0.5))
1811
1812   tlog = new Vector(vec_sizes,0)
1813   tlog.record (&t)
1814
1815   sprint (logfn, "Golgi_reduced_netstim_protocol_%d_Hz.dat", stim_rates.x[k])
1816
1817   logfile = new File()
1818   logfile.wopen ( logfn )
1819
1820   simulate(logfile,tlog,Vlog,iklog,inalog,icalog,ica2log)
1821   logfile.close()
1822}
1823
1824quit()
1825EOF
1826)
1827
1828    ("protocol.hoc" () 
1829#<<EOF
1830load_file("nrngui.hoc")
1831load_file("Golgi_protocol.ses")
1832
1833// Load the Golgi cell template
1834xopen("Golgi_template.hoc")
1835
1836objref goc
1837goc = new GoC()
1838
1839
1840prelength = 1000
1841mainlength = 5000
1842
1843
1844//**********************************************************************
1845proc simulate() { local preDT, mainDT, logsize  localobj logfile, tlog, Vlog, iklog, inalog, icalog, ica2log
1846   
1847    mainDT = 0.025
1848    preDT = 0.025
1849   
1850    dt = preDT
1851    tstop = prelength
1852    run()
1853   
1854   
1855    if ( stoprun == 1) return
1856   
1857    dt = mainDT
1858    continuerun(prelength + mainlength)
1859    if ( stoprun == 1) return
1860   
1861    logfile=$o1
1862    tlog=$o2
1863    Vlog=$o3
1864    iklog=$o4
1865    inalog=$o5
1866    icalog=$o6
1867    ica2log=$o7
1868   
1869    logsize = tlog.size()
1870   
1871    for i=0,tlog.size()-1 {
1872        logfile.printf("%g %g %g %g %g\n", tlog.x[i], Vlog.x[i], iklog.x[i], inalog.x[i], icalog.x[i], ica2log.x[i])
1873    }
1874
1875}
1876
1877
1878//*************User-Interface*******************************************
1879
1880nrnsecmenu(0.5, 1)
1881
1882xpanel("Spontaneous firing")
1883xvalue("Time for Initialization", "prelength")
1884xvalue("Main duration", "mainlength")
1885
1886xvalue("dt", "dt")
1887xvalue("t", "t")
1888xlabel("")
1889xbutton("Start", "simulate()")
1890xbutton("Stop", "stoprun = 1")
1891xpanel()
1892
1893vec_sizes = (prelength+mainlength)/dt + 1       // recorded traces are all this size
1894
1895stimdur = 1000
1896
1897objectvar stim1
1898goc.soma stim1 = new IClamp(0.5)
1899stim1.del = prelength
1900stim1.dur = stimdur
1901stim1.amp = 1.
1902
1903objectvar stim2
1904goc.soma stim2 = new IClamp(0.5)
1905stim2.del = prelength+1*stimdur
1906stim2.dur = stimdur
1907stim2.amp = 2.
1908
1909objectvar stim3
1910goc.soma stim3 = new IClamp(0.5)
1911stim3.del = prelength+2*stimdur
1912stim3.dur = stimdur
1913stim3.amp = 3.
1914
1915objectvar stim4
1916goc.soma stim4 = new IClamp(0.5)
1917stim4.del = prelength+3*stimdur
1918stim4.dur = stimdur
1919stim4.amp = 4.
1920
1921objref  iklog
1922iklog = new Vector(vec_sizes)
1923iklog.record (&goc.soma.ik(0.5))
1924
1925objref  inalog
1926inalog = new Vector(vec_sizes)
1927inalog.record (&goc.soma.ina(0.5))
1928
1929objref  icalog
1930icalog = new Vector(vec_sizes)
1931icalog.record (&goc.soma.ica(0.5))
1932
1933objref  ica2log
1934ica2log = new Vector(vec_sizes)
1935ica2log.record (&goc.soma.ica2(0.5))
1936
1937objref  Vlog
1938Vlog = new Vector(vec_sizes)
1939Vlog.record (&goc.soma.v(0.5))
1940
1941objref tlog
1942tlog = new Vector(vec_sizes,0)
1943tlog.record (&t)
1944
1945objref logfile
1946logfile = new File()
1947logfile.wopen ( "Golgi_protocol.dat" )
1948
1949simulate(logfile,tlog,Vlog,iklog,inalog,icalog,ica2log)
1950logfile.close()
1951
1952
1953quit()
1954EOF
1955)
1956
1957    ("reduced_protocol.hoc" () 
1958#<<EOF
1959load_file("nrngui.hoc")
1960load_file("Golgi_protocol.ses")
1961
1962// Load the Golgi cell template
1963xopen("Golgi_reduced_template.hoc")
1964objref goc
1965goc = new GoC()
1966
1967
1968prelength = 1000
1969mainlength = 5000
1970
1971
1972//**********************************************************************
1973proc simulate() { local preDT, mainDT, logsize  localobj logfile, tlog, Vlog, iklog, inalog, icalog, ica2log
1974   
1975    mainDT = 0.025
1976    preDT = 0.025
1977   
1978    dt = preDT
1979    tstop = prelength
1980    run()
1981   
1982   
1983    if ( stoprun == 1) return
1984   
1985    dt = mainDT
1986    continuerun(prelength + mainlength)
1987    if ( stoprun == 1) return
1988   
1989    logfile=$o1
1990    tlog=$o2
1991    Vlog=$o3
1992    iklog=$o4
1993    inalog=$o5
1994    icalog=$o6
1995    ica2log=$o7
1996   
1997    logsize = tlog.size()
1998   
1999    for i=0,tlog.size()-1 {
2000        logfile.printf("%g %g %g %g %g\n", tlog.x[i], Vlog.x[i], iklog.x[i], inalog.x[i], icalog.x[i], ica2log.x[i])
2001    }
2002
2003}
2004
2005
2006//*************User-Interface*******************************************
2007
2008nrnsecmenu(0.5, 1)
2009
2010xpanel("Spontaneous firing")
2011xvalue("Time for Initialization", "prelength")
2012xvalue("Main duration", "mainlength")
2013
2014xvalue("dt", "dt")
2015xvalue("t", "t")
2016xlabel("")
2017xbutton("Start", "simulate()")
2018xbutton("Stop", "stoprun = 1")
2019xpanel()
2020
2021vec_sizes = (prelength+mainlength)/dt + 1       // recorded traces are all this size
2022
2023stimdur = 1000
2024
2025objectvar stim1
2026goc.soma stim1 = new IClamp(0.5)
2027stim1.del = prelength
2028stim1.dur = stimdur
2029stim1.amp = 1.
2030
2031objectvar stim2
2032goc.soma stim2 = new IClamp(0.5)
2033stim2.del = prelength+1*stimdur
2034stim2.dur = stimdur
2035stim2.amp = 2.
2036
2037objectvar stim3
2038goc.soma stim3 = new IClamp(0.5)
2039stim3.del = prelength+2*stimdur
2040stim3.dur = stimdur
2041stim3.amp = 3.
2042
2043objectvar stim4
2044goc.soma stim4 = new IClamp(0.5)
2045stim4.del = prelength+3*stimdur
2046stim4.dur = stimdur
2047stim4.amp = 4.
2048
2049
2050objref  iklog
2051iklog = new Vector(vec_sizes)
2052iklog.record (&goc.soma.ik(0.5))
2053
2054objref  inalog
2055inalog = new Vector(vec_sizes)
2056inalog.record (&goc.soma.ina(0.5))
2057
2058objref  icalog
2059icalog = new Vector(vec_sizes)
2060icalog.record (&goc.soma.ica(0.5))
2061
2062objref  ica2log
2063ica2log = new Vector(vec_sizes)
2064ica2log.record (&goc.soma.ica2(0.5))
2065
2066objref  Vlog
2067Vlog = new Vector(vec_sizes)
2068Vlog.record (&goc.soma.v(0.5))
2069
2070objref tlog
2071tlog = new Vector(vec_sizes,0)
2072tlog.record (&t)
2073
2074objref logfile
2075logfile = new File()
2076logfile.wopen ( "Golgi_reduced_protocol.dat" )
2077
2078simulate(logfile,tlog,Vlog,iklog,inalog,icalog,ica2log)
2079logfile.close()
2080
2081
2082quit()
2083EOF
2084)
2085    ("protocol.ses" () 
2086#<<EOF
2087{load_file("nrngui.hoc")}
2088objectvar save_window_, rvp_
2089objectvar scene_vector_[4]
2090objectvar ocbox_, ocbox_list_, scene_, scene_list_
2091{ocbox_list_ = new List()  scene_list_ = new List()}
2092{pwman_place(0,0,0)}
2093{
2094save_window_ = new Graph(0)
2095save_window_.size(0,5500,-80,50)
2096scene_vector_[2] = save_window_
2097{save_window_.view(0, -80, 7000, 130, 477, 9, 774.9, 232.3)}
2098graphList[0].append(save_window_)
2099save_window_.save_name("graphList[0].")
2100save_window_.addexpr("v(.5)", 1, 1, 0.8, 0.9, 2)
2101}
2102{doNotify()}
2103EOF
2104)
2105
2106    (".hoc" () 
2107#<<EOF
2108
2109create soma
2110access soma
2111
2112insert {{model_name}}
2113
2114soma {
2115        nseg = 1
2116
2117{% with diam = default(diam, 5.65), L = default(L, 5.65), celsius = default(celsius, 23) %}
2118        diam = {{diam}}
2119        L = {{L}}
2120        celsius = {{celsius}}
2121{% endwith %}
2122
2123        cm = 1
2124
2125        Ra = 100
2126    }
2127EOF
2128)
2129
2130    ("plot_neuron_original_iclamp.m" () 
2131#<<EOF
2132
2133CaHVA0       = load ("original/CaHVA.dat");
2134CaHVA1       = load ("nemo_nmodl_generated/CaHVA.dat");
2135
2136CaLVA0       = load ("original/CaLVA.dat");
2137CaLVA1       = load ("nemo_nmodl_generated/CaLVA.dat");
2138
2139HCN10       = load ("original/HCN1.dat");
2140HCN11       = load ("nemo_nmodl_generated/HCN1.dat");
2141
2142HCN20       = load ("original/HCN2.dat");
2143HCN21       = load ("nemo_nmodl_generated/HCN2.dat");
2144
2145KA0       = load ("original/KA.dat");
2146KA1       = load ("nemo_nmodl_generated/KA.dat");
2147
2148KCa0       = load ("original/KCa.dat");
2149KCa1       = load ("nemo_nmodl_generated/KCa.dat");
2150
2151KM0      = load ("original/KM.dat");
2152KM1      = load ("nemo_nmodl_generated/KM.dat");
2153
2154KV0      = load ("original/KV.dat");
2155KV1      = load ("nemo_nmodl_generated/KV.dat");
2156
2157SK20      = load ("original/SK2.dat");
2158SK21      = load ("nemo_nmodl_generated/SK2.dat");
2159
2160Na0      = load ("original/Na.dat");
2161Na1      = load ("nemo_nmodl_generated/Na.dat");
2162
2163NaR0      = load ("original/NaR.dat");
2164NaR1      = load ("nemo_nmodl_generated/NaR.dat");
2165
2166NaP0      = load ("original/NaP.dat");
2167NaP1      = load ("nemo_nmodl_generated/NaP.dat");
2168
2169
2170subplot(3,4,1);
2171plot(CaHVA0(:,1),CaHVA0(:,2),CaHVA1(:,1),CaHVA1(:,2),'linewidth',2);
2172title ("CaHVA current");
2173
2174subplot(3,4,2);
2175plot(CaLVA0(:,1),CaLVA0(:,2),CaLVA1(:,1),CaLVA1(:,2),'linewidth',2);
2176title ("CaLVA current");
2177
2178subplot(3,4,3);
2179plot(HCN10(:,1),HCN10(:,2),HCN11(:,1),HCN11(:,2),'linewidth',2);
2180title ("HCN1 current");
2181
2182subplot(3,4,4);
2183plot(HCN20(:,1),HCN20(:,2),HCN21(:,1),HCN21(:,2),'linewidth',2);
2184title ("HCN2 current");
2185
2186subplot(3,4,5);
2187plot(KA0(:,1),KA0(:,2),KA1(:,1),KA1(:,2),'linewidth',2);
2188title ("KA current");
2189
2190subplot(3,4,6);
2191plot(KCa0(:,1),KCa0(:,2),KCa1(:,1),KCa1(:,2),'linewidth',2);
2192title ("KCa current");
2193
2194subplot(3,4,7);
2195plot(KM0(:,1),KM0(:,2),KM1(:,1),KM1(:,2),'linewidth',2);
2196title ("KM current");
2197
2198subplot(3,4,8);
2199plot(KV0(:,1),KV0(:,2),KV1(:,1),KV1(:,2),'linewidth',2);
2200title ("KV current");
2201
2202subplot(3,4,9);
2203plot(SK20(:,1),SK20(:,2),SK21(:,1),SK21(:,2),'linewidth',2);
2204title ("SK2 current");
2205
2206subplot(3,4,10);
2207plot(Na0(:,1),Na0(:,2),Na1(:,1),Na1(:,2),'linewidth',2);
2208title ("Na current");
2209
2210subplot(3,4,11);
2211plot(NaR0(:,1),NaR0(:,2),NaR1(:,1),NaR1(:,2),'linewidth',2);
2212title ("NaR current");
2213
2214subplot(3,4,12);
2215plot(NaP0(:,1),NaP0(:,2),NaP1(:,1),NaP1(:,2),'linewidth',2);
2216title ("NaP current");
2217
2218print  ("NEURON_Original_Iclamp.eps", "-depsc");
2219EOF
2220)
2221
2222
2223
2224    ("plot_neuron_original_vclamp.m" () 
2225#<<EOF
2226
2227CaHVA0       = load ("original/CaHVA.dat");
2228CaHVA1       = load ("nemo_nmodl_generated/CaHVA.dat");
2229
2230CaLVA0       = load ("original/CaLVA.dat");
2231CaLVA1       = load ("nemo_nmodl_generated/CaLVA.dat");
2232
2233HCN10       = load ("original/HCN1.dat");
2234HCN11       = load ("nemo_nmodl_generated/HCN1.dat");
2235
2236HCN20       = load ("original/HCN2.dat");
2237HCN21       = load ("nemo_nmodl_generated/HCN2.dat");
2238
2239KA0       = load ("original/KA.dat");
2240KA1       = load ("nemo_nmodl_generated/KA.dat");
2241
2242KCa0       = load ("original/KCa.dat");
2243KCa1       = load ("nemo_nmodl_generated/KCa.dat");
2244
2245KM0      = load ("original/KM.dat");
2246KM1      = load ("nemo_nmodl_generated/KM.dat");
2247
2248KV0      = load ("original/KV.dat");
2249KV1      = load ("nemo_nmodl_generated/KV.dat");
2250
2251SK20      = load ("original/SK2.dat");
2252SK21      = load ("nemo_nmodl_generated/SK2.dat");
2253
2254Na0      = load ("original/Na.dat");
2255Na1      = load ("nemo_nmodl_generated/Na.dat");
2256
2257NaR0      = load ("original/NaR.dat");
2258NaR1      = load ("nemo_nmodl_generated/NaR.dat");
2259
2260NaP0      = load ("original/NaP.dat");
2261NaP1      = load ("nemo_nmodl_generated/NaP.dat");
2262
2263
2264subplot(3,4,1);
2265plot(CaHVA0(:,1),CaHVA0(:,2),CaHVA1(:,1),CaHVA1(:,2),'linewidth',2);
2266title ("CaHVA current");
2267
2268subplot(3,4,2);
2269plot(CaLVA0(:,1),CaLVA0(:,2),CaLVA1(:,1),CaLVA1(:,2),'linewidth',2);
2270title ("CaLVA current");
2271
2272subplot(3,4,3);
2273plot(HCN10(:,1),HCN10(:,2),HCN11(:,1),HCN11(:,2),'linewidth',2);
2274title ("HCN1 current");
2275
2276subplot(3,4,4);
2277plot(HCN20(:,1),HCN20(:,2),HCN21(:,1),HCN21(:,2),'linewidth',2);
2278title ("HCN2 current");
2279
2280subplot(3,4,5);
2281plot(KA0(:,1),KA0(:,2),KA1(:,1),KA1(:,2),'linewidth',2);
2282title ("KA current");
2283
2284subplot(3,4,6);
2285plot(KCa0(:,1),KCa0(:,2),KCa1(:,1),KCa1(:,2),'linewidth',2);
2286title ("KCa current");
2287
2288subplot(3,4,7);
2289plot(KM0(:,1),KM0(:,2),KM1(:,1),KM1(:,2),'linewidth',2);
2290title ("KM current");
2291
2292subplot(3,4,8);
2293plot(KV0(:,1),KV0(:,2),KV1(:,1),KV1(:,2),'linewidth',2);
2294title ("KV current");
2295
2296subplot(3,4,9);
2297plot(SK20(:,1),SK20(:,2),SK21(:,1),SK21(:,2),'linewidth',2);
2298title ("SK2 current");
2299
2300subplot(3,4,10);
2301plot(Na0(:,1),Na0(:,2),Na1(:,1),Na1(:,2),'linewidth',2);
2302title ("Na current");
2303
2304subplot(3,4,11);
2305plot(NaR0(:,1),NaR0(:,2),NaR1(:,1),NaR1(:,2),'linewidth',2);
2306title ("NaR current");
2307
2308subplot(3,4,12);
2309plot(NaP0(:,1),NaP0(:,2),NaP1(:,1),NaP1(:,2),'linewidth',2);
2310title ("NaP current");
2311
2312print  ("NEURON_Original_Vclamp.eps", "-depsc");
2313
2314EOF
2315)
2316
2317    ("nestmodule_bootstrap.sh" () 
2318#<<EOF
2319#!/bin/sh
2320
2321echo "Bootstrapping Golgi module..."
2322
2323if test -d autom4te.cache ; then
2324# we must remove this cache, because it
2325# may screw up things if configure is run for
2326# different platforms.
2327  echo "  -> Removing old automake cache ..."
2328  rm -rf autom4te.cache
2329fi
2330
2331echo "  -> Running aclocal ..."
2332aclocal
2333
2334echo "  -> Running libtoolize ..."
2335if [ `uname -s` = Darwin ] ; then
2336# libtoolize is glibtoolize on OSX
2337  LIBTOOLIZE=glibtoolize
2338else 
2339  LIBTOOLIZE=libtoolize
2340fi
2341
2342libtool_major=`$LIBTOOLIZE --version | head -n1 | cut -d\) -f2 | cut -d\. -f1`
2343$LIBTOOLIZE --force --copy --ltdl
2344
2345echo "  -> Re-running aclocal ..."
2346if test $libtool_major -le 2; then
2347  aclocal --force
2348else
2349  aclocal --force -I $(pwd)/libltdl/m4
2350fi
2351
2352echo "  -> Running autoconf ..."
2353autoconf
2354
2355# autoheader must run before automake
2356echo "  -> Running autoheader ..."
2357autoheader
2358
2359echo "  -> Running automake ..."
2360automake --foreign --add-missing --force-missing --copy
2361
2362echo "Done."
2363
2364EOF
2365)
2366
2367    ("nestmodule_configure_gsl.ac" () 
2368#<<EOF
2369AC_PREREQ(2.52)
2370
2371AC_INIT(golgimodule, 1.0, raikov@oist.jp)
2372
2373# These variables are exported to include/config.h
2374GOLGIMODULE_MAJOR=1
2375GOLGIMODULE_MINOR=0
2376GOLGIMODULE_PATCHLEVEL=0
2377
2378# Exporting source and build directories requires full path names.
2379# Thus we have to expand.
2380# Here, we are in top build dir, since source dir must exist, we can just
2381# move there and call pwd
2382if test "x$srcdir" = x ; then
2383  PKGSRCDIR=`pwd`
2384else
2385  PKGSRCDIR=`cd $srcdir && pwd`
2386fi
2387PKGBUILDDIR=`pwd`
2388
2389# If this is not called, install-sh will be put into .. by bootstrap.sh
2390# moritz, 06-26-06
2391AC_CONFIG_AUX_DIR(.)
2392
2393AM_INIT_AUTOMAKE(nest, $GOLGIMODULE_VERSION)
2394
2395# obtain host system type; HEP 2004-12-20
2396AC_CANONICAL_HOST
2397
2398# ------------------------------------------------------------------------
2399# Handle options
2400#
2401# NOTE: No programs/compilations must be run in this section;
2402#       otherwise CFLAGS and CXXFLAGS may take on funny default
2403#       values.
2404#       HEP 2004-12-20
2405# ------------------------------------------------------------------------
2406
2407# nest-config
2408NEST_CONFIG=`which nest-config`
2409AC_ARG_WITH(nest,[  --with-nest=script  nest-config script including path],
2410[
2411  if test "$withval" != yes; then
2412    NEST_CONFIG=$withval
2413  else
2414    AC_MSG_ERROR([--with-nest-config expects the nest-config script as argument. See README for details.])
2415  fi
2416])
2417
2418# -------------------------------------------
2419# END Handle options
2420# -------------------------------------------
2421
2422
2423# does nest-config work
2424AC_MSG_CHECKING([for nest-config ])
2425AC_CHECK_FILE($NEST_CONFIG, HAVE_NEST=yes,
2426              AC_MSG_ERROR([No usable nest-config was found. You may want to use --with-nest-config.]))
2427AC_MSG_RESULT(found)
2428
2429AC_MSG_CHECKING([for sundials-config ])
2430AC_CHECK_FILE($SUNDIALS_CONFIG, HAVE_SUNDIALS=yes,
2431              AC_MSG_WARN([No usable sundials-config was found. You may want to use --with-sundials-config.]))
2432AC_MSG_RESULT(found)
2433
2434# the following will crash if nest-config does not run
2435# careful, lines below must not break
2436AC_MSG_CHECKING([for NEST directory information ])
2437NEST_PREFIX=`$NEST_CONFIG --prefix`
2438NEST_CPPFLAGS=`$NEST_CONFIG --cflags`
2439NEST_COMPILER=`$NEST_CONFIG --compiler`
2440if test $prefix = NONE; then prefix=`$NEST_CONFIG --prefix`; fi
2441AC_MSG_RESULT($NEST_CPPFLAGS)
2442
2443
2444# Set the platform-dependent compiler flags based on the canonical
2445# host string.  These flags are placed in AM_{C,CXX}FLAGS.  If
2446# {C,CXX}FLAGS are given as environment variables, then they are
2447# appended to the set of automatically chosen flags.  After
2448# {C,CXX}FLAGS have been read out, they must be cleared, since
2449# system-dependent defaults will otherwise be placed into the
2450# Makefiles.  HEP 2004-12-20.
2451
2452# Before we can determine the proper compiler flags, we must know
2453# which compiler we are using.  Since the pertaining AC macros run the
2454# compiler and set CFLAGS, CXXFLAGS to system-dependent values, we
2455# need to save command line/enviroment settings of these variables
2456# first. AC_AIX must run before the compiler is run, so we must run it
2457# here.
2458# HEP 2004-12-21
2459
2460GOLGIMODULE_SAVE_CXXFLAGS=$CXXFLAGS
2461
2462# Must first check if we are on AIX
2463AC_AIX
2464
2465# Check for C++ compiler, looking for the same compiler
2466# used with NEST
2467AC_PROG_CXX([ $NEST_COMPILER ])
2468
2469# the following is makeshift, should have the macro set proper
2470# GOLGIMODULE_SET_CXXFLAGS
2471AM_CXXFLAGS=$GOLGIMODULE_SAVE_CXXFLAGS
2472CXXFLAGS=
2473
2474## Configure C environment
2475
2476AC_PROG_LD
2477AC_PROG_INSTALL
2478
2479AC_LIBLTDL_CONVENIENCE     ## put libltdl into a convenience library
2480AC_PROG_LIBTOOL            ## use libtool
2481AC_CONFIG_SUBDIRS(libltdl) ## also configure subdir containing libltdl
2482
2483#-- Set the language to C++
2484AC_LANG_CPLUSPLUS
2485
2486#-- Look for programs needed in the Makefile
2487AC_PROG_CXXCPP
2488AM_PROG_LIBTOOL
2489AC_PATH_PROGS([MAKE],[gmake make],[make])
2490
2491# ---------------------------------------------------------------
2492# Configure directories to be built
2493# ---------------------------------------------------------------
2494
2495PKGDATADIR=$datadir/$PACKAGE
2496PKGDOCDIR=$datadir/doc/$PACKAGE
2497
2498# set up directories from which to build help
2499# second line replaces space with colon as separator
2500HELPDIRS="$PKGSRCDIR $PKGSRCDIR/sli"
2501HELPDIRS=`echo $HELPDIRS | tr " " ":"`
2502
2503#-- Replace these variables in *.in
2504AC_SUBST(HAVE_NEST)
2505AC_SUBST(NEST_CONFIG)
2506AC_SUBST(NEST_CPPFLAGS)
2507AC_SUBST(NEST_COMPILER)
2508AC_SUBST(NEST_PREFIX)
2509AC_SUBST(HELPDIRS)
2510AC_SUBST(PKGSRCDIR)
2511AC_SUBST(PKGBUILDDIR)
2512AC_SUBST(PKGDATADIR)
2513AC_SUBST(PKGDOCDIR)
2514AC_SUBST(KERNEL)
2515AC_SUBST(HOST)
2516AC_SUBST(SED)
2517AC_SUBST(LD)
2518AC_SUBST(host_os)
2519AC_SUBST(host_cpu)
2520AC_SUBST(host_vendor)
2521AC_SUBST(AS)
2522AC_SUBST(CXX)
2523AC_SUBST(AR)
2524AC_SUBST(ARFLAGS)
2525AC_SUBST(CXX_AR)
2526AC_SUBST(AM_CXXFLAGS)
2527AC_SUBST(AM_CFLAGS)
2528AC_SUBST(MAKE)
2529AC_SUBST(MAKE_FLAGS)
2530AC_SUBST(INCLTDL)
2531AC_SUBST(LIBLTDL)
2532
2533AM_CONFIG_HEADER(golgimodule_config.h:golgimodule_config.h.in)
2534AC_CONFIG_FILES(Makefile)
2535
2536# -----------------------------------------------
2537# Create output
2538# -----------------------------------------------
2539AC_OUTPUT
2540
2541
2542# -----------------------------------------------
2543# Report, after output at end of configure run
2544# Must come after AC_OUTPUT, so that it is
2545# displayed after libltdl has been configured
2546# -----------------------------------------------
2547
2548echo
2549echo "-------------------------------------------------------"
2550echo "Golgi module Configuration Summary"
2551echo "-------------------------------------------------------"
2552echo
2553echo "C++ compiler        : $CXX"
2554echo "C++ compiler flags  : $AM_CXXFLAGS"
2555echo "NEST compiler flags : $NEST_CPPFLAGS"
2556
2557# these variables will still contain '${prefix}'
2558# we want to have the versions where this is resolved, too:
2559eval eval eval  PKGDOCDIR_AS_CONFIGURED=$PKGDOCDIR
2560eval eval eval  PKGDATADIR_AS_CONFIGURED=$PKGDATADIR
2561
2562echo
2563echo "-------------------------------------------------------"
2564echo
2565echo "You can build and install Golgi module now, using"
2566echo "  make"
2567echo "  make install"
2568echo
2569echo "Golgi module will be installed to:"
2570echo -n "  "; eval eval echo "$libdir"
2571echo
2572
2573EOF
2574)
2575
2576    ("nestmodule_makefile_gsl.am" () 
2577#<<EOF
2578
2579# Automake file for external dynamic modules for NEST
2580#
2581# Hans Ekkehard Plesser, April 2008
2582# Automake file for the Developer Module
2583#
2584# libgolgimodule is built as a normal, installable library.
2585# It will be installed to $prefix/lib by make install.
2586#
2587# Headers from this directory are not to be installed upon
2588# make install. They are therefore included in _SOURCES.
2589
2590
2591libdir= @libdir@/nest
2592
2593lib_LTLIBRARIES=      golgimodule.la libgolgimodule.la
2594
2595golgimodule_la_CXXFLAGS= @AM_CXXFLAGS@
2596golgimodule_la_SOURCES=  golgimodule.cpp      golgimodule.h      \
2597                      Golgi.cpp Golgi.h
2598golgimodule_la_LDFLAGS=  -module
2599
2600libgolgimodule_la_CXXFLAGS= $(golgimodule_la_CXXFLAGS) -DLINKED_MODULE
2601libgolgimodule_la_SOURCES=  $(golgimodule_la_SOURCES)
2602
2603MAKEFLAGS= @MAKE_FLAGS@
2604
2605AM_CPPFLAGS= @NEST_CPPFLAGS@ \
2606             @INCLTDL@     
2607
2608AM_LDFLAGS =
2609
2610.PHONY: install-slidoc
2611
2612nobase_pkgdata_DATA=\
2613        golgimodule.sli
2614
2615install-slidoc:
2616        NESTRCFILENAME=/dev/null $(DESTDIR)$(NEST_PREFIX)/bin/sli --userargs="@HELPDIRS@" $(NEST_PREFIX)/share/nest/sli/install-help.sli
2617
2618install-data-hook: install-exec install-slidoc
2619
2620EXTRA_DIST= sli
2621
2622EOF
2623)
2624
2625    ("nestmodule_configure_cvode.ac" () 
2626#<<EOF
2627AC_PREREQ(2.52)
2628
2629AC_INIT(golgimodule, 1.0, raikov@oist.jp)
2630
2631# These variables are exported to include/config.h
2632GOLGIMODULE_MAJOR=1
2633GOLGIMODULE_MINOR=0
2634GOLGIMODULE_PATCHLEVEL=0
2635
2636# Exporting source and build directories requires full path names.
2637# Thus we have to expand.
2638# Here, we are in top build dir, since source dir must exist, we can just
2639# move there and call pwd
2640if test "x$srcdir" = x ; then
2641  PKGSRCDIR=`pwd`
2642else
2643  PKGSRCDIR=`cd $srcdir && pwd`
2644fi
2645PKGBUILDDIR=`pwd`
2646
2647# If this is not called, install-sh will be put into .. by bootstrap.sh
2648# moritz, 06-26-06
2649AC_CONFIG_AUX_DIR(.)
2650
2651AM_INIT_AUTOMAKE(nest, $GOLGIMODULE_VERSION)
2652
2653# obtain host system type; HEP 2004-12-20
2654AC_CANONICAL_HOST
2655
2656# ------------------------------------------------------------------------
2657# Handle options
2658#
2659# NOTE: No programs/compilations must be run in this section;
2660#       otherwise CFLAGS and CXXFLAGS may take on funny default
2661#       values.
2662#       HEP 2004-12-20
2663# ------------------------------------------------------------------------
2664
2665# nest-config
2666NEST_CONFIG=`which nest-config`
2667AC_ARG_WITH(nest,[  --with-nest=script  nest-config script including path],
2668[
2669  if test "$withval" != yes; then
2670    NEST_CONFIG=$withval
2671  else
2672    AC_MSG_ERROR([--with-nest-config expects the nest-config script as argument. See README for details.])
2673  fi
2674])
2675
2676# -------------------------------------------
2677# END Handle options
2678# -------------------------------------------
2679
2680# sundials-config
2681SUNDIALS_CONFIG=`which sundials-config`
2682AC_ARG_WITH(sundials,[  --with-sundials=script  sundials-config script including path],
2683[
2684  if test "$withval" != yes; then
2685    SUNDIALS_CONFIG=$withval
2686#  else
2687#    AC_MSG_ERROR([--with-sundials-config expects the sundials-config script as argument. See README for details.])
2688  fi
2689])
2690
2691
2692# does nest-config work
2693AC_MSG_CHECKING([for nest-config ])
2694AC_CHECK_FILE($NEST_CONFIG, HAVE_NEST=yes,
2695              AC_MSG_ERROR([No usable nest-config was found. You may want to use --with-nest-config.]))
2696AC_MSG_RESULT(found)
2697
2698AC_MSG_CHECKING([for sundials-config ])
2699AC_CHECK_FILE($SUNDIALS_CONFIG, HAVE_SUNDIALS=yes,
2700              AC_MSG_WARN([No usable sundials-config was found. You may want to use --with-sundials-config.]))
2701AC_MSG_RESULT(found)
2702
2703# the following will crash if nest-config does not run
2704# careful, lines below must not break
2705AC_MSG_CHECKING([for NEST directory information ])
2706NEST_PREFIX=`$NEST_CONFIG --prefix`
2707NEST_CPPFLAGS=`$NEST_CONFIG --cflags`
2708NEST_COMPILER=`$NEST_CONFIG --compiler`
2709if test $prefix = NONE; then prefix=`$NEST_CONFIG --prefix`; fi
2710AC_MSG_RESULT($NEST_CPPFLAGS)
2711
2712
2713AC_MSG_CHECKING([for SUNDIALS preprocessor flags ])
2714SUNDIALS_CPPFLAGS="`$SUNDIALS_CONFIG -m cvode -t s -l c -s cppflags`"
2715AC_MSG_RESULT($SUNDIALS_CPPFLAGS)
2716
2717AC_MSG_CHECKING([for SUNDIALS linker options ])
2718SUNDIALS_LDFLAGS="`$SUNDIALS_CONFIG -m cvode -t s -l c -s libs` -lblas -llapack"
2719AC_MSG_RESULT($SUNDIALS_LDFLAGS)
2720
2721# Set the platform-dependent compiler flags based on the canonical
2722# host string.  These flags are placed in AM_{C,CXX}FLAGS.  If
2723# {C,CXX}FLAGS are given as environment variables, then they are
2724# appended to the set of automatically chosen flags.  After
2725# {C,CXX}FLAGS have been read out, they must be cleared, since
2726# system-dependent defaults will otherwise be placed into the
2727# Makefiles.  HEP 2004-12-20.
2728
2729# Before we can determine the proper compiler flags, we must know
2730# which compiler we are using.  Since the pertaining AC macros run the
2731# compiler and set CFLAGS, CXXFLAGS to system-dependent values, we
2732# need to save command line/enviroment settings of these variables
2733# first. AC_AIX must run before the compiler is run, so we must run it
2734# here.
2735# HEP 2004-12-21
2736
2737GOLGIMODULE_SAVE_CXXFLAGS=$CXXFLAGS
2738
2739# Must first check if we are on AIX
2740AC_AIX
2741
2742# Check for C++ compiler, looking for the same compiler
2743# used with NEST
2744AC_PROG_CXX([ $NEST_COMPILER ])
2745
2746# the following is makeshift, should have the macro set proper
2747# GOLGIMODULE_SET_CXXFLAGS
2748AM_CXXFLAGS=$GOLGIMODULE_SAVE_CXXFLAGS
2749CXXFLAGS=
2750
2751## Configure C environment
2752
2753AC_PROG_LD
2754AC_PROG_INSTALL
2755
2756AC_LIBLTDL_CONVENIENCE     ## put libltdl into a convenience library
2757AC_PROG_LIBTOOL            ## use libtool
2758AC_CONFIG_SUBDIRS(libltdl) ## also configure subdir containing libltdl
2759
2760#-- Set the language to C++
2761AC_LANG_CPLUSPLUS
2762
2763#-- Look for programs needed in the Makefile
2764AC_PROG_CXXCPP
2765AM_PROG_LIBTOOL
2766AC_PATH_PROGS([MAKE],[gmake make],[make])
2767
2768# ---------------------------------------------------------------
2769# Configure directories to be built
2770# ---------------------------------------------------------------
2771
2772PKGDATADIR=$datadir/$PACKAGE
2773PKGDOCDIR=$datadir/doc/$PACKAGE
2774
2775# set up directories from which to build help
2776# second line replaces space with colon as separator
2777HELPDIRS="$PKGSRCDIR $PKGSRCDIR/sli"
2778HELPDIRS=`echo $HELPDIRS | tr " " ":"`
2779
2780#-- Replace these variables in *.in
2781AC_SUBST(HAVE_NEST)
2782AC_SUBST(NEST_CONFIG)
2783AC_SUBST(NEST_CPPFLAGS)
2784AC_SUBST(NEST_COMPILER)
2785AC_SUBST(NEST_PREFIX)
2786AC_SUBST(HELPDIRS)
2787AC_SUBST(PKGSRCDIR)
2788AC_SUBST(PKGBUILDDIR)
2789AC_SUBST(PKGDATADIR)
2790AC_SUBST(PKGDOCDIR)
2791AC_SUBST(KERNEL)
2792AC_SUBST(HOST)
2793AC_SUBST(SED)
2794AC_SUBST(LD)
2795AC_SUBST(host_os)
2796AC_SUBST(host_cpu)
2797AC_SUBST(host_vendor)
2798AC_SUBST(AS)
2799AC_SUBST(CXX)
2800AC_SUBST(AR)
2801AC_SUBST(ARFLAGS)
2802AC_SUBST(CXX_AR)
2803AC_SUBST(AM_CXXFLAGS)
2804AC_SUBST(AM_CFLAGS)
2805AC_SUBST(MAKE)
2806AC_SUBST(MAKE_FLAGS)
2807AC_SUBST(INCLTDL)
2808AC_SUBST(LIBLTDL)
2809AC_SUBST(SUNDIALS_CONFIG)
2810AC_SUBST(SUNDIALS_CPPFLAGS)
2811AC_SUBST(SUNDIALS_LDFLAGS)
2812
2813AM_CONFIG_HEADER(golgimodule_config.h:golgimodule_config.h.in)
2814AC_CONFIG_FILES(Makefile)
2815
2816# -----------------------------------------------
2817# Create output
2818# -----------------------------------------------
2819AC_OUTPUT
2820
2821
2822# -----------------------------------------------
2823# Report, after output at end of configure run
2824# Must come after AC_OUTPUT, so that it is
2825# displayed after libltdl has been configured
2826# -----------------------------------------------
2827
2828echo
2829echo "-------------------------------------------------------"
2830echo "Golgi module Configuration Summary"
2831echo "-------------------------------------------------------"
2832echo
2833echo "C++ compiler        : $CXX"
2834echo "C++ compiler flags  : $AM_CXXFLAGS"
2835echo "NEST compiler flags : $NEST_CPPFLAGS"
2836echo "SUNDIALS compiler flags : $SUNDIALS_CPPFLAGS"
2837echo "SUNDIALS linker flags : $SUNDIALS_LDFLAGS"
2838
2839# these variables will still contain '${prefix}'
2840# we want to have the versions where this is resolved, too:
2841eval eval eval  PKGDOCDIR_AS_CONFIGURED=$PKGDOCDIR
2842eval eval eval  PKGDATADIR_AS_CONFIGURED=$PKGDATADIR
2843
2844echo
2845echo "-------------------------------------------------------"
2846echo
2847echo "You can build and install Golgi module now, using"
2848echo "  make"
2849echo "  make install"
2850echo
2851echo "Golgi module will be installed to:"
2852echo -n "  "; eval eval echo "$libdir"
2853echo
2854
2855EOF
2856)
2857
2858    ("nestmodule_makefile_sundials.am" () 
2859#<<EOF
2860
2861# Automake file for external dynamic modules for NEST
2862#
2863# Hans Ekkehard Plesser, April 2008
2864# Automake file for the Developer Module
2865#
2866# libgolgimodule is built as a normal, installable library.
2867# It will be installed to $prefix/lib by make install.
2868#
2869# Headers from this directory are not to be installed upon
2870# make install. They are therefore included in _SOURCES.
2871
2872
2873libdir= @libdir@/nest
2874
2875lib_LTLIBRARIES=      golgimodule.la libgolgimodule.la
2876
2877golgimodule_la_CXXFLAGS= @AM_CXXFLAGS@
2878golgimodule_la_SOURCES=  golgimodule.cpp      golgimodule.h      \
2879                      Golgi.cpp Golgi.h
2880golgimodule_la_LDFLAGS=  -module
2881
2882libgolgimodule_la_CXXFLAGS= $(golgimodule_la_CXXFLAGS) -DLINKED_MODULE
2883libgolgimodule_la_SOURCES=  $(golgimodule_la_SOURCES)
2884
2885MAKEFLAGS= @MAKE_FLAGS@
2886
2887AM_CPPFLAGS= @NEST_CPPFLAGS@ \
2888             @SUNDIALS_CPPFLAGS@ \
2889             @INCLTDL@     
2890
2891AM_LDFLAGS = @SUNDIALS_LDFLAGS@
2892
2893.PHONY: install-slidoc
2894
2895nobase_pkgdata_DATA=\
2896        golgimodule.sli
2897
2898install-slidoc:
2899        NESTRCFILENAME=/dev/null $(DESTDIR)$(NEST_PREFIX)/bin/sli --userargs="@HELPDIRS@" $(NEST_PREFIX)/share/nest/sli/install-help.sli
2900
2901install-data-hook: install-exec install-slidoc
2902
2903EXTRA_DIST= sli
2904
2905EOF
2906)
2907
2908    ("nestmodule_configure_ida.ac" () 
2909#<<EOF
2910AC_PREREQ(2.52)
2911
2912AC_INIT(golgimodule, 1.0, raikov@oist.jp)
2913
2914# These variables are exported to include/config.h
2915GOLGIMODULE_MAJOR=1
2916GOLGIMODULE_MINOR=0
2917GOLGIMODULE_PATCHLEVEL=0
2918
2919# Exporting source and build directories requires full path names.
2920# Thus we have to expand.
2921# Here, we are in top build dir, since source dir must exist, we can just
2922# move there and call pwd
2923if test "x$srcdir" = x ; then
2924  PKGSRCDIR=`pwd`
2925else
2926  PKGSRCDIR=`cd $srcdir && pwd`
2927fi
2928PKGBUILDDIR=`pwd`
2929
2930# If this is not called, install-sh will be put into .. by bootstrap.sh
2931# moritz, 06-26-06
2932AC_CONFIG_AUX_DIR(.)
2933
2934AM_INIT_AUTOMAKE(nest, $GOLGIMODULE_VERSION)
2935
2936# obtain host system type; HEP 2004-12-20
2937AC_CANONICAL_HOST
2938
2939# ------------------------------------------------------------------------
2940# Handle options
2941#
2942# NOTE: No programs/compilations must be run in this section;
2943#       otherwise CFLAGS and CXXFLAGS may take on funny default
2944#       values.
2945#       HEP 2004-12-20
2946# ------------------------------------------------------------------------
2947
2948# nest-config
2949NEST_CONFIG=`which nest-config`
2950AC_ARG_WITH(nest,[  --with-nest=script  nest-config script including path],
2951[
2952  if test "$withval" != yes; then
2953    NEST_CONFIG=$withval
2954  else
2955    AC_MSG_ERROR([--with-nest-config expects the nest-config script as argument. See README for details.])
2956  fi
2957])
2958
2959# -------------------------------------------
2960# END Handle options
2961# -------------------------------------------
2962
2963# sundials-config
2964SUNDIALS_CONFIG=`which sundials-config`
2965AC_ARG_WITH(sundials,[  --with-sundials=script  sundials-config script including path],
2966[
2967  if test "$withval" != yes; then
2968    SUNDIALS_CONFIG=$withval
2969#  else
2970#    AC_MSG_ERROR([--with-sundials-config expects the sundials-config script as argument. See README for details.])
2971  fi
2972])
2973
2974
2975# does nest-config work
2976AC_MSG_CHECKING([for nest-config ])
2977AC_CHECK_FILE($NEST_CONFIG, HAVE_NEST=yes,
2978              AC_MSG_ERROR([No usable nest-config was found. You may want to use --with-nest-config.]))
2979AC_MSG_RESULT(found)
2980
2981AC_MSG_CHECKING([for sundials-config ])
2982AC_CHECK_FILE($SUNDIALS_CONFIG, HAVE_SUNDIALS=yes,
2983              AC_MSG_WARN([No usable sundials-config was found. You may want to use --with-sundials-config.]))
2984AC_MSG_RESULT(found)
2985
2986# the following will crash if nest-config does not run
2987# careful, lines below must not break
2988AC_MSG_CHECKING([for NEST directory information ])
2989NEST_PREFIX=`$NEST_CONFIG --prefix`
2990NEST_CPPFLAGS=`$NEST_CONFIG --cflags`
2991NEST_COMPILER=`$NEST_CONFIG --compiler`
2992if test $prefix = NONE; then prefix=`$NEST_CONFIG --prefix`; fi
2993AC_MSG_RESULT($NEST_CPPFLAGS)
2994
2995
2996AC_MSG_CHECKING([for SUNDIALS preprocessor flags ])
2997SUNDIALS_CPPFLAGS="`$SUNDIALS_CONFIG -m ida -t s -l c -s cppflags`"
2998AC_MSG_RESULT($SUNDIALS_CPPFLAGS)
2999
3000AC_MSG_CHECKING([for SUNDIALS linker options ])
3001SUNDIALS_LDFLAGS="`$SUNDIALS_CONFIG -m ida -t s -l c -s libs` -lblas -llapack"
3002AC_MSG_RESULT($SUNDIALS_LDFLAGS)
3003
3004# Set the platform-dependent compiler flags based on the canonical
3005# host string.  These flags are placed in AM_{C,CXX}FLAGS.  If
3006# {C,CXX}FLAGS are given as environment variables, then they are
3007# appended to the set of automatically chosen flags.  After
3008# {C,CXX}FLAGS have been read out, they must be cleared, since
3009# system-dependent defaults will otherwise be placed into the
3010# Makefiles.  HEP 2004-12-20.
3011
3012# Before we can determine the proper compiler flags, we must know
3013# which compiler we are using.  Since the pertaining AC macros run the
3014# compiler and set CFLAGS, CXXFLAGS to system-dependent values, we
3015# need to save command line/enviroment settings of these variables
3016# first. AC_AIX must run before the compiler is run, so we must run it
3017# here.
3018# HEP 2004-12-21
3019
3020GOLGIMODULE_SAVE_CXXFLAGS=$CXXFLAGS
3021
3022# Must first check if we are on AIX
3023AC_AIX
3024
3025# Check for C++ compiler, looking for the same compiler
3026# used with NEST
3027AC_PROG_CXX([ $NEST_COMPILER ])
3028
3029# the following is makeshift, should have the macro set proper
3030# GOLGIMODULE_SET_CXXFLAGS
3031AM_CXXFLAGS=$GOLGIMODULE_SAVE_CXXFLAGS
3032CXXFLAGS=
3033
3034## Configure C environment
3035
3036AC_PROG_LD
3037AC_PROG_INSTALL
3038
3039AC_LIBLTDL_CONVENIENCE     ## put libltdl into a convenience library
3040AC_PROG_LIBTOOL            ## use libtool
3041AC_CONFIG_SUBDIRS(libltdl) ## also configure subdir containing libltdl
3042
3043#-- Set the language to C++
3044AC_LANG_CPLUSPLUS
3045
3046#-- Look for programs needed in the Makefile
3047AC_PROG_CXXCPP
3048AM_PROG_LIBTOOL
3049AC_PATH_PROGS([MAKE],[gmake make],[make])
3050
3051# ---------------------------------------------------------------
3052# Configure directories to be built
3053# ---------------------------------------------------------------
3054
3055PKGDATADIR=$datadir/$PACKAGE
3056PKGDOCDIR=$datadir/doc/$PACKAGE
3057
3058# set up directories from which to build help
3059# second line replaces space with colon as separator
3060HELPDIRS="$PKGSRCDIR $PKGSRCDIR/sli"
3061HELPDIRS=`echo $HELPDIRS | tr " " ":"`
3062
3063#-- Replace these variables in *.in
3064AC_SUBST(HAVE_NEST)
3065AC_SUBST(NEST_CONFIG)
3066AC_SUBST(NEST_CPPFLAGS)
3067AC_SUBST(NEST_COMPILER)
3068AC_SUBST(NEST_PREFIX)
3069AC_SUBST(HELPDIRS)
3070AC_SUBST(PKGSRCDIR)
3071AC_SUBST(PKGBUILDDIR)
3072AC_SUBST(PKGDATADIR)
3073AC_SUBST(PKGDOCDIR)
3074AC_SUBST(KERNEL)
3075AC_SUBST(HOST)
3076AC_SUBST(SED)
3077AC_SUBST(LD)
3078AC_SUBST(host_os)
3079AC_SUBST(host_cpu)
3080AC_SUBST(host_vendor)
3081AC_SUBST(AS)
3082AC_SUBST(CXX)
3083AC_SUBST(AR)
3084AC_SUBST(ARFLAGS)
3085AC_SUBST(CXX_AR)
3086AC_SUBST(AM_CXXFLAGS)
3087AC_SUBST(AM_CFLAGS)
3088AC_SUBST(MAKE)
3089AC_SUBST(MAKE_FLAGS)
3090AC_SUBST(INCLTDL)
3091AC_SUBST(LIBLTDL)
3092AC_SUBST(SUNDIALS_CONFIG)
3093AC_SUBST(SUNDIALS_CPPFLAGS)
3094AC_SUBST(SUNDIALS_LDFLAGS)
3095
3096AM_CONFIG_HEADER(golgimodule_config.h:golgimodule_config.h.in)
3097AC_CONFIG_FILES(Makefile)
3098
3099# -----------------------------------------------
3100# Create output
3101# -----------------------------------------------
3102AC_OUTPUT
3103
3104
3105# -----------------------------------------------
3106# Report, after output at end of configure run
3107# Must come after AC_OUTPUT, so that it is
3108# displayed after libltdl has been configured
3109# -----------------------------------------------
3110
3111echo
3112echo "-------------------------------------------------------"
3113echo "Golgi module Configuration Summary"
3114echo "-------------------------------------------------------"
3115echo
3116echo "C++ compiler        : $CXX"
3117echo "C++ compiler flags  : $AM_CXXFLAGS"
3118echo "NEST compiler flags : $NEST_CPPFLAGS"
3119echo "SUNDIALS compiler flags : $SUNDIALS_CPPFLAGS"
3120echo "SUNDIALS linker flags : $SUNDIALS_LDFLAGS"
3121
3122# these variables will still contain '${prefix}'
3123# we want to have the versions where this is resolved, too:
3124eval eval eval  PKGDOCDIR_AS_CONFIGURED=$PKGDOCDIR
3125eval eval eval  PKGDATADIR_AS_CONFIGURED=$PKGDATADIR
3126
3127echo
3128echo "-------------------------------------------------------"
3129echo
3130echo "You can build and install Golgi module now, using"
3131echo "  make"
3132echo "  make install"
3133echo
3134echo "Golgi module will be installed to:"
3135echo -n "  "; eval eval echo "$libdir"
3136echo
3137
3138EOF
3139)
3140
3141
3142    ("nestmodule.cpp" () 
3143#<<EOF
3144/*
3145 *  golgimodule.cpp
3146 *  This file is part of NEST.
3147 *
3148 *  Copyright (C) 2008 by
3149 *  The NEST Initiative
3150 *
3151 *  See the file AUTHORS for details.
3152 *
3153 *  Permission is granted to compile and modify
3154 *  this file for non-commercial use.
3155 *  See the file LICENSE for details.
3156 *
3157 */
3158
3159// include necessary NEST headers
3160//#include "config.h"
3161#include "network.h"
3162#include "model.h"
3163#include "dynamicloader.h"
3164#include "genericmodel.h"
3165#include "generic_connector.h"
3166#include "booldatum.h"
3167#include "integerdatum.h"
3168#include "tokenarray.h"
3169#include "exceptions.h"
3170#include "sliexceptions.h"
3171#include "nestmodule.h"
3172
3173// include headers with your own stuff
3174#include "golgimodule.h"
3175#include "Golgi.h"
3176
3177// -- Interface to dynamic module loader ---------------------------------------
3178
3179/*
3180 * The dynamic module loader must be able to find your module.
3181 * You make the module known to the loader by defining an instance of your
3182 * module class in global scope. This instance must have the name
3183 *
3184 * <modulename>_LTX_mod
3185 *
3186 * The dynamicloader can then load modulename and search for symbol "mod" in it.
3187 */
3188 
3189golginest::GolgiModule golgimodule_LTX_mod;
3190
3191// -- DynModule functions ------------------------------------------------------
3192
3193golginest::GolgiModule::GolgiModule()
3194  {
3195#ifdef LINKED_MODULE
3196     // register this module at the dynamic loader
3197     // this is needed to allow for linking in this module at compile time
3198     // all registered modules will be initialized by the main app's dynamic loader
3199     nest::DynamicLoaderModule::registerLinkedModule(this);
3200#endif     
3201   }
3202
3203golginest::GolgiModule::~GolgiModule()
3204   {
3205   }
3206
3207   const std::string golginest::GolgiModule::name(void) const
3208   {
3209     return std::string("Golgi Module"); // Return name of the module
3210   }
3211
3212   const std::string golginest::GolgiModule::commandstring(void) const
3213   {
3214     return std::string("");
3215   }
3216
3217   /* BeginDocumentation
3218      Name: StepPatternConnect - Connect sources and targets with a stepping pattern
3219     
3220      Synopsis:
3221      [sources] source_step [targets] target_step synmod StepPatternConnect -> n_connections
3222     
3223      Parameters:
3224      [sources]     - Array containing GIDs of potential source neurons
3225      source_step   - Make connection from every source_step'th neuron
3226      [targets]     - Array containing GIDs of potential target neurons
3227      target_step   - Make connection to every target_step'th neuron
3228      synmod        - The synapse model to use (literal, must be key in synapsedict)
3229      n_connections - Number of connections made
3230     
3231      Description:
3232      This function subsamples the source and target arrays given with steps
3233      source_step and target_step, beginning with the first element in each array,
3234      and connects the selected nodes.
3235     
3236      Example:
3237      /first_src 0 /network_size get def
3238      /last_src /iaf_neuron 20 Create def  % nodes  1 .. 20
3239      /src [first_src last_src] Range def
3240      /last_tgt /iaf_neuron 10 Create def  % nodes 21 .. 30
3241      /tgt [last_src 1 add last_tgt] Range def
3242     
3243      src 6 tgt 4 /drop_odd_spike StepPatternConnect
3244 
3245      This connects nodes [1, 7, 13, 19] as sources to nodes [21, 25,
3246      29] as targets using synapses of type drop_odd_spike, and
3247      returning 12 as the number of connections.  The following
3248      command will print the connections (you must paste the SLI
3249      command as one long line):
3250
3251      src { /s Set << /source s /synapse_type /static_synapse >> FindConnections { GetStatus /target get } Map dup length 0 gt { cout s <- ( -> ) <- exch <-- endl } if ; } forall
3252      1 -> [21 25 29]
3253      7 -> [21 25 29]
3254      13 -> [21 25 29]
3255      19 -> [21 25 29]
3256     
3257      Remark:
3258      This function is only provided as an example for how to write your own
3259      interface function.
3260     
3261      Author:
3262      Hans Ekkehard Plesser
3263     
3264      SeeAlso:
3265      Connect, ConvergentConnect, DivergentConnect
3266   */
3267   void golginest::GolgiModule::StepPatternConnect_Vi_i_Vi_i_lFunction::execute(SLIInterpreter *i) const
3268   {
3269     // Check if we have (at least) five arguments on the stack.
3270     i->assert_stack_load(5);
3271
3272     // Retrieve source, source step, target, target step from the stack
3273     const TokenArray sources = getValue<TokenArray> (i->OStack.pick(4)); // bottom
3274     const long src_step      = getValue<long>       (i->OStack.pick(3));
3275     const TokenArray targets = getValue<TokenArray> (i->OStack.pick(2));
3276     const long tgt_step      = getValue<long>       (i->OStack.pick(1)); 
3277     const Name synmodel_name = getValue<std::string>(i->OStack.pick(0)); // top
3278     
3279     // Obtain synapse model index
3280     const Token synmodel
3281       = nest::NestModule::get_network().get_synapsedict().lookup(synmodel_name);
3282     if ( synmodel.empty() )
3283       throw nest::UnknownSynapseType(synmodel_name.toString());
3284     const nest::index synmodel_id = static_cast<nest::index>(synmodel);
3285
3286     // Build a list of targets with the given step
3287     TokenArray selected_targets;
3288     for ( size_t t = 0 ; t < targets.size() ; t += tgt_step )
3289       selected_targets.push_back(targets[t]);
3290     
3291     // Now connect all appropriate sources to this list of targets
3292     size_t Nconn = 0;  // counts connections
3293     for ( size_t s = 0 ; s < sources.size() ; s += src_step )
3294     {
3295       // We must first obtain the GID of the source as integer
3296       const nest::long_t sgid = getValue<nest::long_t>(sources[s]);
3297
3298       // nest::network::divergent_connect() requires weight and delay arrays. We want to use
3299       // default values from the synapse model, so we pass empty arrays.
3300       nest::NestModule::get_network().divergent_connect(sgid, selected_targets,
3301                                                         TokenArray(), TokenArray(),
3302                                                         synmodel_id);
3303       Nconn += selected_targets.size();
3304     }
3305
3306     // We get here only if none of the operations above throws and exception.
3307     // Now we can safely remove the arguments from the stack and push Nconn
3308     // as our result.
3309     i->OStack.pop(5);
3310     i->OStack.push(Nconn);
3311     
3312     // Finally, we pop the call to this functions from the execution stack.
3313     i->EStack.pop();
3314   }
3315
3316  //-------------------------------------------------------------------------------------
3317
3318  void golginest::GolgiModule::init(SLIInterpreter *i, nest::Network*)
3319  {
3320    /* Register a neuron or device model.
3321       Give node type as template argument and the name as second argument.
3322       The first argument is always a reference to the network.
3323       Return value is a handle for later unregistration.
3324    */
3325       nest::register_model<nest::Golgi>(nest::NestModule::get_network(),
3326                                            "Golgi");
3327
3328  }  // GolgiModule::init()
3329
3330 
3331
3332EOF
3333)
3334
3335    ("nestmodule.h" () 
3336#<<EOF
3337/*
3338 *  golgimodule.h
3339 *
3340 *  This file is part of NEST.
3341 *
3342 *  Copyright (C) 2008 by
3343 *  The NEST Initiative
3344 *
3345 *  See the file AUTHORS for details.
3346 *
3347 *  Permission is granted to compile and modify
3348 *  this file for non-commercial use.
3349 *  See the file LICENSE for details.
3350 *
3351 */
3352
3353#ifndef GOLGIMODULE_H
3354#define GolgiMODULE_H
3355
3356#include "dynmodule.h"
3357#include "slifunction.h"
3358
3359namespace nest
3360{
3361  class Network;
3362}
3363
3364// Put your stuff into your own namespace.
3365namespace golginest {
3366 
3367/**
3368 * Class defining your model.
3369 * @note For each model, you must define one such class, with a unique name.
3370 */
3371class GolgiModule : public DynModule
3372{
3373public:
3374
3375  // Interface functions ------------------------------------------
3376 
3377  /**
3378   * @note The constructor registers the module with the dynamic loader.
3379   *       Initialization proper is performed by the init() method.
3380   */
3381  GolgiModule();
3382 
3383  /**
3384   * @note The destructor does not do much in modules. Proper "downrigging"
3385   *       is the responsibility of the unregister() method.
3386   */
3387  ~GolgiModule();
3388
3389  /**
3390   * Initialize module by registering models with the network.
3391   * @param SLIInterpreter* SLI interpreter
3392   * @param nest::Network*  Network with which to register models
3393   * @note  Parameter Network is needed for historical compatibility
3394   *        only.
3395   */
3396  void init(SLIInterpreter*, nest::Network*);
3397
3398  /**
3399   * Return the name of your model.
3400   */
3401  const std::string name(void) const;
3402 
3403  /**
3404   * Return the name of a sli file to execute when golgimodule is loaded.
3405   * This mechanism can be used to define SLI commands associated with your
3406   * module, in particular, set up type tries for functions you have defined.
3407   */
3408  const std::string commandstring(void) const;
3409     
3410public:
3411 
3412  // Classes implementing your functions -----------------------------
3413 
3414  /**
3415   * Implement a function for a step-pattern-based connection.
3416   * @note What this function does is described in the SLI documentation
3417   *       in the cpp file.
3418   * @note The mangled name indicates this function expects the following
3419   *       arguments on the stack (bottom first): vector of int, int,
3420   *       vector of int, int.
3421   * @note You must define a member object in your module class
3422   *       of the function class. execute() is later invoked on this
3423   *       member.
3424   */
3425  class StepPatternConnect_Vi_i_Vi_i_lFunction: public SLIFunction
3426     {
3427     public:
3428       void execute(SLIInterpreter *) const;
3429     };
3430
3431     StepPatternConnect_Vi_i_Vi_i_lFunction stepPatternConnect_Vi_i_Vi_i_lFunction;
3432  };
3433} // namespace golginest
3434
3435#endif
3436
3437EOF
3438)
3439
3440    ("golgimodule.sli" () 
3441#<<EOF
3442/*
3443 * Initialization file for GolgiModule.
3444 * Run automatically when GolgiModule is loaded.
3445 */
3446
3447M_DEBUG (golgimodule.sli) (Initializing SLI support for GolgiModule.) message
3448
3449/StepPatternConnect [ /arraytype /integertype /arraytype /integertype /literaltype ]
3450{
3451  StepPatternConnect_Vi_i_Vi_i_l
3452} def
3453
3454EOF
3455)
3456
3457    ("testrun.sli" () 
3458#<<EOF
3459
3460/dt 0.025 def
3461
3462ResetKernel
34630
3464 <<
3465   /resolution  dt
3466 >> SetStatus
3467
3468(golgimodule) Install
3469/neuron /Golgi Create def
3470/neuron_params << /V_m -65.0 >> def
3471neuron neuron_params SetStatus
3472
3473/stepinput /step_current_generator Create def
3474/vlog /voltmeter Create def
3475/vlog_parameters << /interval dt /to_file true /to_memory false >> def
3476vlog vlog_parameters SetStatus
3477
3478stepinput neuron Connect
3479vlog neuron Connect
3480
3481/step_current_parameters << /amplitude_times [0.0 1000.0 2000.0 3000.0 4000.0 5000.0] /amplitude_values [0.0 1000.0 2000.0 3000.0 4000.0 0.0 ] >> def
3482stepinput step_current_parameters SetStatus
3483
34846000.0 Simulate
3485
3486EOF
3487)
3488
3489    ("netstim.sli" () 
3490#<<EOF
3491
3492(golgimodule) Install
3493
3494[ 1.0 20.0 50.0 100.0 200.0 ]
3495
3496{
3497
3498/i exch def
3499
3500(Golgi_netstim_) i cvs (_Hz) join join /label exch def
3501
3502/dt 0.025 def
3503
3504/seeds 0 /total_num_virtual_procs get array 1 add def
3505
3506ResetKernel
35070
3508 <<
3509   /resolution  dt
3510   /rng_seeds seeds
3511 >> SetStatus
3512
3513/neuron /Golgi Create def
3514/neuron_params << /V_m -65.0 >> def
3515neuron neuron_params SetStatus
3516
3517/input1 /poisson_generator Create def
3518/input2 /poisson_generator Create def
3519/input3 /poisson_generator Create def
3520
3521/vlog /voltmeter Create def
3522
3523/poisson_parameters1 << /rate i Hz /start 1000.0 >> def
3524input1 poisson_parameters1 SetStatus
3525
3526/poisson_parameters2 << /rate i Hz /start 1000.0 >> def
3527input2 poisson_parameters2 SetStatus
3528
3529/poisson_parameters3 << /rate i Hz /start 1000.0 >> def
3530input3 poisson_parameters3 SetStatus
3531
3532/vlog_parameters << /interval dt /label label /to_file true  /to_memory false >> def
3533vlog vlog_parameters SetStatus
3534
3535/conn_parameters1 << /receptor_type 1 /weight 0.1 /delay 1.0 >> def
3536input1 neuron conn_parameters1 Connect
3537
3538/conn_parameters2 << /receptor_type 1 /weight 0.1 /delay 12.0 >> def
3539input2 neuron conn_parameters2 Connect
3540
3541/conn_parameters3 << /receptor_type 1 /weight 0.1 /delay 15.0 >> def
3542input3 neuron conn_parameters3 Connect
3543
3544vlog neuron Connect
3545
35466000.0 Simulate
3547
3548i
3549}
3550Map
3551EOF
3552)
3553
3554))
Note: See TracBrowser for help on using the repository browser.