Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

neuronmd-0.1.2.tar.gz (5.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

neuronmd-0.1.2-py3-none-any.whl (7.3 kB view details)

Uploaded Python 3

File details

Details for the file neuronmd-0.1.2.tar.gz.

File metadata

  • Download URL: neuronmd-0.1.2.tar.gz
  • Upload date:
  • Size: 5.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.24.0 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.8.10

File hashes

Hashes for neuronmd-0.1.2.tar.gz
Algorithm Hash digest
SHA256 32fbaed48c9708b4a21c6020e33dd61b3d7deca785a2acb44be37415d7807390
MD5 0a27836ac8470ca39a4d4b51be978106
BLAKE2b-256 dc56ebbbc86e48608a5e23d0b2438ef7831c3b1c802ba86fa5cd4cd6692fbe9a

See more details on using hashes here.

File details

Details for the file neuronmd-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: neuronmd-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 7.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.24.0 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.8.10

File hashes

Hashes for neuronmd-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 babeac635d266dd4bd3d72a30427d1829add4608b81b0c0d493843519ab68618
MD5 3348f3f042096c83489431a1e23c9b8a
BLAKE2b-256 981c490dc39fc21002fb231cf442350b8a7bf3b5126e083b7d19fb4cab7dcd1b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page