# Sleep Wake Cycles update 3

I spent a lot of the previous week trying to debug my code and find out why inhibition was not working as I wanted. I realized that because the neurons weren’t actually inhibiting each other, there must be some error in my fundamental code. I realized this because when I turned off the input to neuron 2 (meaning it should have received no excitement and should not have fired) it continued firing. I went through my code and realized that, in one part of my Euler’s step, I had mixed up what voltage was going into neuron 2, writing that neuron 1’s voltage was actually going to neuron 2. Once I fixed that, I found another sign error in my code, so the inhibition graph was plotting as if it was negative, but a positive value was being added to the external current (so inhibition was not working). I fixed this as well, and my neurons began to inhibit each other properly, as shown in the figure below.

(figure-1)

At first, the two neurons were firing in sync, but I made neuron 2’s resting potential slightly lower, so it took less than a millisecond longer to fire for the first time. This made it so they would not fire at exactly the same time every time, and neuron 2 would get a chance to inhibit neuron 1, which would continue for all time, as shown above. In the above figure, neuron 2 is firing and neuron 1 is inhibited. My next step was to add white noise to the external current, meaning each neuron would not receive exactly 7 mV, but somewhere randomly around mV. This was in order to model the random changes in inhibition between neuron 1 and neuron 2. As I talked about in my abstract, the neurons randomly switch from inhibiting one another. So, there will be bouts of inhibition of each. Neuron 1 will be inhibiting neuron 2, for example, and due to white noise, at a random time step, neuron 2 will randomly have enough excitement to fire, and will thus be able to inhibit neuron 1 for a period of time. In this way, neurons 1 and 2 will alternate being inhibited and firing due to white noise. Once I added white noise to the external current (7 mV with a standard deviation of 10 mV), the neurons begin to experience bouts of action potentials, randomly switching, as shown in the diagrams below:

(figure-2)

(figure-3)

Figure-3 above is just a zoomed in version of figure-2. I have shown a section of figure-2 like this so you can easily view how the sections of action potentials randomly alternate between bouts of neuron 1 and of neuron 2. Just as I said before, when neuron 1 is inhibited, neuron 2 is firing, and then, randomly, neuron 1 switches to firing and neuron 2 is inhibited.

The next step in my model was to graph the probability distribution of bouts occurring. So, first, I had to find a way to calculate and store bout lengths for each neuron. In order to do this, I set up a boutcounter1 variable that adds 1 to the variable each time neuron 1 fires, until neuron 2 fires. When neuron 2 fires, boutcounter1 stores it’s value in an array, and then is set back to 0. Now, neuron 2 is in a bout, and 1 is be added to boutcounter2 for each time step it fires until neuron 1 fires again, at which the value of boutcounter2 is stored in a separate array and then set to 0. This continues in this manner and therefore stores the lengths of each bout of neuron 1 and neuron 2 in an array.

Now, in order to find the probabilities of a bout occurring for each neuron at each time step, I also found the number of bouts that are greater than t at each time step, t. I then divided these values by the total number of bouts (the length of each array). For this model, I wanted to graph the log of these probabilities against time. I ran into an issue here for two reasons. Firstly, I could not seem to plot a 5th plot in my script (it would run for long periods of time, and then matlab would freeze). Secondly, my laptop stopped working for a day and I was not able to access my code. I therefore have not been able to graph these probability distributions or meet with my research advisor for help. In the next week, I hope to fix this issue, plot the probability distributions, and meet with my research advisor for further instruction.