Hodgkin-Huxley Nerve Model

This is a pet project I created to play around with Silverlight technologies. My initial inspiration was related to the very early stages of what I think became Microsoft Semblio, a system to create and share educational resources.
My aim was to build something that did a lot of processing, used some key Silverlight features, and would maybe educate or entertain anyone who stumbled on this page.
It is indeed quite ugly. Its ugliness rivals that of this web page.

The Silverlight application below models nerves using the equations from Hudgkin's and Huxley's work. I'm not going to go over the nerve model. Search for it and read about it on your own. There are plenty of references. All you need to know is that when a nerve is stimulated, it fires out a high voltage signal. You can see this in the spike in the top graph.

  1. Click the "Stimulate" button quickly. The first time you click, it stimulates the nerve to spike. For a short while after that, the nerve cannot be stimulated again. This is essential to keep the nerves of your body from constantly firing.
  2. Turn the constant stimulus to 13. Then try to get the nerve to spike by clicking the "Stimulate" button. That positive constant stimulus inhibits firing. A positive constant stimulus can happen when your body's salt contents are out of balance. Your heart can just stop.
  3. Now put in a -10 in the constant stimulus. This models your heart beating. Yes, your heart can beat on its own, without your brain. Now try to stimulate it. It's hard to get the nerve to spike between its periodic spiking. If this represents how your heart works, then this inhibition to external stimulus is a good thing as you don't want your heart's pulse to be easily interrupted.
  4. Change the constant stimulus to -6 then -7 then -8 then -9. Notice the ion channel activations start to 'wobble'. Give it a 5 volt 0.5 ms stimulus. Now there's clear periodic action in the cell but it won't spike. Give is a 15 volt 0.5 ms stimulus and see what happens.

That's all. There's some text below the application with a little more explanation.

Get Microsoft Silverlight

The top graph shows the "membrane potential" which is the voltage difference between the inside and outside of the nerve cell. When that spikes up, the nerve has been stimulated enough to "fire". This is how your heart beats and muscles get activated.
The top graph also shows the stimulus voltage. When a nerve's neighbors fire, it stimulates the nerve. If enough connected nerves fire, the nerve will fire (gross simplification). This is how signals travel down your spine and probably how you think.
The bottom graph shows how easily different ions can flow into and out of the cell. Ions going into and out of the cell is how the voltage across the nerve's membrane can jump so high. Having an imbalance of these ions in your body can cause your muscles to twitch (too much activation) or your heart to stop (too hard to activate nerves).