π» Coding Mission
Simulate V(t) with Spike Detection
Click Run to start Python
Simulate membrane voltage over 150 ms and count the spikes. Your task: 1. Set up all 8 LIF parameters 2. Initialize: v = el, spike_times = [] 3. Loop range(int(t_max/dt)) 4. Each step: a. t = step * dt b. i_t = i_mean * (1 + np.sin(2 * np.pi * t / 0.01)) c. v = v + (dt / tau) * (el - v + r * i_t) d. if v >= vth: append t to spike_times, reset v = vr 5. Print total spike count and first 3 spike times in ms
Hints (only if you're stuck!)
solution.py
β Loading...