def frequency(): no_test = 800 max_current = 8 f = [] for i in range(800): x = NLIF(3, 0.1, I=i * max_current / no_test, duration=200) if (len(x.spike) > 1): f.append(1 / (x.spike[1] - x.spike[0])) elif (len(x.spike) == 1): f.append(1 / x.time[-1]) else: f.append(0) my_plot(True, 7, np.arange(0, max_current, max_current/no_test), f, 'F - I', 'Current', 'Frequency', 1)
def plot(self): my_plot(False, self.fig, self.time, self.u, 'U - T', 'Time', 'Potential', 2, self.time, self.current_lst, 'I - T', 'Time', 'Current') return