-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathHH-test.py
More file actions
33 lines (25 loc) · 777 Bytes
/
HH-test.py
File metadata and controls
33 lines (25 loc) · 777 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
from __init__ import *
from HH import HH
from plot import plot
'''Test EULER METHOD
There's unity test, it's necessary to compare the output image with the image from the folder expected-results
Parameters for test:
Cm = 1.0 # uF/cm^2
VNa = 50 # mV
VK = -77 # mV
Vl = -54.4 # mV
gNa = 120 # ms/cm^2
gK = 36 # ms/cm^2
gl = 0.3 # ms/cm^2
restV = -65 # mV
'''
neuron = HH()
time = 500
dt = 0.01
steps = math.ceil(time / dt)
I = [0 if 200/dt <= i <= 300/dt else 10 for i in range(steps)]
# Comment the test you do not wish to do
# TEST : EULER
plot(neuron, time, dt, I, 0)
#TEST : RK4
# plot(neuron, time, dt, I, 1)