Giter VIP home page Giter VIP logo

hodgkin-huxley_simulation's Introduction

The Hodgkin-Huxley Model - README

I wrote this script to demonstrate and simulate The Hodgkin-Huxley model for a group of students.You can use any IDE to run the code, but I recommend Jupyter Lab. Make sure you install the dependencies. Remy Cohan, July 2023.

Introduction

The Hodgkin-Huxley Model describes how action potentials in neurons are initiated and propagated. Developed by Alan Hodgkin and Andrew Huxley in 1952 based on their experiments on the giant axon of the squid, this model describes the electrical characteristics of the cell membrane and won them the Nobel Prize in Physiology or Medicine in 1963.

Neurophysiology of The Hodgkin-Huxley Model

1. Action Potentials:

An action potential is a rapid rise and subsequent fall in voltage or membrane potential across a cellular membrane. It's a fundamental signal in the nervous system, enabling the transmission of information over long distances.

2. Ionic Basis:

The variation in membrane potential during an action potential arises due to selective ion currents through voltage-gated ion channels. The key ions involved are sodium (Na+), potassium (K+), and leak ions.

3. Gating Variables:

The voltage-gated ion channels can open or close in response to the voltage across the membrane. This behavior is represented by gating variables (n, m, and h), which describe the probability of a channel being open.

  • n: Gating variable for potassium channels.
  • m: Gating variable for sodium activation.
  • h: Gating variable for sodium inactivation.

Code Explanation

Libraries and Dependencies

  1. numpy: For mathematical operations and handling arrays.
  2. matplotlib.pyplot: For plotting the results.
  3. matplotlib.animation: For creating animated plots.
  4. scipy.integrate: To solve the differential equations of the model.

Constants:

  • Cm: Membrane capacitance. Determines how the membrane potential responds to the currents.
  • g_Na, g_K, g_L: Maximum conductances for sodium, potassium, and leak channels, respectively.
  • E_Na, E_K, E_L: Reversal potentials for sodium, potassium, and leak channels. These determine the direction and magnitude of ion flow.

Gating Variable Functions:

These functions (alpha and beta for each n, m, and h) represent the voltage-dependent transition rates between the open and closed states of the ion channels.

Hodgkin-Huxley Model:

The function hodgkin_huxley encapsulates the differential equations that describe the model. These equations are derived from the currents through the ion channels and the voltage across the membrane.

Simulation:

  1. Initial conditions: The initial values for membrane potential and the gating variables are set.
  2. Time vector: Defines the simulation time.
  3. ODE Solution: Using odeint from SciPy, the system of differential equations is solved over the defined time.
  4. Plotting and Animation: The solution, representing the membrane potential over time, is plotted and animated to visualize the action potential.

Output:

The code creates an animated GIF representing the action potential as a function of time, visualizing the effect of the injected current on the membrane potential.

The Hodgkin-Huxley Model Simulation by Remy Cohan

This project is licensed under the GPLv3 Remy Cohan 2023

hodgkin-huxley_simulation's People

Contributors

cohanr avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.