3. Numerical integration of the HH model of the squid axon¶
See Chapter 2 Section 2 on general information about the Hodgkin-Huxley equations and models.
hodgkin_huxley.HH module contains all code required for this exercise.
At the beginning of your exercise solutions, import the contained functions by running
from neurodynex.hodgkin_huxley.HH import *
You can then simply run the exercise functions by executing
HH_Step() # example Step-current injection HH_Sinus() # example Sinus-current injection HH_Ramp() # example Ramp-current injection
Use the function
HH_Step() to simulate a HH
neuron stimulated by a current step of a given amplitude. The goal of
this exercise is to modify the provided python functions and use the
matplotlib packages to answer the following questions.
What is the lowest step current amplitude for generating at least one spike? Hint: use binary search on
I_amp, with a \(0.1\mu A\) resolution.
What is the lowest step current amplitude to generate repetitive firing?
Use the function
HH_Ramp() to simulate a HH neuron stimulated by a ramping curent.
What is the minimum current required to make a spike when the current is slowly increased (ramp current waveform) instead of being increased suddenly?
To solve this exercise, you will need to change the actual implementation of the model. Download directly the source file HH.py. When starting Python in the directory containing the downloaded file, you run functions from it directly as follows:
import HH # import the HH module, i.e. the HH.py file HH.HH_Step() # access the LIF_Step function in HH.py
Then use any text editor to make changes in the
You might have to reload the module for changes to become active - quitting and restarting the python interpreter reloads all modules. Alternatively, you can also force a reload by typing
For automatic reloading you can also run
ipython instead of
python and set the autoreload flag. For this, make sure you have ipython installed - if you have followed the setup instructions for anaconda/miniconda this should already work.