Skip to content

Izhikevichch Model: feedback events #39

Description

@mongibellili

The implementation of the model by DifferentialEquations.jl can be found here.

QuantizedSystemSolver

using QuantizedSystemSolver
function izh!(du, u, p, t)
    a, b, c, d, I = p
    du[1] = 0.04 * u[1]^2 + 5.0 * u[1] + 140.0 - u[2] + I
    du[2] = a * (b * u[1] - u[2])
    if u[1] >= 30.0
        u[1] = c
        u[2] += d
    end
    if t >= 50.0
        p[5] += 10.0
    end
end
p = [0.02, 0.2, -50.0, 2.0, 0.0]
u0 = [-60.0, p[2] * -60.0]
tspan = (0.0, 300.0)
prob = ODEProblem(izh!, u0, tspan, p)
sol = solve(prob,liqss2(),reltol=1e-3,abstol=1e-3 );
p1=plot(sol, idxs = 1)
p2=plot(sol, idxs = 2)
@btime solve($prob,liqss2(),reltol=1e-3,abstol=1e-3 )

Jacobian at (u₁, u₂) = (-65, -13)
[[-0.2 -1. ]
[ 0.004 -0.02 ]]

Eigenvalues
λ ≈ { -0.1740, -0.0460 }

The total simulation steps: 1665
The number of events: 27
598.200 μs (79 allocations: 62.29 KiB)

Image Image

removing the time event:

sol.stats =
The total simulation steps: 1780
The number of events: 36
The number of state steps per Var: [1458, 286]
618.700 μs (64 allocations: 69.01 KiB)

removing all the events gives:

sol.stats =
The total simulation steps: 397
The number of state steps per Var: [335, 62]
120.800 μs (62 allocations: 60.21 KiB)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentation

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions