FacetsPythonCourse2008: interactive_session_part_1_1.py
| File interactive_session_part_1_1.py, 321 bytes (added by goodman, 7 months ago) |
|---|
| Line | |
|---|---|
| 1 | from brian import * |
| 2 | |
| 3 | tau = 10*ms |
| 4 | Vt = -55*mV |
| 5 | Vr = -70*mV |
| 6 | El = -54*mV |
| 7 | |
| 8 | eqs = ''' |
| 9 | dV/dt = -(V-El)/tau : volt |
| 10 | ''' |
| 11 | |
| 12 | model = Model(equations=eqs, |
| 13 | threshold=Vt, reset=Vr) |
| 14 | |
| 15 | neuron = NeuronGroup(1, model) |
| 16 | |
| 17 | M = StateMonitor(neuron,'V', record=True) |
| 18 | |
| 19 | run(200*ms) |
| 20 | |
| 21 | plot(M.times, M[0]) |
| 22 | show() |

