Package for simulating spiking neuron models
Project description
NeuronMd
Package for simulating different spiking neuron models.
Installation
Install using pip
:
pip install neuronmd
Clone the repository:
git clone https://github.com/sowmyamanojna/neuronmd
Then, cd
into the directory and run:
pip install .
Neuron Models
Hodgkin-Huxley Neuron Model
The HH neuron model can be simulated by creating an instance of the HHNeuron
class.
The code is as follows:
import numpy as np
from neuronmd import HHNeuron
# Initialize a HH Neuron Class
hhneuron = HHNeuron()
# tmax - Max time (ms) to simulate the neuron
# dt - time step of simulation
# I - Current for simulating the neuron
tmax = 100
dt = 0.01
I = 0.1
t = np.arange(0, tmax, dt)
# Simulate the neuron for a single current instance
hhneuron.simulate(t, I)
# Plot the results
hhneuron.plot()
# View the variation in the state of the dynamical
# system, as the input current is varied.
current_list = np.arange(0.01, 0.5, 0.01)
hhneuron.animate(t, ylim=[-85,40], current_list=current_list)
hhneuron.animate(t, current_list=current_list, name="no_ylim")
The results obtained from the above code:
The default parameters used in the model are:
v = -65 # mV
vna = 50 # mV
vk = -77 # mV
vl = -54.387 # mV
gnamax = 1.20 # m.mho/cm**2
gkmax = 0.36 # m.mho/cm**2
gl = 0.003 # m.mho/cm**2
cm = 0.01 # mF/cm**2
m = 0.0530
h = 0.5960
n = 0.3177
The parameters can be changed using the change_params
function. A dict of params as keys and their corresponding values should be passed as the parameter.
Izhikevich Neuron Model
The Izhikevich neuron model can be simulated by creating an instance of the IzhNeuron
class.
The code is as follows:
izhneuron = IzhNeuron()
tmax = 1000
dt = 0.01
t = np.arange(0, tmax, dt)
I = 5
izhneuron.simulate(t, I)
izhneuron.plot()
current_list = np.arange(0.01, 10, 0.5)
izhneuron.animate(t, ylim=[-80,35], current_list=current_list)
izhneuron.animate(t, current_list=current_list, name="no_ylim")
The results obtained from the above code:
The default parameters used in the model are:
a = 0.02
b = 0.2
c = -65
d = 8
v = -65
u = b * v
The above values correspond to Regular Spiking neuron.
The parameters can be changed using the change_params
function. A dict of params as keys and their corresponding values should be passed as the parameter.
Fitz-Hugh Nagumo Neuron Model
The Fitz-Hugh Nagumo neuron model can be simulated by creating an instance of the FHNNeuron
class.
The code is as follows:
fhnneuron = FHNNeuron()
tmax = 100
dt = 0.01
I = 1.75
t = np.arange(0, tmax, dt)
fhnneuron.simulate(0.6, 0, t, 0.6)
fhnneuron.plot(name="0.1")
current_list = np.arange(0.01, I, 0.01)
fhnneuron.animate(t, current_list, ylim=[-0.45,1.5])
fhnneuron.animate(t, current_list=current_list, name="no_ylim")
The results obtained from the above code:
The default parameters used in the model are:
a = 0.5
b = 0.1
r = 0.1
The parameters can be changed using the change_params
function. A dict of params as keys and their corresponding values should be passed as the parameter.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for neuronmd-0.1.1.post1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d695ab4b98d732b68dd525d7db97d7a948bfe82dc455274b424d0e5d28041a7f |
|
MD5 | eea288490bdf77d2ed37519cd14fa18b |
|
BLAKE2b-256 | fb56ab6fee244add44ad5572208b7d9fc456ed0f418cb77c209598ddc35c74d6 |