Skip to content

Instantly share code, notes, and snippets.

View danielmk's full-sized avatar

Daniel Müller-Komorowska danielmk

View GitHub Profile
@danielmk
danielmk / voltage_clamp_simulator.py
Last active July 14, 2019 17:10
Uses python with NEURON to simulate voltage clamping a ball-and-stick cell
# -*- coding: utf-8 -*-
"""
Uses python with NEURON to simulate voltage clamping a ball-and-stick cell.
Tested in Python 3.7.3 and NEURON 7.6.7
Author: @scidanm
"""
from neuron import h, gui
@danielmk
danielmk / hodgkin-huxley-cortical-pyramidal-neuron.py
Last active July 14, 2019 17:10
Python implementation of a Hodgkin-Huxley model of a cortical pyramidal neuron
# -*- coding: utf-8 -*-
"""
Python implementation of a Hodgkin-Huxley model of a cortical pyramidal neuron.
Code taken in large parts from https://gist.github.com/giuseppebonaccorso/60ce3eb3a829b94abf64ab2b7a56aaef
Adapted to work with solve_ivp.
Parameters changed to a cortical pyramidal neuron as described in https://neuronaldynamics.epfl.ch/online/Ch2.S2.html
Tested in Python 3.7.3
@danielmk
danielmk / izhikevich-first-order-euler.py
Last active July 14, 2019 17:10
A Python implementation of the Izhikevich Neuron as described in Izhikevich E.M. (2003).
# -*- coding: utf-8 -*-
"""
A Python implementation of the Izhikevich Neuron as described in Izhikevich E.M. (2003)
Tested in Python 3.7.3
Author: @scidanm
"""
import numpy as np
@danielmk
danielmk / persistent-sodium-plus-potassium-odeint.py
Last active July 14, 2019 17:10
A Python implementation of a persistent sodium plus potassium model of neuronal firing
# -*- coding: utf-8 -*-
"""
A two dimensional dynamic system with leak current, persistent sodium current
and transient potassium current. Exhibits spiking behavior and some other cool
stuff. The equations and their paremeters come from "Dynamical Systems in
Neuroscience: The Geometry of Excitability and Bursting" by Izhikevich,
Eugene M. There it says: "This model is equivalent in many respects to the
well-known and widely used ICa+Ik-model proposed by Morris and Lecar (1981)
to describe voltage oscillations in the barnacle giant muscle fiber." (p.89)