This is probably not doing what you meant to do, although I'm not entirely sure what your question is.
The following HOC code (did you want to use Python instead of HOC?)
Code: Select all
soma {
nseg = 10000
L = 1// [µm] length
diam = 0.1 // [µm] diameter
creates a single section called
soma with total length of just L=1 micron, divided into 10,000 pieces each 0.1 nm long. Perhaps you meant something more like
L=1001 nseg=1001?
I'm guessing your mechanisms
enae or
eke are accumulation mechanisms for sodium and potassium that make their concentrations change in response to the currents? If so (and I realize this may be the point of your investigation), keep in mind that without a pump or other stabilization mechanism, after a sufficiently long period of time of continuous firing, the intracellular potassium concentration will increase and the sodium concentration will decrease to the point where the cell is no longer able to fire.
Instead of printing out the membrane potentials at each time step, it's probably better to use a
Vector to
record the state variables (potentials, concentrations, etc) that you're interested in so that you can analyze and plot them later.
A few other hints:
- Start with simple models (e.g. can you record an action potential for a single compartment cell with Hodgkin-Huxley channels?) before proceeding to more complicated ones, especially if your just learning a tool.
- You generally want to use an odd value for nseg because that allows you to easily refine your discretization (by increasing nseg by a factor of 3) and preserve all the previous node locations so you can check for convergence.
- An axon with diameter 0.1 microns is possible, but smaller than most.
- Since this is the NEURON + Python forum, I would be remiss if I didn't point out that there is a tutorial about using Python (as opposed to HOC) to do things like this at: https://neuron.yale.edu/neuron/static/d ... tick1.html