Skip to content

Array parameters and callbacks #3154

@ArnoStrouwen

Description

@ArnoStrouwen
@mtkmodel DECAY begin
    @parameters begin
        unrelated[1:2] = zeros(2)
        k = 0.0
    end
    @variables begin
        x(t) = 10.0
    end
    @equations begin
        D(x) ~ -k*x
    end
    @discrete_events begin
        (t == 1.0) => [k~1.0]
    end
end
@mtkbuild decay = DECAY()
prob = ODEProblem(decay, [], (0.0, 10.0), [])
sol = solve(prob, Tsit5(),tstops=[1.0])
julia> sol = solve(prob, Tsit5(),tstops=[1.0])
ERROR: MethodError: no method matching view(::Float64, ::UnitRange{Int64})
The function `view` exists, but no method is defined for this combination of argument types.

Removing the array works.

Metadata

Metadata

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions