File: parameter_changes.py

package info (click to toggle)
pynn 0.10.1-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 6,156 kB
  • sloc: python: 25,612; cpp: 320; makefile: 117; sh: 80
file content (23 lines) | stat: -rw-r--r-- 629 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
"""

"""

from pyNN.utility import get_simulator
sim, options = get_simulator()

sim.setup(timestep=0.01)

cell = sim.Population(1, sim.EIF_cond_exp_isfa_ista(v_thresh=-55.0, tau_refrac=5.0))
current_source = sim.StepCurrentSource(times=[50.0, 200.0, 250.0, 400.0, 450.0, 600.0, 650.0, 800.0],
                                       amplitudes=[1.0, 0.0, 1.0, 0.0, 1.0, 0.0, 1.0, 0.0])
cell.inject(current_source)
cell.record('v')

for a in (0.0, 4.0, 20.0, 100.0):
    print("Setting current to %g nA" % a)
    cell.set(a=a)
    sim.run(200.0)

cell.write_data("Results/parameter_changes_%s.pkl" % options.simulator)

sim.end()