jupyter | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
This year the session is online... we will take a ten minute break in the middle.
- In case of fire/emergency: nearest fire-exit is on basement level, walking back the way we came.
- Break at 12:55-13:05; bathrooms outside; cafe in central core upstairs open til 16:00.
- Consider pairing up with someone else if you want to focus on the science rather than difficulties of running the code; there is no time today to give an introduction to Julia. (You should be able to read the code, it looks fairly similar to R and matlab).
This is the fourth time I've tried this, and things keep changing, so be patient! If nothing else, in two hours I hope you get to see what you can do with simple computer models.
Today we will be using mybinder.org to host our session in the cloud. This means you don't need to install anything, but it may be a bit slower.
using Pkg
Pkg.activate(".")
Pkg.instantiate()
using OrdinaryDiffEq
using Plots
using Statistics
Given some differential equation for how x changes over time and so initial condition (i.e. x = some value at time t = 0), we can integrate them numerically using Euler integration.
Depending on the step-size h.
Solve differential equation
with initial conditions
Known solution:
We will run the script by typing Control and Enter on include line below.
include("euler1.jl")
plot_euler1(h=0.1)
Its all in the channels!
http://tinyurl.com/matthews-channel
See hh_maths.pdf
Julia has built-in functions for efficient numerical integration of ODEs. We will use them here so that we focus on the problem and not the numerics.
Run with default I=0.1 and then compare with I=10.
include("hhode.jl")
plot_hh(i=0.1)
-
Can you find the critical value of I where you first get a spike generated?
-
Can you work out the units on I (check equation 1 and Table 1 of hh_maths.pdf )?
-
Estimate the firing rate (in Hz) for the model as you vary I from 0 to 500. Can you plot a graph of it?
-
(Advanced) Apply a pulse of negative current with I=-50 for 5 ms followed by I=0 and describe what happens.
-
Try other manipulations, e.g. what if you set dh/dt to zero? What would this simulate?
Let's simplify the models as far as we can; we are going to use the simplification due to Izhikevich.
Read the basic description and guess which is the real data.
-
izh.jl has the basic code for one of the models. Try to adapt using parameters a,b,c,d to generate each of the plots from above. e.g. how can you make a chattering cell (CH)?
-
Explore figure1.jl. This regenerates figure 1 of the 2004 paper. See if you can follow in the code how the model is adapted in each case.
include("izh.jl")
izh(a=0.02, b=0.2, c=-65, d=6)
Here in figure1.jl we have all the conditions listed in the 2004 paper.
include("figure1.jl")
Eqn 6.18 from Wilson (1999). Couple two neurons that inhibit each other.
We will first run the script WTA2.jl with input to neuron 1 = 60 and input to neuron 2 = 70. We will examine the phase plane.
include("WTA2.jl")
using Plots
time, res = WTA2(60.0, 70.0)
plot(time, res', label=["E1" "E2"], xlabel = "Time", ylabel="Firing rate (Hz)")
-
When the input to both cells is equal, what is the critical value when one neurons dominates? Start with input to both cells equal to 20.
-
Examine what happens when input to both neurons is 100. Run it several times and see which one wins. Can you explain (and then test) your result?
Wilson (Chapter 12) shows how pairs of neurons coupled with reciprocal inhibition can generate out-of-phase firing (not WTA).
Try IPSP.jl with
-
Set TauSyn to 2 ms (rather than 1 ms) and repeat with above parameters. What do you observe?
-
As above, but with
$I_1 = 1.05$ ; now what happens?
include("IPSP.jl")
time, X = IPSPinteractions(1.1, 1.0, 5.0, 1.0)
plot(time, X[ [1, 3], :]', label=["E1" "E3"], legend=:topleft)