I get the error MethodError: objects of type Float64 are not callable
when trying to run sol = solve(prob)
. I have checked solutions to this error and none have worked.
using DifferentialEquations
const σ = 0.002; const θ = -0.5
function s(val)
return 1+exp(-(val - θ) / σ)^-1
end
function model(du,u,p,t)
x1, x2, y1, y2, xJ, yJ = u
τJ, τE, ε, γ, γJ, β, βJ, δ, δJ, λ, λJ, gexc, ginh, xinh, xexc = p
du[1] = ẋ1 = 3*x1 - x1^3 + y1 - ginh*s(xJ*(t - τJ))(x1 - xinh)
du[2] = ẏ1 = ε*(λ - γ*tanh(β*(x1 - δ)) - y1)
du[3] = ẋ2 = 3*x2 - x2^3 + y2 - ginh*s(xJ*(t - τJ))(x2 - xinh)
du[4] = ẏ1 = ε*(λ - γ*tanh(β*(x2 - δ)) - y2)
du[5] = ẋJ = 3*xJ - xJ^3 + yJ - gexc*(s(du[1]*(t - τE)) + s(du[3]*(t-τE)))(xJ - xexc)
du[6] = ẏJ = ε*(λJ - γJ*tanh(βJ*(xJ - δ)) - yJ)
end
u0 = [-1, -0.3, 0.2, 0.02, -1.1, 0.1]
p = [0, 0, 0.025, 5, 5, 10, 10, -1.1, -1.1, 1, 0, 1, 1, -3, 3]
tspan = (0.0,200.0)
prob = ODEProblem(model,u0,tspan,p)
sol = solve(prob)
using Plots
plot(sol)
Any help is appreciated.