The code in this repository simulates an Integrate-and-Fire neuron. A description of the model can be found in this blog post.
I used a basic Euler method for numerical integration, which might not be accurate for large time steps or fast dynamics. For a more accurate simulation, you might want to use a more sophisticated method like Runge-Kutta or use a library like Brian2 that is specifically designed for simulating spiking neural networks.
The code is implemented in an interactive Jupyter notebook and you can change the parameters of model using sliders. You can run the notebook in Google Colab or Binder by clicking on onf of the buttons below:
Or download the notebook from this repository and run it locally.
The code models a single Integrate-and-Fire neuron for different input currents
Second, a the membrane potential
Third, a the membrane potential
Simulating input currents with different intensities and durations:
Please feel free to use the code for your own projects. If you find a bug or have a suggestion for improvement, please open an issue or send me an email.
If you use the code in your own projects, please cite it using the citation information:
Musacchio (2023), The Integrate and Fire Model: A simple neuronal model, https://www.fabriziomusacchio.com/blog/2023-07-03-integrate_and_fire_model/
or
@misc{Musacchio2023,
author = {Musacchio, Fabrizio},
title = {The Integrate and Fire Model: A simple neuronal model},
year = {2023},
publisher = {GitHub},
journal = {GitHub repository},
howpublished = {\url{https://www.fabriziomusacchio.com/blog/2023-07-03-integrate-and-fire-model/}},
}