Skip to content

Commit

Permalink
IF lecture
Browse files Browse the repository at this point in the history
  • Loading branch information
Mark-Kramer committed Sep 9, 2024
1 parent 81c749f commit d2d4bf4
Show file tree
Hide file tree
Showing 10 changed files with 1,935 additions and 434 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
/.quarto/
.ipynb_checkpoints*
Dont-Sync-2024*
__pycache__*
5 changes: 5 additions & 0 deletions .gitignore~
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Don't-Sync/
*.mp4
*.ogv
*.DS_Store
*~
Binary file added docs/.DS_Store
Binary file not shown.
1,163 changes: 938 additions & 225 deletions docs/HH.html

Large diffs are not rendered by default.

25 changes: 13 additions & 12 deletions docs/IF.html
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@
}

// Store cell data
globalThis.qpyodideCellDetails = [{"id":1,"options":{"out-height":"","fig-height":5,"warning":"true","fig-cap":"","dpi":72,"read-only":"false","results":"markup","output":"true","fig-width":7,"label":"","autorun":"","context":"interactive","message":"true","classes":"","comment":"","out-width":"700px"},"code":"import numpy as np\nimport matplotlib.pyplot as plt"},{"id":2,"options":{"out-height":"","fig-height":5,"warning":"true","fig-cap":"","dpi":72,"read-only":"false","results":"markup","output":"true","fig-width":7,"label":"","autorun":"","context":"interactive","message":"true","classes":"","comment":"","out-width":"700px"},"code":"C=1.0\nI=1.0"},{"id":3,"options":{"out-height":"","fig-height":5,"warning":"true","fig-cap":"","dpi":72,"read-only":"false","results":"markup","output":"true","fig-width":7,"label":"","autorun":"","context":"interactive","message":"true","classes":"","comment":"","out-width":"700px"},"code":"dt=0.01"},{"id":4,"options":{"out-height":"","fig-height":5,"warning":"true","fig-cap":"","dpi":72,"read-only":"false","results":"markup","output":"true","fig-width":7,"label":"","autorun":"","context":"interactive","message":"true","classes":"","comment":"","out-width":"700px"},"code":"V = np.zeros([1000,1])\nnp.shape(V)"},{"id":5,"options":{"out-height":"","fig-height":5,"warning":"true","fig-cap":"","dpi":72,"read-only":"false","results":"markup","output":"true","fig-width":7,"label":"","autorun":"","context":"interactive","message":"true","classes":"","comment":"","out-width":"700px"},"code":"V[0]=0.2"},{"id":6,"options":{"out-height":"","fig-height":5,"warning":"true","fig-cap":"","dpi":72,"read-only":"false","results":"markup","output":"true","fig-width":7,"label":"","autorun":"","context":"interactive","message":"true","classes":"","comment":"","out-width":"700px"},"code":"for k in range(1,999):\n V[k+1] = V[k] + dt*(I/C)"},{"id":7,"options":{"out-height":"","fig-height":5,"warning":"true","fig-cap":"","dpi":72,"read-only":"false","results":"markup","output":"true","fig-width":7,"label":"","autorun":"","context":"interactive","message":"true","classes":"","comment":"","out-width":"700px"},"code":"plt.figure()\nplt.plot(V)\nplt.show()"},{"id":8,"options":{"out-height":"","fig-height":5,"warning":"true","fig-cap":"","dpi":72,"read-only":"false","results":"markup","output":"true","fig-width":7,"label":"","autorun":"","context":"interactive","message":"true","classes":"","comment":"","out-width":"700px"},"code":"t = np.arange(0,len(V))*dt"},{"id":9,"options":{"out-height":"","fig-height":5,"warning":"true","fig-cap":"","dpi":72,"read-only":"false","results":"markup","output":"true","fig-width":7,"label":"","autorun":"","context":"interactive","message":"true","classes":"","comment":"","out-width":"700px"},"code":"plt.figure()\nplt.plot(t,V)\nplt.xlabel('Time [s]')\nplt.ylabel('V')\nplt.show()"},{"id":10,"options":{"out-height":"","fig-height":5,"warning":"true","fig-cap":"","dpi":72,"read-only":"false","results":"markup","output":"true","fig-width":7,"label":"","autorun":"","context":"interactive","message":"true","classes":"","comment":"","out-width":"700px"},"code":"import numpy as np\nimport matplotlib.pyplot as plt\n\nI = 1 #Set the parameter I.\nC = 1 #Set the parameter C.\ndt = 0.01 #Set the timestep.\nV = np.zeros([1000,1]) #Initialize V.\nV[0]= 0.2; #Set the initial value of V.\n\nfor k in range(1,999): #March forward in time,\n V[k+1] = V[k] + dt*(I/C) #... updating V along the way.\n\nt = np.arange(0,len(V))*dt #Define the time axis.\n\nplt.figure()\nplt.plot(t,V) #Plot the results.\nplt.xlabel('Time [s]')\nplt.ylabel('Voltage [mV]')\nplt.show()"},{"id":11,"options":{"out-height":"","fig-height":5,"warning":"true","fig-cap":"","dpi":72,"read-only":"false","results":"markup","output":"true","fig-width":7,"label":"","autorun":"","context":"interactive","message":"true","classes":"","comment":"","out-width":"700px"},"code":"Vth = 1; #Define the voltage threshold.\nVreset = 0; #Define the reset voltage.\n\nfor k in range(1,999): #March forward in time,\n V[k+1] = V[k] + dt*(I/C) #Update the voltage,\n ### ADD SOMETHING HERE??? --------------------------"},{"id":12,"options":{"out-height":"","fig-height":5,"warning":"true","fig-cap":"","dpi":72,"read-only":"false","results":"markup","output":"true","fig-width":7,"label":"","autorun":"","context":"interactive","message":"true","classes":"","comment":"","out-width":"700px"},"code":"### ADD YOUR CODE!"}];
globalThis.qpyodideCellDetails = [{"options":{"dpi":72,"label":"","fig-width":7,"out-height":"","context":"interactive","fig-height":5,"out-width":"700px","fig-cap":"","classes":"","results":"markup","message":"true","comment":"","autorun":"","read-only":"false","output":"true","warning":"true"},"id":1,"code":"import numpy as np\nimport matplotlib.pyplot as plt"},{"options":{"dpi":72,"label":"","fig-width":7,"out-height":"","context":"interactive","fig-height":5,"out-width":"700px","fig-cap":"","classes":"","results":"markup","message":"true","comment":"","autorun":"","read-only":"false","output":"true","warning":"true"},"id":2,"code":"C=1.0\nI=1.0"},{"options":{"dpi":72,"label":"","fig-width":7,"out-height":"","context":"interactive","fig-height":5,"out-width":"700px","fig-cap":"","classes":"","results":"markup","message":"true","comment":"","autorun":"","read-only":"false","output":"true","warning":"true"},"id":3,"code":"dt=0.01"},{"options":{"dpi":72,"label":"","fig-width":7,"out-height":"","context":"interactive","fig-height":5,"out-width":"700px","fig-cap":"","classes":"","results":"markup","message":"true","comment":"","autorun":"","read-only":"false","output":"true","warning":"true"},"id":4,"code":"V = np.zeros([1000,1])\nnp.shape(V)"},{"options":{"dpi":72,"label":"","fig-width":7,"out-height":"","context":"interactive","fig-height":5,"out-width":"700px","fig-cap":"","classes":"","results":"markup","message":"true","comment":"","autorun":"","read-only":"false","output":"true","warning":"true"},"id":5,"code":"V[0]=0.2"},{"options":{"dpi":72,"label":"","fig-width":7,"out-height":"","context":"interactive","fig-height":5,"out-width":"700px","fig-cap":"","classes":"","results":"markup","message":"true","comment":"","autorun":"","read-only":"false","output":"true","warning":"true"},"id":6,"code":"for k in range(1,999):\n V[k+1] = V[k] + dt*(I/C)"},{"options":{"dpi":72,"label":"","fig-width":7,"out-height":"","context":"interactive","fig-height":5,"out-width":"700px","fig-cap":"","classes":"","results":"markup","message":"true","comment":"","autorun":"","read-only":"false","output":"true","warning":"true"},"id":7,"code":"plt.figure()\nplt.plot(V)\nplt.show()"},{"options":{"dpi":72,"label":"","fig-width":7,"out-height":"","context":"interactive","fig-height":5,"out-width":"700px","fig-cap":"","classes":"","results":"markup","message":"true","comment":"","autorun":"","read-only":"false","output":"true","warning":"true"},"id":8,"code":"t = np.arange(0,len(V))*dt"},{"options":{"dpi":72,"label":"","fig-width":7,"out-height":"","context":"interactive","fig-height":5,"out-width":"700px","fig-cap":"","classes":"","results":"markup","message":"true","comment":"","autorun":"","read-only":"false","output":"true","warning":"true"},"id":9,"code":"plt.figure()\nplt.plot(t,V)\nplt.xlabel('Time [s]')\nplt.ylabel('V')\nplt.show()"},{"options":{"dpi":72,"label":"","fig-width":7,"out-height":"","context":"interactive","fig-height":5,"out-width":"700px","fig-cap":"","classes":"","results":"markup","message":"true","comment":"","autorun":"","read-only":"false","output":"true","warning":"true"},"id":10,"code":"import numpy as np\nimport matplotlib.pyplot as plt\n\nI = 1 #Set the parameter I.\nC = 1 #Set the parameter C.\ndt = 0.01 #Set the timestep.\nV = np.zeros([1000,1]) #Initialize V.\nV[0]= 0.2; #Set the initial value of V.\n\nfor k in range(1,999): #March forward in time,\n V[k+1] = V[k] + dt*(I/C) #... updating V along the way.\n\nt = np.arange(0,len(V))*dt #Define the time axis.\n\nplt.figure()\nplt.plot(t,V) #Plot the results.\nplt.xlabel('Time [s]')\nplt.ylabel('Voltage [mV]')\nplt.show()"},{"options":{"dpi":72,"label":"","fig-width":7,"out-height":"","context":"interactive","fig-height":5,"out-width":"700px","fig-cap":"","classes":"","results":"markup","message":"true","comment":"","autorun":"","read-only":"false","output":"true","warning":"true"},"id":11,"code":"Vth = 1; #Define the voltage threshold.\nVreset = 0; #Define the reset voltage.\n\nfor k in range(1,999): #March forward in time,\n V[k+1] = V[k] + dt*(I/C) #Update the voltage,\n ### ADD SOMETHING HERE??? --------------------------"},{"options":{"dpi":72,"label":"","fig-width":7,"out-height":"","context":"interactive","fig-height":5,"out-width":"700px","fig-cap":"","classes":"","results":"markup","message":"true","comment":"","autorun":"","read-only":"false","output":"true","warning":"true"},"id":12,"code":"### ADD YOUR CODE!"}];


</script>
Expand Down Expand Up @@ -782,27 +782,28 @@ <h1 data-number="6"><span class="header-section-number">6</span> I&amp;F CODE (v
<section id="discussion" class="level1" data-number="7">
<h1 data-number="7"><span class="header-section-number">7</span> Discussion</h1>
<ol type="1">
<li>Describe the main components of the IF model. Draw it (in some way).</li>
<li>Describe the main components of the LIF model. Draw it (in some way).</li>
<li>Describe the differences and similarities between the IF and LIF models.</li>
<li>The IF model is meant to mimic a neurons activity. Describe what is realistic about the IF model? What is unrealistic?</li>
<li>Describe the roles of the IF model parameters <code>Vreset</code> and <code>Vthreshold</code>.</li>
<li>Consider the IF model. Sketch voltage (V) versus time (t) for a small input current, for a large input current.
<li><p>Describe the main components of the <strong>IF</strong> model. Draw it (in some way).</p></li>
<li><p>Describe the main components of the <strong>LIF</strong> model. Draw it (in some way).</p></li>
<li><p>Describe the differences and similarities between the IF and LIF models.</p></li>
<li><p>The IF model is meant to mimic a neurons activity. What is realistic about the IF model? What is unrealistic?</p></li>
<li><p>Describe the roles of the IF model parameters <code>Vreset</code> and <code>Vthreshold</code>.</p></li>
<li><p>Consider the IF model. Sketch voltage (V) versus time (t) for a small input current, for a large input current.</p>
<ol type="1">
<li>How does an increase in capacitance (C) impact the dynamics?</li>
<li>Can you interpret this physically?</li>
</ol></li>
<li><p>Plot the f-I curve for the IF model.</p></li>
</ol>
<hr>
</section>
<section id="challenges" class="level1" data-number="8">
<h1 data-number="8"><span class="header-section-number">8</span> Challenges</h1>
<ol type="1">
<li>Consider the <em>LIF</em> model. Plot (in Python) voltage (V) versus time (t) for a small input current, for a large input current.</li>
<li>How does an increase in the capacitance (C) impact the dynamics of the LIF model?</li>
<li>How does an increase in the resistance (R) impact the dynamics of the LIF model?</li>
<li>Determine how the firing rate of the LIF model varies with input I. Plot the firing rate versus I (i.e., plot the “f-I curve”).</li>
<li><strong>ADVANCED</strong>. Simulate the <a href="./Readings/Izhikevich_2003.pdf">Izhikevich neuron</a>. Provide examples of two different types of spiking activity.</li>
<li><p>Consider the <strong>LIF</strong> model. Plot (in Python) voltage (V) versus time (t) for a small input current, for a large input current.</p></li>
<li><p>Perform numerical simulations to determine how doubling the capacitance (C) impacts the firing rate of the LIF model. Based on your numerical simulations, does the firing rate increase or decrease? Provide a physical explanation for your results (i.e., how does the charge move around the circuit to impact the firing rate?) HINT: Capacitance represents the <em>capacity</em> of a cell to hold charge.</p></li>
<li><p>Perform numerical simulations to determine how doubling the resistance (R) impacts the firing rate of the LIF model. Based on your numerical simulations, does the firing rate increase or decrease? Provide a physical explanation for your results (i.e., how does the charge move around the circuit to impact the firing rate?) HINT: Higher resistance makes it harder for charge to flow in or out of the cell.</p></li>
<li><p>Determine how the firing rate of the LIF model varies with input I. Plot the firing rate versus I (i.e., plot the “f-I curve”).</p></li>
<li><p><strong>ADVANCED</strong>. Simulate the <a href="./Readings/Izhikevich_2003.pdf">Izhikevich neuron</a>. Provide examples of two different types of spiking activity.</p></li>
</ol>


Expand Down
13 changes: 7 additions & 6 deletions docs/Introduction.html

Large diffs are not rendered by default.

Loading

0 comments on commit d2d4bf4

Please sign in to comment.