From b02c652326cf03adddb1eab796a4c55699d53ff7 Mon Sep 17 00:00:00 2001 From: harisorgn Date: Fri, 10 Jan 2025 08:42:10 +0000 Subject: [PATCH] =?UTF-8?q?Deploying=20to=20gh-pages=20from=20=20@=20b9390?= =?UTF-8?q?d9dd81b797f583417a798e20eb6ab7cc697=20=F0=9F=9A=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/literate/intro_diffeq.md | 6 +- assets/literate/intro_diffeq_script.jl | 4 +- assets/literate/intro_plot.md | 17 +- assets/literate/intro_plot_script.jl | 10 +- .../CS_circuit/code/output/cort_asc_stack.svg | 190 +- .../CS_circuit/code/output/cort_meanfield.svg | 184 +- .../CS_circuit/code/output/cort_power.svg | 273 +- .../CS_circuit/code/output/cort_stack.svg | 212 +- .../CS_circuit/code/output/wta_stack.svg | 102 +- .../CS_circuit/code/output/wta_wta_stack.svg | 114 +- .../blox_connections/code/output/ex6.res | 2 +- assets/pages/intro_diffeq/code/ex9.jl | 4 +- assets/pages/intro_plot/code/ex2.jl | 3 +- assets/pages/intro_plot/code/ex3.jl | 26 +- assets/pages/intro_plot/code/ex4.jl | 19 + assets/pages/intro_plot/code/output/ex3.res | 22 +- assets/pages/intro_plot/code/output/ex4.out | 0 assets/pages/intro_plot/code/output/ex4.res | 1 + assets/pages/learning/code/output/adj_RL.svg | 7402 ++++++++--------- .../pages/learning/code/output/adj_open.svg | 5366 ++++++------ assets/pages/learning/code/output/ex3.out | 94 +- assets/pages/learning/code/output/ex3.res | 2 +- pages/blox_connections/index.html | 2 +- pages/intro_diffeq/index.html | 6 +- pages/intro_plot/index.html | 34 +- pages/learning/index.html | 96 +- 26 files changed, 7104 insertions(+), 7087 deletions(-) create mode 100644 assets/pages/intro_plot/code/ex4.jl create mode 100644 assets/pages/intro_plot/code/output/ex4.out create mode 100644 assets/pages/intro_plot/code/output/ex4.res diff --git a/assets/literate/intro_diffeq.md b/assets/literate/intro_diffeq.md index 3cdd60a..d19a3f3 100644 --- a/assets/literate/intro_diffeq.md +++ b/assets/literate/intro_diffeq.md @@ -154,8 +154,7 @@ Since `I` will change dynamically in time, it will be a time-dependent variable ````julia:ex9 @variables v(t)=-65 u(t)=-13 I(t) -# The following parameter values correspond to regular spiking. -@parameters a=0.02 b=0.2 c=-65 d=8 +@parameters a=0.02 b=0.2 c=-65 d=8 ## These parameter values correspond to regular spiking. eqs = [D(v) ~ 0.04 * v ^ 2 + 5 * v + 140 - u + I, D(u) ~ a * (b * v - u), @@ -163,12 +162,11 @@ eqs = [D(v) ~ 0.04 * v ^ 2 + 5 * v + 140 - u + I, event = (v > 30.0) => [u ~ u + d, v ~ c] -# Notice how `I` was moved from the parameter list to the variable list in the following call. @named izh_system = ODESystem(eqs, t, [v, u, I], [a, b, c, d]; discrete_events = event) izh_simple = structural_simplify(izh_system) ```` -Let's display the equations of the original and the simplified system to see the effect of `structural_simplify`. +Notice how `I` was moved from the parameter list to the variable list above. Let's display the equations of the original and the simplified system to see the effect of `structural_simplify`. ````julia:ex10 equations(izh_system) diff --git a/assets/literate/intro_diffeq_script.jl b/assets/literate/intro_diffeq_script.jl index be40ede..9eb801b 100644 --- a/assets/literate/intro_diffeq_script.jl +++ b/assets/literate/intro_diffeq_script.jl @@ -81,8 +81,7 @@ fig save(joinpath(@OUTPUT, "mtk4.svg"), fig); # hide @variables v(t)=-65 u(t)=-13 I(t) -# The following parameter values correspond to regular spiking. -@parameters a=0.02 b=0.2 c=-65 d=8 +@parameters a=0.02 b=0.2 c=-65 d=8 ## These parameter values correspond to regular spiking. eqs = [D(v) ~ 0.04 * v ^ 2 + 5 * v + 140 - u + I, D(u) ~ a * (b * v - u), @@ -90,7 +89,6 @@ eqs = [D(v) ~ 0.04 * v ^ 2 + 5 * v + 140 - u + I, event = (v > 30.0) => [u ~ u + d, v ~ c] -# Notice how `I` was moved from the parameter list to the variable list in the following call. @named izh_system = ODESystem(eqs, t, [v, u, I], [a, b, c, d]; discrete_events = event) izh_simple = structural_simplify(izh_system) diff --git a/assets/literate/intro_plot.md b/assets/literate/intro_plot.md index bfb3022..4ea3578 100644 --- a/assets/literate/intro_plot.md +++ b/assets/literate/intro_plot.md @@ -43,8 +43,7 @@ When defining an `Axis` there are multiple options to affect its appearance and We can also change an `Axis` after it has been constructed. For instance we could hide the x-axis label and ticks on the top plot above, since it is a duplicate of the x-axis of the bottom plot. We will keep the grid lines though, because it is easier to read the x-axis values this way. ````julia:ex2 -# `grid=false` avoids hiding the x grid lines -hidexdecorations!(axs[1], grid=false) +hidexdecorations!(axs[1], grid=false) ## `grid=false` avoids hiding the x grid lines # Now we can display the figure again with the updated axes fig @@ -65,8 +64,7 @@ using ModelingToolkit: t_nounits as t, D_nounits as D using OrdinaryDiffEq @variables v(t)=-65 u(t)=-13 -# Parameters for fast spiking. -@parameters a=0.1 b=0.2 c=-65 d=2 I=10 +@parameters a=0.1 b=0.2 c=-65 d=2 I=10 ## Parameters for fast spiking. eqs = [D(v) ~ 0.04 * v ^ 2 + 5 * v + 140 - u + I, D(u) ~ a * (b * v - u)] @@ -96,12 +94,17 @@ t_window = 20 t_range = first(tspan):t_window:last(tspan) # initialize an empty vector to hold the spike values. spikes = zeros(length(t_range) - 1) +```` + +To find spikes we need to +- loop over the timepoints at which every time window begins +- find the indices of timepoints that fall within the current time window +- count the number of spikes within the same window -# loop over the timepoints at which every time window begins +````julia:ex4 for i in eachindex(t_range[1:end-1]) - # find the indices of timepoints that fall within the current time window idxs = findall(t -> t_range[i] <= t <= t_range[i+1], timepoints) - # count the number of spikes within the same window + spikes[i] = count(V_izh[idxs] .> spike_threshold) ## counts the number of True elements in a Boolean vector end diff --git a/assets/literate/intro_plot_script.jl b/assets/literate/intro_plot_script.jl index 5cc988b..01b09ff 100644 --- a/assets/literate/intro_plot_script.jl +++ b/assets/literate/intro_plot_script.jl @@ -16,8 +16,7 @@ scatter!(axs[2], seconds, measurements) fig save(joinpath(@OUTPUT, "layout.svg"), fig); # hide -# `grid=false` avoids hiding the x grid lines -hidexdecorations!(axs[1], grid=false) +hidexdecorations!(axs[1], grid=false) ## `grid=false` avoids hiding the x grid lines # Now we can display the figure again with the updated axes fig @@ -28,8 +27,7 @@ using ModelingToolkit: t_nounits as t, D_nounits as D using OrdinaryDiffEq @variables v(t)=-65 u(t)=-13 -# Parameters for fast spiking. -@parameters a=0.1 b=0.2 c=-65 d=2 I=10 +@parameters a=0.1 b=0.2 c=-65 d=2 I=10 ## Parameters for fast spiking. eqs = [D(v) ~ 0.04 * v ^ 2 + 5 * v + 140 - u + I, D(u) ~ a * (b * v - u)] @@ -60,11 +58,9 @@ t_range = first(tspan):t_window:last(tspan) # initialize an empty vector to hold the spike values. spikes = zeros(length(t_range) - 1) -# loop over the timepoints at which every time window begins for i in eachindex(t_range[1:end-1]) - # find the indices of timepoints that fall within the current time window idxs = findall(t -> t_range[i] <= t <= t_range[i+1], timepoints) - # count the number of spikes within the same window + spikes[i] = count(V_izh[idxs] .> spike_threshold) ## counts the number of True elements in a Boolean vector end diff --git a/assets/pages/CS_circuit/code/output/cort_asc_stack.svg b/assets/pages/CS_circuit/code/output/cort_asc_stack.svg index 96b600f..3a6396f 100644 --- a/assets/pages/CS_circuit/code/output/cort_asc_stack.svg +++ b/assets/pages/CS_circuit/code/output/cort_asc_stack.svg @@ -2,66 +2,66 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -72,127 +72,127 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/pages/CS_circuit/code/output/cort_meanfield.svg b/assets/pages/CS_circuit/code/output/cort_meanfield.svg index 022d9fc..2fdc6a3 100644 --- a/assets/pages/CS_circuit/code/output/cort_meanfield.svg +++ b/assets/pages/CS_circuit/code/output/cort_meanfield.svg @@ -2,113 +2,113 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -118,152 +118,152 @@ - - - - - + + + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - - - - + + + + + diff --git a/assets/pages/CS_circuit/code/output/cort_power.svg b/assets/pages/CS_circuit/code/output/cort_power.svg index 0e86c70..3260044 100644 --- a/assets/pages/CS_circuit/code/output/cort_power.svg +++ b/assets/pages/CS_circuit/code/output/cort_power.svg @@ -2,183 +2,180 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - - - + - + - + - + - + - + - + - + - + @@ -194,210 +191,210 @@ - - - - + + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - + + - + - + - + - + - + - + - + @@ -409,10 +406,10 @@ - - - - + + + + diff --git a/assets/pages/CS_circuit/code/output/cort_stack.svg b/assets/pages/CS_circuit/code/output/cort_stack.svg index d914b7f..da17d49 100644 --- a/assets/pages/CS_circuit/code/output/cort_stack.svg +++ b/assets/pages/CS_circuit/code/output/cort_stack.svg @@ -2,66 +2,66 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -72,138 +72,138 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/pages/CS_circuit/code/output/wta_stack.svg b/assets/pages/CS_circuit/code/output/wta_stack.svg index f1b9897..0942180 100644 --- a/assets/pages/CS_circuit/code/output/wta_stack.svg +++ b/assets/pages/CS_circuit/code/output/wta_stack.svg @@ -2,66 +2,66 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -72,83 +72,83 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - - - - - + + + + + + diff --git a/assets/pages/CS_circuit/code/output/wta_wta_stack.svg b/assets/pages/CS_circuit/code/output/wta_wta_stack.svg index 3d5c2cc..09d3457 100644 --- a/assets/pages/CS_circuit/code/output/wta_wta_stack.svg +++ b/assets/pages/CS_circuit/code/output/wta_wta_stack.svg @@ -2,66 +2,66 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -72,89 +72,89 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - - - - - - - - - - - + + + + + + + + + + + + diff --git a/assets/pages/blox_connections/code/output/ex6.res b/assets/pages/blox_connections/code/output/ex6.res index 8341150..dbef3b4 100644 --- a/assets/pages/blox_connections/code/output/ex6.res +++ b/assets/pages/blox_connections/code/output/ex6.res @@ -1,4 +1,4 @@ -Main.FD_SANDBOX_15604780526313532720.IzhNeuron(ModelingToolkit.ODESystem(0x0000000000002017, Symbolics.Equation[Differential(t)(V(t)) ~ 145 + jcn - u(t) + 5V(t) + 0.04(V(t)^2), Differential(t)(u(t)) ~ a*(-u(t) + b*V(t))], t, SymbolicUtils.BasicSymbolic{Real}[V(t), u(t), jcn], SymbolicUtils.BasicSymbolic{Real}[a, b, V_reset, d, θ], nothing, Dict{Any, Any}(:a => a, :b => b, :d => d, :V => V(t), :jcn => jcn, :u => u(t), :θ => θ, :V_reset => V_reset), Any[], Symbolics.Equation[], Base.RefValue{Vector{Symbolics.Num}}(Symbolics.Num[]), Base.RefValue{Any}(Matrix{Symbolics.Num}(undef, 0, 0)), Base.RefValue{Any}(Matrix{Symbolics.Num}(undef, 0, 0)), Base.RefValue{Matrix{Symbolics.Num}}(Matrix{Symbolics.Num}(undef, 0, 0)), Base.RefValue{Matrix{Symbolics.Num}}(Matrix{Symbolics.Num}(undef, 0, 0)), :izh, "", ModelingToolkit.ODESystem[], Dict{Any, Any}(a => 0.02, V_reset => -50, d => 2, u(t) => -13, V(t) => -65.0, b => 0.2, θ => 30), Dict{Any, Any}(), nothing, nothing, Symbolics.Equation[], nothing, nothing, nothing, ModelingToolkit.SymbolicContinuousCallback[], ModelingToolkit.SymbolicDiscreteCallback[condition: V(t) > θ +Main.FD_SANDBOX_15604780526313532720.IzhNeuron(ModelingToolkit.ODESystem(0x000000000000200f, Symbolics.Equation[Differential(t)(V(t)) ~ 145 + jcn - u(t) + 5V(t) + 0.04(V(t)^2), Differential(t)(u(t)) ~ a*(-u(t) + b*V(t))], t, SymbolicUtils.BasicSymbolic{Real}[V(t), u(t), jcn], SymbolicUtils.BasicSymbolic{Real}[a, b, V_reset, d, θ], nothing, Dict{Any, Any}(:a => a, :b => b, :d => d, :V => V(t), :jcn => jcn, :u => u(t), :θ => θ, :V_reset => V_reset), Any[], Symbolics.Equation[], Base.RefValue{Vector{Symbolics.Num}}(Symbolics.Num[]), Base.RefValue{Any}(Matrix{Symbolics.Num}(undef, 0, 0)), Base.RefValue{Any}(Matrix{Symbolics.Num}(undef, 0, 0)), Base.RefValue{Matrix{Symbolics.Num}}(Matrix{Symbolics.Num}(undef, 0, 0)), Base.RefValue{Matrix{Symbolics.Num}}(Matrix{Symbolics.Num}(undef, 0, 0)), :izh, "", ModelingToolkit.ODESystem[], Dict{Any, Any}(a => 0.02, V_reset => -50, d => 2, u(t) => -13, V(t) => -65.0, b => 0.2, θ => 30), Dict{Any, Any}(), nothing, nothing, Symbolics.Equation[], nothing, nothing, nothing, ModelingToolkit.SymbolicContinuousCallback[], ModelingToolkit.SymbolicDiscreteCallback[condition: V(t) > θ affects: u(t) ~ d + u(t) V(t) ~ V_reset diff --git a/assets/pages/intro_diffeq/code/ex9.jl b/assets/pages/intro_diffeq/code/ex9.jl index a7deff1..ba69d9c 100644 --- a/assets/pages/intro_diffeq/code/ex9.jl +++ b/assets/pages/intro_diffeq/code/ex9.jl @@ -1,7 +1,6 @@ # This file was generated, do not modify it. # hide @variables v(t)=-65 u(t)=-13 I(t) -# The following parameter values correspond to regular spiking. -@parameters a=0.02 b=0.2 c=-65 d=8 +@parameters a=0.02 b=0.2 c=-65 d=8 ## These parameter values correspond to regular spiking. eqs = [D(v) ~ 0.04 * v ^ 2 + 5 * v + 140 - u + I, D(u) ~ a * (b * v - u), @@ -9,6 +8,5 @@ eqs = [D(v) ~ 0.04 * v ^ 2 + 5 * v + 140 - u + I, event = (v > 30.0) => [u ~ u + d, v ~ c] -# Notice how `I` was moved from the parameter list to the variable list in the following call. @named izh_system = ODESystem(eqs, t, [v, u, I], [a, b, c, d]; discrete_events = event) izh_simple = structural_simplify(izh_system) \ No newline at end of file diff --git a/assets/pages/intro_plot/code/ex2.jl b/assets/pages/intro_plot/code/ex2.jl index fb34e10..e064c8c 100644 --- a/assets/pages/intro_plot/code/ex2.jl +++ b/assets/pages/intro_plot/code/ex2.jl @@ -1,6 +1,5 @@ # This file was generated, do not modify it. # hide -# `grid=false` avoids hiding the x grid lines -hidexdecorations!(axs[1], grid=false) +hidexdecorations!(axs[1], grid=false) ## `grid=false` avoids hiding the x grid lines # Now we can display the figure again with the updated axes fig diff --git a/assets/pages/intro_plot/code/ex3.jl b/assets/pages/intro_plot/code/ex3.jl index 1a64659..877defd 100644 --- a/assets/pages/intro_plot/code/ex3.jl +++ b/assets/pages/intro_plot/code/ex3.jl @@ -4,8 +4,7 @@ using ModelingToolkit: t_nounits as t, D_nounits as D using OrdinaryDiffEq @variables v(t)=-65 u(t)=-13 -# Parameters for fast spiking. -@parameters a=0.1 b=0.2 c=-65 d=2 I=10 +@parameters a=0.1 b=0.2 c=-65 d=2 I=10 ## Parameters for fast spiking. eqs = [D(v) ~ 0.04 * v ^ 2 + 5 * v + 140 - u + I, D(u) ~ a * (b * v - u)] @@ -34,25 +33,4 @@ t_window = 20 # split time into bins of size `t_window` t_range = first(tspan):t_window:last(tspan) # initialize an empty vector to hold the spike values. -spikes = zeros(length(t_range) - 1) - -# loop over the timepoints at which every time window begins -for i in eachindex(t_range[1:end-1]) - # find the indices of timepoints that fall within the current time window - idxs = findall(t -> t_range[i] <= t <= t_range[i+1], timepoints) - # count the number of spikes within the same window - spikes[i] = count(V_izh[idxs] .> spike_threshold) ## counts the number of True elements in a Boolean vector -end - -fig = Figure() -ax = Axis(fig[1,1], xlabel="Time (sec)", ylabel="Spikes") - -# plot spikes for each time window -barplot!(ax, t_range[1:end-1], spikes, label="Spikes") -# plot a vertical line to note when the change in current `I` occurred -vlines!(ax, [t_bigger_stimulation]; color=:tomato, linestyle=:dash, linewidth=4, label="Stimulation: I = I+10") - -# display the legend -axislegend(position = :lt) -fig -save(joinpath(@OUTPUT, "spikes.svg"), fig); # hide \ No newline at end of file +spikes = zeros(length(t_range) - 1) \ No newline at end of file diff --git a/assets/pages/intro_plot/code/ex4.jl b/assets/pages/intro_plot/code/ex4.jl new file mode 100644 index 0000000..8d8d9bd --- /dev/null +++ b/assets/pages/intro_plot/code/ex4.jl @@ -0,0 +1,19 @@ +# This file was generated, do not modify it. # hide +for i in eachindex(t_range[1:end-1]) + idxs = findall(t -> t_range[i] <= t <= t_range[i+1], timepoints) + + spikes[i] = count(V_izh[idxs] .> spike_threshold) ## counts the number of True elements in a Boolean vector +end + +fig = Figure() +ax = Axis(fig[1,1], xlabel="Time (sec)", ylabel="Spikes") + +# plot spikes for each time window +barplot!(ax, t_range[1:end-1], spikes, label="Spikes") +# plot a vertical line to note when the change in current `I` occurred +vlines!(ax, [t_bigger_stimulation]; color=:tomato, linestyle=:dash, linewidth=4, label="Stimulation: I = I+10") + +# display the legend +axislegend(position = :lt) +fig +save(joinpath(@OUTPUT, "spikes.svg"), fig); # hide \ No newline at end of file diff --git a/assets/pages/intro_plot/code/output/ex3.res b/assets/pages/intro_plot/code/output/ex3.res index 97896a0..8f01e4e 100644 --- a/assets/pages/intro_plot/code/output/ex3.res +++ b/assets/pages/intro_plot/code/output/ex3.res @@ -1 +1,21 @@ -nothing \ No newline at end of file +20-element Vector{Float64}: + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 \ No newline at end of file diff --git a/assets/pages/intro_plot/code/output/ex4.out b/assets/pages/intro_plot/code/output/ex4.out new file mode 100644 index 0000000..e69de29 diff --git a/assets/pages/intro_plot/code/output/ex4.res b/assets/pages/intro_plot/code/output/ex4.res new file mode 100644 index 0000000..97896a0 --- /dev/null +++ b/assets/pages/intro_plot/code/output/ex4.res @@ -0,0 +1 @@ +nothing \ No newline at end of file diff --git a/assets/pages/learning/code/output/adj_RL.svg b/assets/pages/learning/code/output/adj_RL.svg index 5fb21ed..dda53a4 100644 --- a/assets/pages/learning/code/output/adj_RL.svg +++ b/assets/pages/learning/code/output/adj_RL.svg @@ -2,2223 +2,2223 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -2227,4199 +2227,4203 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - + - + + + - - - - + + - - + + + + - - - + + + + + - - - - + + + + + - - - + + + + - - - + + - - - - + + + - + + - - + + - - - + + + @@ -6429,79 +6433,78 @@ - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + - - - - - - - - - - + + + + + + + + + + - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + - - - - - - - - - - + + + + + + + + + + - - + + - - - + + @@ -6509,25 +6512,25 @@ + - - - + - - + + + @@ -6535,24 +6538,23 @@ - + - - - + - + + - + @@ -6561,21 +6563,19 @@ - + - + - - - - + + @@ -6591,4196 +6591,4200 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - + - + + + - - - - + + - - + + + + - - - + + + + + - - - - + + + + + - - - + + + + - - - + + - - - - + + + - + + - - + + - - - + + + @@ -10790,79 +10794,78 @@ - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + - - - - - - - - - - + + + + + + + + + + - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + - - - - - - - - - - + + + + + + + + + + - - + + - - - + + @@ -10870,25 +10873,25 @@ + - - - + - - + + + @@ -10896,24 +10899,23 @@ - + - - - + - + + - + @@ -10922,21 +10924,19 @@ - + - + - - - - + + diff --git a/assets/pages/learning/code/output/adj_open.svg b/assets/pages/learning/code/output/adj_open.svg index 4c8362d..0b58e1f 100644 --- a/assets/pages/learning/code/output/adj_open.svg +++ b/assets/pages/learning/code/output/adj_open.svg @@ -2,1628 +2,1628 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -1632,3139 +1632,3142 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + + - + - - + + - - + + - - + + + - - - + + + + - - + + - - - + + - - + + - - + + + - + @@ -4777,20 +4780,19 @@ - - + + - - - + + @@ -4798,25 +4800,25 @@ + - - - + - - + + + @@ -4824,24 +4826,23 @@ - + - - - + - + + - + @@ -4850,21 +4851,19 @@ - + - + - - - - + + @@ -4876,3134 +4875,3137 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - + + + - - + + - - + + - - + + + - - - + + + + - - + + - - - + + - - + + - - + + + - - + + @@ -8015,20 +8017,19 @@ - - + + - - - + + @@ -8036,25 +8037,25 @@ + - - - + - - + + + @@ -8062,24 +8063,23 @@ - + - - - + - + + - + @@ -8088,21 +8088,19 @@ - + - + - - - - + + diff --git a/assets/pages/learning/code/output/ex3.out b/assets/pages/learning/code/output/ex3.out index 745a6e3..c2fb3ac 100644 --- a/assets/pages/learning/code/output/ex3.out +++ b/assets/pages/learning/code/output/ex3.out @@ -1,100 +1,100 @@ Trial = 1, Category choice = 2, Response = Correct -Trial = 2, Category choice = 2, Response = False -Trial = 3, Category choice = 1, Response = Correct +Trial = 2, Category choice = 1, Response = Correct +Trial = 3, Category choice = 2, Response = False Trial = 4, Category choice = 2, Response = Correct -Trial = 5, Category choice = 1, Response = Correct -Trial = 6, Category choice = 1, Response = False +Trial = 5, Category choice = 2, Response = False +Trial = 6, Category choice = 2, Response = Correct Trial = 7, Category choice = 2, Response = Correct Trial = 8, Category choice = 2, Response = Correct Trial = 9, Category choice = 2, Response = Correct -Trial = 10, Category choice = 2, Response = Correct -Trial = 11, Category choice = 2, Response = Correct +Trial = 10, Category choice = 1, Response = False +Trial = 11, Category choice = 1, Response = False Trial = 12, Category choice = 2, Response = Correct Trial = 13, Category choice = 2, Response = False Trial = 14, Category choice = 2, Response = Correct Trial = 15, Category choice = 2, Response = False Trial = 16, Category choice = 1, Response = Correct Trial = 17, Category choice = 2, Response = False -Trial = 18, Category choice = 2, Response = False +Trial = 18, Category choice = 1, Response = Correct Trial = 19, Category choice = 2, Response = False -Trial = 20, Category choice = 1, Response = False -Trial = 21, Category choice = 2, Response = False -Trial = 22, Category choice = 1, Response = Correct +Trial = 20, Category choice = 2, Response = Correct +Trial = 21, Category choice = 1, Response = Correct +Trial = 22, Category choice = 2, Response = False Trial = 23, Category choice = 1, Response = Correct Trial = 24, Category choice = 1, Response = False -Trial = 25, Category choice = 1, Response = Correct +Trial = 25, Category choice = 2, Response = False Trial = 26, Category choice = 1, Response = Correct Trial = 27, Category choice = 1, Response = Correct -Trial = 28, Category choice = 2, Response = False +Trial = 28, Category choice = 1, Response = Correct Trial = 29, Category choice = 2, Response = Correct Trial = 30, Category choice = 2, Response = False -Trial = 31, Category choice = 2, Response = Correct +Trial = 31, Category choice = 1, Response = False Trial = 32, Category choice = 2, Response = False -Trial = 33, Category choice = 2, Response = Correct -Trial = 34, Category choice = 2, Response = Correct -Trial = 35, Category choice = 2, Response = Correct +Trial = 33, Category choice = 1, Response = False +Trial = 34, Category choice = 1, Response = False +Trial = 35, Category choice = 1, Response = False Trial = 36, Category choice = 2, Response = False -Trial = 37, Category choice = 2, Response = False +Trial = 37, Category choice = 1, Response = Correct Trial = 38, Category choice = 2, Response = False Trial = 39, Category choice = 2, Response = Correct -Trial = 40, Category choice = 1, Response = Correct -Trial = 41, Category choice = 2, Response = Correct +Trial = 40, Category choice = 2, Response = False +Trial = 41, Category choice = 1, Response = False Trial = 42, Category choice = 2, Response = False -Trial = 43, Category choice = 1, Response = Correct -Trial = 44, Category choice = 2, Response = Correct +Trial = 43, Category choice = 2, Response = False +Trial = 44, Category choice = 1, Response = False Trial = 45, Category choice = 2, Response = False -Trial = 46, Category choice = 1, Response = Correct +Trial = 46, Category choice = 2, Response = False Trial = 47, Category choice = 1, Response = Correct -Trial = 48, Category choice = 1, Response = False +Trial = 48, Category choice = 2, Response = Correct Trial = 49, Category choice = 1, Response = False Trial = 50, Category choice = 2, Response = Correct Trial = 51, Category choice = 1, Response = Correct Trial = 52, Category choice = 1, Response = Correct Trial = 53, Category choice = 2, Response = Correct -Trial = 54, Category choice = 2, Response = Correct -Trial = 55, Category choice = 1, Response = False -Trial = 56, Category choice = 2, Response = Correct -Trial = 57, Category choice = 1, Response = Correct +Trial = 54, Category choice = 1, Response = False +Trial = 55, Category choice = 2, Response = Correct +Trial = 56, Category choice = 1, Response = False +Trial = 57, Category choice = 2, Response = False Trial = 58, Category choice = 1, Response = Correct -Trial = 59, Category choice = 2, Response = False -Trial = 60, Category choice = 2, Response = False +Trial = 59, Category choice = 1, Response = Correct +Trial = 60, Category choice = 1, Response = Correct Trial = 61, Category choice = 1, Response = False -Trial = 62, Category choice = 2, Response = Correct -Trial = 63, Category choice = 1, Response = False -Trial = 64, Category choice = 2, Response = False -Trial = 65, Category choice = 1, Response = Correct +Trial = 62, Category choice = 1, Response = False +Trial = 63, Category choice = 2, Response = Correct +Trial = 64, Category choice = 1, Response = Correct +Trial = 65, Category choice = 2, Response = False Trial = 66, Category choice = 2, Response = Correct -Trial = 67, Category choice = 1, Response = Correct +Trial = 67, Category choice = 2, Response = False Trial = 68, Category choice = 2, Response = Correct -Trial = 69, Category choice = 2, Response = Correct +Trial = 69, Category choice = 1, Response = False Trial = 70, Category choice = 1, Response = Correct -Trial = 71, Category choice = 2, Response = False -Trial = 72, Category choice = 2, Response = Correct -Trial = 73, Category choice = 1, Response = False -Trial = 74, Category choice = 1, Response = Correct +Trial = 71, Category choice = 1, Response = Correct +Trial = 72, Category choice = 1, Response = False +Trial = 73, Category choice = 2, Response = Correct +Trial = 74, Category choice = 2, Response = False Trial = 75, Category choice = 2, Response = False -Trial = 76, Category choice = 1, Response = False -Trial = 77, Category choice = 2, Response = False -Trial = 78, Category choice = 1, Response = Correct +Trial = 76, Category choice = 2, Response = Correct +Trial = 77, Category choice = 1, Response = Correct +Trial = 78, Category choice = 2, Response = False Trial = 79, Category choice = 2, Response = False Trial = 80, Category choice = 1, Response = Correct Trial = 81, Category choice = 2, Response = Correct Trial = 82, Category choice = 1, Response = Correct Trial = 83, Category choice = 2, Response = False Trial = 84, Category choice = 2, Response = Correct -Trial = 85, Category choice = 2, Response = Correct -Trial = 86, Category choice = 2, Response = False +Trial = 85, Category choice = 1, Response = False +Trial = 86, Category choice = 1, Response = Correct Trial = 87, Category choice = 2, Response = False Trial = 88, Category choice = 2, Response = False Trial = 89, Category choice = 2, Response = Correct -Trial = 90, Category choice = 2, Response = False +Trial = 90, Category choice = 1, Response = Correct Trial = 91, Category choice = 2, Response = Correct Trial = 92, Category choice = 2, Response = False -Trial = 93, Category choice = 1, Response = False +Trial = 93, Category choice = 2, Response = Correct Trial = 94, Category choice = 2, Response = Correct Trial = 95, Category choice = 2, Response = False Trial = 96, Category choice = 1, Response = False Trial = 97, Category choice = 1, Response = False -Trial = 98, Category choice = 1, Response = False +Trial = 98, Category choice = 2, Response = Correct Trial = 99, Category choice = 1, Response = Correct Trial = 100, Category choice = 2, Response = False diff --git a/assets/pages/learning/code/output/ex3.res b/assets/pages/learning/code/output/ex3.res index 2f6c15a..fed9398 100644 --- a/assets/pages/learning/code/output/ex3.res +++ b/assets/pages/learning/code/output/ex3.res @@ -1 +1 @@ -(trial = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100], correct = Bool[1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 0, 0, 1, 1, 1, 0, 1, 1, 0, 1, 1, 0, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 0, 0, 1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 0, 0, 1, 0, 1, 1, 1, 0, 1, 1, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 0, 0, 1, 0], action = [2, 2, 1, 2, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 1, 2, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 2, 1, 2, 2, 1, 1, 1, 1, 2, 1, 1, 2, 2, 1, 2, 1, 1, 2, 2, 1, 2, 1, 2, 1, 2, 1, 2, 2, 1, 2, 2, 1, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 2, 1, 1, 1, 1, 2]) \ No newline at end of file +(trial = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100], correct = Bool[1, 1, 0, 1, 0, 1, 1, 1, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1, 1, 0, 1, 0, 0, 1, 1, 1, 0, 0, 1, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 1, 1, 0, 1, 0, 1, 0, 0, 1, 1, 1, 0, 1, 1, 0, 0, 0, 1, 1, 0], action = [2, 1, 2, 2, 2, 2, 2, 2, 2, 1, 1, 2, 2, 2, 2, 1, 2, 1, 2, 2, 1, 2, 1, 1, 2, 1, 1, 1, 2, 2, 1, 2, 1, 1, 1, 2, 1, 2, 2, 2, 1, 2, 2, 1, 2, 2, 1, 2, 1, 2, 1, 1, 2, 1, 2, 1, 2, 1, 1, 1, 1, 1, 2, 1, 2, 2, 2, 2, 1, 1, 1, 1, 2, 2, 2, 2, 1, 2, 2, 1, 2, 1, 2, 2, 1, 1, 2, 2, 2, 1, 2, 2, 2, 2, 2, 1, 1, 2, 1, 2]) \ No newline at end of file diff --git a/pages/blox_connections/index.html b/pages/blox_connections/index.html index 3e9dec7..65cc3b3 100644 --- a/pages/blox_connections/index.html +++ b/pages/blox_connections/index.html @@ -47,7 +47,7 @@ end end -# In the `IzhNeuron` constructor function we keep all arguments as keyword arguments so that we can set them more conveniently as `arg = value`. Spike threshold `θ=30` is now included as a parameter. Default values for all parameters are the keyword arguments from above. This way we can set them easily during construction.

NOTE: In IzhNeuron the jcn variable does not get a default value, only the [input=true] tag. This means that other Bloxs will connect to a IzhNeuron through jcn.

Neuroblox automatically initializes a jcn ~ 0 equation and then accumulates connection terms in it. This happens with all input variables of Bloxs.

Similarly the [output=true] tag designates the V variable as the output variable. It is necessary for every Blox to have one if they rely on generic connection rules that fetch the output variable and add it to the connection equation.

Both input and output tags are also useful to note which variables should be used when writing connection rules to or from our Blox.

Now we are ready to define the first object of IzhNeuron and connect it with the LIFNeuron we created above.

@named izh = IzhNeuron()
IzhNeuron(ModelingToolkit.ODESystem(0x0000000000002017, Symbolics.Equation[Differential(t)(V(t)) ~ 145 + jcn - u(t) + 5V(t) + 0.04(V(t)^2), Differential(t)(u(t)) ~ a*(-u(t) + b*V(t))], t, SymbolicUtils.BasicSymbolic{Real}[V(t), u(t), jcn], SymbolicUtils.BasicSymbolic{Real}[a, b, V_reset, d, θ], nothing, Dict{Any, Any}(:a => a, :b => b, :d => d, :V => V(t), :jcn => jcn, :u => u(t), :θ => θ, :V_reset => V_reset), Any[], Symbolics.Equation[], Base.RefValue{Vector{Symbolics.Num}}(Symbolics.Num[]), Base.RefValue{Any}(Matrix{Symbolics.Num}(undef, 0, 0)), Base.RefValue{Any}(Matrix{Symbolics.Num}(undef, 0, 0)), Base.RefValue{Matrix{Symbolics.Num}}(Matrix{Symbolics.Num}(undef, 0, 0)), Base.RefValue{Matrix{Symbolics.Num}}(Matrix{Symbolics.Num}(undef, 0, 0)), :izh, "", ModelingToolkit.ODESystem[], Dict{Any, Any}(a => 0.02, V_reset => -50, d => 2, u(t) => -13, V(t) => -65.0, b => 0.2, θ => 30), Dict{Any, Any}(), nothing, nothing, Symbolics.Equation[], nothing, nothing, nothing, ModelingToolkit.SymbolicContinuousCallback[], ModelingToolkit.SymbolicDiscreteCallback[condition: V(t) > θ
+# In the `IzhNeuron` constructor function we keep all arguments as keyword arguments so that we can set them more conveniently as `arg = value`. Spike threshold `θ=30` is now included as a parameter. Default values for all parameters are the keyword arguments from above. This way we can set them easily during construction.

NOTE: In IzhNeuron the jcn variable does not get a default value, only the [input=true] tag. This means that other Bloxs will connect to a IzhNeuron through jcn.

Neuroblox automatically initializes a jcn ~ 0 equation and then accumulates connection terms in it. This happens with all input variables of Bloxs.

Similarly the [output=true] tag designates the V variable as the output variable. It is necessary for every Blox to have one if they rely on generic connection rules that fetch the output variable and add it to the connection equation.

Both input and output tags are also useful to note which variables should be used when writing connection rules to or from our Blox.

Now we are ready to define the first object of IzhNeuron and connect it with the LIFNeuron we created above.

@named izh = IzhNeuron()
IzhNeuron(ModelingToolkit.ODESystem(0x000000000000200f, Symbolics.Equation[Differential(t)(V(t)) ~ 145 + jcn - u(t) + 5V(t) + 0.04(V(t)^2), Differential(t)(u(t)) ~ a*(-u(t) + b*V(t))], t, SymbolicUtils.BasicSymbolic{Real}[V(t), u(t), jcn], SymbolicUtils.BasicSymbolic{Real}[a, b, V_reset, d, θ], nothing, Dict{Any, Any}(:a => a, :b => b, :d => d, :V => V(t), :jcn => jcn, :u => u(t), :θ => θ, :V_reset => V_reset), Any[], Symbolics.Equation[], Base.RefValue{Vector{Symbolics.Num}}(Symbolics.Num[]), Base.RefValue{Any}(Matrix{Symbolics.Num}(undef, 0, 0)), Base.RefValue{Any}(Matrix{Symbolics.Num}(undef, 0, 0)), Base.RefValue{Matrix{Symbolics.Num}}(Matrix{Symbolics.Num}(undef, 0, 0)), Base.RefValue{Matrix{Symbolics.Num}}(Matrix{Symbolics.Num}(undef, 0, 0)), :izh, "", ModelingToolkit.ODESystem[], Dict{Any, Any}(a => 0.02, V_reset => -50, d => 2, u(t) => -13, V(t) => -65.0, b => 0.2, θ => 30), Dict{Any, Any}(), nothing, nothing, Symbolics.Equation[], nothing, nothing, nothing, ModelingToolkit.SymbolicContinuousCallback[], ModelingToolkit.SymbolicDiscreteCallback[condition: V(t) > θ
 affects:
   u(t) ~ d + u(t)
   V(t) ~ V_reset
diff --git a/pages/intro_diffeq/index.html b/pages/intro_diffeq/index.html
index 19321b4..9811485 100644
--- a/pages/intro_diffeq/index.html
+++ b/pages/intro_diffeq/index.html
@@ -106,8 +106,7 @@ 

Adding external currents

Until now we have been simulating the Izhikevich neuron by injecting it with a constant external DC current I=10. We'll now see how we can expand the I input to a dynamic current, which is more realistic (currents do not remain constant in the brain for too long). Since I will change dynamically in time, it will be a time-dependent variable of the system and not a constant parameter.

@variables v(t)=-65 u(t)=-13 I(t)
-# The following parameter values correspond to regular spiking.
-@parameters a=0.02 b=0.2 c=-65 d=8
+@parameters a=0.02 b=0.2 c=-65 d=8 ## These parameter values correspond to regular spiking.
 
 eqs = [D(v) ~ 0.04 * v ^ 2 + 5 * v + 140 - u + I,
         D(u) ~ a * (b * v - u),
@@ -115,7 +114,6 @@ 

30.0) => [u ~ u + d, v ~ c] -# Notice how `I` was moved from the parameter list to the variable list in the following call. @named izh_system = ODESystem(eqs, t, [v, u, I], [a, b, c, d]; discrete_events = event) izh_simple = structural_simplify(izh_system)

Model izh_system:
 Equations (2):
@@ -129,7 +127,7 @@ 

-

Let's display the equations of the original and the simplified system to see the effect of structural_simplify.

+

Notice how I was moved from the parameter list to the variable list above. Let's display the equations of the original and the simplified system to see the effect of structural_simplify.

equations(izh_system)
3-element Vector{Symbolics.Equation}:
  Differential(t)(v(t)) ~ 140 - u(t) + 5v(t) + I(t) + 0.04(v(t)^2)
  Differential(t)(u(t)) ~ a*(-u(t) + b*v(t))
diff --git a/pages/intro_plot/index.html b/pages/intro_plot/index.html
index ba21424..bf643db 100644
--- a/pages/intro_plot/index.html
+++ b/pages/intro_plot/index.html
@@ -11,8 +11,7 @@
 lines!(axs[1], seconds, measurements)
 scatter!(axs[2], seconds, measurements)
 
-fig

Note: Plot functions in Makie also work without defining a Figure and an Axis object explicitly. E.g. plotting with lines(seconds, measurements) or scatter(seconds, measurements) . However in this case we won't have all the customization options for the plot axes readily available.

Plotting layouts in Makie is quite intuitive. We can treat the Figure object as a matrix of (sub)plot positions. In the example above we organized the two plots on a single column on positions fig[1,1] and fig[2,1] (remember that Julia is an 1-index language!). We then input these grid positions of the figure to the respective Axis object to define the 2D axes which will contain each plot. When defining an Axis there are multiple options to affect its appearance and alignment, see the Axis documentation page for more details. We can also change an Axis after it has been constructed. For instance we could hide the x-axis label and ticks on the top plot above, since it is a duplicate of the x-axis of the bottom plot. We will keep the grid lines though, because it is easier to read the x-axis values this way.

# `grid=false` avoids hiding the x grid lines
-hidexdecorations!(axs[1], grid=false)
+fig

Note: Plot functions in Makie also work without defining a Figure and an Axis object explicitly. E.g. plotting with lines(seconds, measurements) or scatter(seconds, measurements) . However in this case we won't have all the customization options for the plot axes readily available.

Plotting layouts in Makie is quite intuitive. We can treat the Figure object as a matrix of (sub)plot positions. In the example above we organized the two plots on a single column on positions fig[1,1] and fig[2,1] (remember that Julia is an 1-index language!). We then input these grid positions of the figure to the respective Axis object to define the 2D axes which will contain each plot. When defining an Axis there are multiple options to affect its appearance and alignment, see the Axis documentation page for more details. We can also change an Axis after it has been constructed. For instance we could hide the x-axis label and ticks on the top plot above, since it is a duplicate of the x-axis of the bottom plot. We will keep the grid lines though, because it is easier to read the x-axis values this way.

hidexdecorations!(axs[1], grid=false) ## `grid=false` avoids hiding the x grid lines
 
 # Now we can display the figure again with the updated axes
 fig

Plotting spikes

We will now combine the Makie and the Differential Equations ecosystems to start plotting more meaningful results after simulating neuronal models. We will use the Izhikevich model from the last section in its fast-spiking regime. Besides the spiking event, we will add a second event that increases the external current flowing into the neuron at a specific time during simulation. We will count and plot the spikes that the neuron emits within time windows of a given width both before and after the change in external current.

using ModelingToolkit
@@ -20,8 +19,7 @@
 using OrdinaryDiffEq
 
 @variables v(t)=-65 u(t)=-13
-# Parameters for fast spiking.
-@parameters a=0.1 b=0.2 c=-65 d=2 I=10
+@parameters a=0.1 b=0.2 c=-65 d=2 I=10 ## Parameters for fast spiking.
 
 eqs = [D(v) ~ 0.04 * v ^ 2 + 5 * v + 140 - u + I,
         D(u) ~ a * (b * v - u)]
@@ -50,13 +48,29 @@
 # split time into bins of size `t_window`
 t_range = first(tspan):t_window:last(tspan)
 # initialize an empty vector to hold the spike values.
-spikes = zeros(length(t_range) - 1)
-
-# loop over the timepoints at which every time window begins
-for i in eachindex(t_range[1:end-1])
-    # find the indices of timepoints that fall within the current time window
+spikes = zeros(length(t_range) - 1)
20-element Vector{Float64}:
+ 0.0
+ 0.0
+ 0.0
+ 0.0
+ 0.0
+ 0.0
+ 0.0
+ 0.0
+ 0.0
+ 0.0
+ 0.0
+ 0.0
+ 0.0
+ 0.0
+ 0.0
+ 0.0
+ 0.0
+ 0.0
+ 0.0
+ 0.0

To find spikes we need to

  • loop over the timepoints at which every time window begins

  • find the indices of timepoints that fall within the current time window

  • count the number of spikes within the same window

for i in eachindex(t_range[1:end-1])
     idxs = findall(t -> t_range[i] <= t <= t_range[i+1], timepoints)
-    # count the number of spikes within the same window
+
     spikes[i] = count(V_izh[idxs] .> spike_threshold) ## counts the number of True elements in a Boolean vector
 end
 
diff --git a/pages/learning/index.html b/pages/learning/index.html
index 188fc80..3efe6cf 100644
--- a/pages/learning/index.html
+++ b/pages/learning/index.html
@@ -104,106 +104,106 @@
 adjacency(fig[1,1], agent; title = "Before Learning", colorrange=(0,0.2))
 
 trace = run_experiment!(agent, env; t_warmup=200.0, alg=Vern7(), verbose=true)
Trial = 1, Category choice = 2, Response = Correct
-Trial = 2, Category choice = 2, Response = False
-Trial = 3, Category choice = 1, Response = Correct
+Trial = 2, Category choice = 1, Response = Correct
+Trial = 3, Category choice = 2, Response = False
 Trial = 4, Category choice = 2, Response = Correct
-Trial = 5, Category choice = 1, Response = Correct
-Trial = 6, Category choice = 1, Response = False
+Trial = 5, Category choice = 2, Response = False
+Trial = 6, Category choice = 2, Response = Correct
 Trial = 7, Category choice = 2, Response = Correct
 Trial = 8, Category choice = 2, Response = Correct
 Trial = 9, Category choice = 2, Response = Correct
-Trial = 10, Category choice = 2, Response = Correct
-Trial = 11, Category choice = 2, Response = Correct
+Trial = 10, Category choice = 1, Response = False
+Trial = 11, Category choice = 1, Response = False
 Trial = 12, Category choice = 2, Response = Correct
 Trial = 13, Category choice = 2, Response = False
 Trial = 14, Category choice = 2, Response = Correct
 Trial = 15, Category choice = 2, Response = False
 Trial = 16, Category choice = 1, Response = Correct
 Trial = 17, Category choice = 2, Response = False
-Trial = 18, Category choice = 2, Response = False
+Trial = 18, Category choice = 1, Response = Correct
 Trial = 19, Category choice = 2, Response = False
-Trial = 20, Category choice = 1, Response = False
-Trial = 21, Category choice = 2, Response = False
-Trial = 22, Category choice = 1, Response = Correct
+Trial = 20, Category choice = 2, Response = Correct
+Trial = 21, Category choice = 1, Response = Correct
+Trial = 22, Category choice = 2, Response = False
 Trial = 23, Category choice = 1, Response = Correct
 Trial = 24, Category choice = 1, Response = False
-Trial = 25, Category choice = 1, Response = Correct
+Trial = 25, Category choice = 2, Response = False
 Trial = 26, Category choice = 1, Response = Correct
 Trial = 27, Category choice = 1, Response = Correct
-Trial = 28, Category choice = 2, Response = False
+Trial = 28, Category choice = 1, Response = Correct
 Trial = 29, Category choice = 2, Response = Correct
 Trial = 30, Category choice = 2, Response = False
-Trial = 31, Category choice = 2, Response = Correct
+Trial = 31, Category choice = 1, Response = False
 Trial = 32, Category choice = 2, Response = False
-Trial = 33, Category choice = 2, Response = Correct
-Trial = 34, Category choice = 2, Response = Correct
-Trial = 35, Category choice = 2, Response = Correct
+Trial = 33, Category choice = 1, Response = False
+Trial = 34, Category choice = 1, Response = False
+Trial = 35, Category choice = 1, Response = False
 Trial = 36, Category choice = 2, Response = False
-Trial = 37, Category choice = 2, Response = False
+Trial = 37, Category choice = 1, Response = Correct
 Trial = 38, Category choice = 2, Response = False
 Trial = 39, Category choice = 2, Response = Correct
-Trial = 40, Category choice = 1, Response = Correct
-Trial = 41, Category choice = 2, Response = Correct
+Trial = 40, Category choice = 2, Response = False
+Trial = 41, Category choice = 1, Response = False
 Trial = 42, Category choice = 2, Response = False
-Trial = 43, Category choice = 1, Response = Correct
-Trial = 44, Category choice = 2, Response = Correct
+Trial = 43, Category choice = 2, Response = False
+Trial = 44, Category choice = 1, Response = False
 Trial = 45, Category choice = 2, Response = False
-Trial = 46, Category choice = 1, Response = Correct
+Trial = 46, Category choice = 2, Response = False
 Trial = 47, Category choice = 1, Response = Correct
-Trial = 48, Category choice = 1, Response = False
+Trial = 48, Category choice = 2, Response = Correct
 Trial = 49, Category choice = 1, Response = False
 Trial = 50, Category choice = 2, Response = Correct
 Trial = 51, Category choice = 1, Response = Correct
 Trial = 52, Category choice = 1, Response = Correct
 Trial = 53, Category choice = 2, Response = Correct
-Trial = 54, Category choice = 2, Response = Correct
-Trial = 55, Category choice = 1, Response = False
-Trial = 56, Category choice = 2, Response = Correct
-Trial = 57, Category choice = 1, Response = Correct
+Trial = 54, Category choice = 1, Response = False
+Trial = 55, Category choice = 2, Response = Correct
+Trial = 56, Category choice = 1, Response = False
+Trial = 57, Category choice = 2, Response = False
 Trial = 58, Category choice = 1, Response = Correct
-Trial = 59, Category choice = 2, Response = False
-Trial = 60, Category choice = 2, Response = False
+Trial = 59, Category choice = 1, Response = Correct
+Trial = 60, Category choice = 1, Response = Correct
 Trial = 61, Category choice = 1, Response = False
-Trial = 62, Category choice = 2, Response = Correct
-Trial = 63, Category choice = 1, Response = False
-Trial = 64, Category choice = 2, Response = False
-Trial = 65, Category choice = 1, Response = Correct
+Trial = 62, Category choice = 1, Response = False
+Trial = 63, Category choice = 2, Response = Correct
+Trial = 64, Category choice = 1, Response = Correct
+Trial = 65, Category choice = 2, Response = False
 Trial = 66, Category choice = 2, Response = Correct
-Trial = 67, Category choice = 1, Response = Correct
+Trial = 67, Category choice = 2, Response = False
 Trial = 68, Category choice = 2, Response = Correct
-Trial = 69, Category choice = 2, Response = Correct
+Trial = 69, Category choice = 1, Response = False
 Trial = 70, Category choice = 1, Response = Correct
-Trial = 71, Category choice = 2, Response = False
-Trial = 72, Category choice = 2, Response = Correct
-Trial = 73, Category choice = 1, Response = False
-Trial = 74, Category choice = 1, Response = Correct
+Trial = 71, Category choice = 1, Response = Correct
+Trial = 72, Category choice = 1, Response = False
+Trial = 73, Category choice = 2, Response = Correct
+Trial = 74, Category choice = 2, Response = False
 Trial = 75, Category choice = 2, Response = False
-Trial = 76, Category choice = 1, Response = False
-Trial = 77, Category choice = 2, Response = False
-Trial = 78, Category choice = 1, Response = Correct
+Trial = 76, Category choice = 2, Response = Correct
+Trial = 77, Category choice = 1, Response = Correct
+Trial = 78, Category choice = 2, Response = False
 Trial = 79, Category choice = 2, Response = False
 Trial = 80, Category choice = 1, Response = Correct
 Trial = 81, Category choice = 2, Response = Correct
 Trial = 82, Category choice = 1, Response = Correct
 Trial = 83, Category choice = 2, Response = False
 Trial = 84, Category choice = 2, Response = Correct
-Trial = 85, Category choice = 2, Response = Correct
-Trial = 86, Category choice = 2, Response = False
+Trial = 85, Category choice = 1, Response = False
+Trial = 86, Category choice = 1, Response = Correct
 Trial = 87, Category choice = 2, Response = False
 Trial = 88, Category choice = 2, Response = False
 Trial = 89, Category choice = 2, Response = Correct
-Trial = 90, Category choice = 2, Response = False
+Trial = 90, Category choice = 1, Response = Correct
 Trial = 91, Category choice = 2, Response = Correct
 Trial = 92, Category choice = 2, Response = False
-Trial = 93, Category choice = 1, Response = False
+Trial = 93, Category choice = 2, Response = Correct
 Trial = 94, Category choice = 2, Response = Correct
 Trial = 95, Category choice = 2, Response = False
 Trial = 96, Category choice = 1, Response = False
 Trial = 97, Category choice = 1, Response = False
-Trial = 98, Category choice = 1, Response = False
+Trial = 98, Category choice = 2, Response = Correct
 Trial = 99, Category choice = 1, Response = Correct
 Trial = 100, Category choice = 2, Response = False
-(trial = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100], correct = Bool[1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 0, 0, 1, 1, 1, 0, 1, 1, 0, 1, 1, 0, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 0, 0, 1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 0, 0, 1, 0, 1, 1, 1, 0, 1, 1, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 0, 0, 1, 0], action = [2, 2, 1, 2, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 1, 2, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 2, 1, 2, 2, 1, 1, 1, 1, 2, 1, 1, 2, 2, 1, 2, 1, 1, 2, 2, 1, 2, 1, 2, 1, 2, 1, 2, 2, 1, 2, 2, 1, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 2, 1, 1, 1, 1, 2])

trace is a NamedTuple containing useful outcomes for each trial of the experiment:

trace.trial ## trial indices
+(trial = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100], correct = Bool[1, 1, 0, 1, 0, 1, 1, 1, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1, 1, 0, 1, 0, 0, 1, 1, 1, 0, 0, 1, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 1, 1, 0, 1, 0, 1, 0, 0, 1, 1, 1, 0, 1, 1, 0, 0, 0, 1, 1, 0], action = [2, 1, 2, 2, 2, 2, 2, 2, 2, 1, 1, 2, 2, 2, 2, 1, 2, 1, 2, 2, 1, 2, 1, 1, 2, 1, 1, 1, 2, 2, 1, 2, 1, 1, 1, 2, 1, 2, 2, 2, 1, 2, 2, 1, 2, 2, 1, 2, 1, 2, 1, 1, 2, 1, 2, 1, 2, 1, 1, 1, 1, 1, 2, 1, 2, 2, 2, 2, 1, 1, 1, 1, 2, 2, 2, 2, 1, 2, 2, 1, 2, 1, 2, 2, 1, 1, 2, 2, 2, 1, 2, 2, 2, 2, 2, 1, 1, 2, 1, 2])

trace is a NamedTuple containing useful outcomes for each trial of the experiment:

trace.trial ## trial indices
 trace.correct ## whether the response was correct or not on each trial
 trace.action; ## what responce was made on each trial, 1 is left and 2 is right