Skip to content

oneunit(::Type{Any} #1003

@Li-shiyue

Description

@Li-shiyue

Is it grammatical to construct a system of differential equations in this way? What does this error mean?
function eee!(u, p, t)
x, y = u
a,b,c = p
for i=2:1:99
dx[i] = ax[i-1]+(i+1)x[i+1]-by[i]
dy[i] = (i+1)y[i+1]-i
y[i]-cy[i]+bx[i]
end
end
using DifferentialEquations
u1 = []
u2 = []
for i =1:100
push!(u1,0)
push!(u2,0)
end
tspan = (0.0, 20.0)
p = [0.2, 0.04, 20]
u0=[u1,u2]
prob = ODEProblem(eee!, u0, tspan,p)
solve(prob)

ERROR: MethodError: no method matching oneunit(::Type{Any})

Closest candidates are:
oneunit(::Type{Union{Missing, T}}) where T
@ Base missing.jl:105
oneunit(::Type{T}) where T
@ Base number.jl:370
oneunit(::T) where T
@ Base number.jl:369
...

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions