From d32b628030e79c9682c7556b0858131f9f6eb0a7 Mon Sep 17 00:00:00 2001 From: Mason Protter Date: Mon, 4 Nov 2024 16:52:35 +0100 Subject: [PATCH 1/2] fix mistake in LIFExciNeuron connections --- src/GraphDynamicsInterop/connection_interop.jl | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/GraphDynamicsInterop/connection_interop.jl b/src/GraphDynamicsInterop/connection_interop.jl index 9b8e2af2..7f30435d 100644 --- a/src/GraphDynamicsInterop/connection_interop.jl +++ b/src/GraphDynamicsInterop/connection_interop.jl @@ -260,7 +260,10 @@ end function (c::BasicConnection)(sys_src::Subsystem{LIFExciNeuron}, sys_dst::Union{Subsystem{LIFExciNeuron}, Subsystem{LIFInhNeuron}}) - (; jcn = 0.0) + w = c.weight + + (; jcn = w * sys_src.S_NMDA * sys_dst.g_NMDA * (sys_dst.V - sys_dst.V_E) / + (1 + sys_dst.Mg * exp(-0.062 * sys_dst.V) / 3.57)) end function (c::BasicConnection)(::Subsystem{LIFInhNeuron}, From e0e36a4a4caa871382e17cb4274dfc834c98da02 Mon Sep 17 00:00:00 2001 From: Mason Protter Date: Mon, 4 Nov 2024 16:55:21 +0100 Subject: [PATCH 2/2] increase test duration to catch the bug --- test/GraphDynamicsTests/test_suite.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/GraphDynamicsTests/test_suite.jl b/test/GraphDynamicsTests/test_suite.jl index bdcff148..8a1f873e 100644 --- a/test/GraphDynamicsTests/test_suite.jl +++ b/test/GraphDynamicsTests/test_suite.jl @@ -692,7 +692,7 @@ function lif_exci_inh_tests(;tspan=(0.0, 20.0), rtol=1e-8) test_compare_du_and_sols(ODEProblem, g, tspan; rtol, alg=Tsit5()) end -function decision_making_test(;tspan=(0.0, 9.0), rtol=1e-5) +function decision_making_test(;tspan=(0.0, 20.0), rtol=1e-5) ## Describe what the local variables you define are for global_ns = :g ## global name for the circuit. All components should be inside this namespace.