Calculation of gradient not working for an ODEproblem that uses 2D or 3D arrays

Solving a set of 30 coupled pairs of 2 differential equations with u, du a 2x30 2D array results in

ERROR: DimensionMismatch(“arrays could not be broadcast to a common size; got a dimension with lengths 2 and 60”).

The problem is that internally the vector of dimension 2x30 is flattened into a 60 element vector. Same problem occurs for 3D arrays.

using Flux
using DifferentialEquations
using DiffEqSensitivity

function model(p)
    N_oscillators = 30
    u0 = repeat([0.0; 1.0], 1, N_oscillators) # size(u0) = (2, 30)

    function du!(du, u, p, t)
        W, b  = p # Parameters 
        dy  = @view du[1,:] # 30 elements 
        dy′ = @view du[2,:]
        y = @view u[1,:]
        y′= @view u[2,:]
        @. dy′ = -y * W 
        @. dy  = y′ * b
    end

    output = solve(
        ODEProblem(
            du!,
            u0,
            (0.0, 10.0),
            p,
            jac = true,
            abstol = 1e-12,
            reltol = 1e-12),
        Tsit5(),
        jac = true,
        saveat = collect(0:0.1:7),
        sensealg = QuadratureAdjoint(),
    )
    return Array(output[1, :, :]) # only return y, not y′
end

p=[1.5, 0.1]
y = model(p)
loss() = sum(model(p))
@show gradient(() -> loss(), params(p)) # This fails with a Broadcast Error

Package Version:

Julia Version 1.4.0
Commit b8e9a9ecc6 (2020-03-21 16:36 UTC)
Platform Info:
OS: Windows (x86_64-w64-mingw32)
CPU: Intel(R) Core™ i7-6820HQ CPU @ 2.70GHz
WORD_SIZE: 64
LIBM: libopenlibm
LLVM: libLLVM-8.0.1 (ORCJIT, skylake)

[587475ba] Flux v0.10.4
[0c46a032] DifferentialEquations v6.15.0
[41bf760c] DiffEqSensitivity v6.23.0

I’d be grateful of any insights into the solution.

Stacktrace:

[1] _bcs1 at .\broadcast.jl:490 [inlined]

[2] _bcs at .\broadcast.jl:484 [inlined]

[3] broadcast_shape at .\broadcast.jl:478 [inlined]

[4] combine_axes at .julia\packages\DiffEqBase\uSSHl\src\diffeqfastbc.jl:23 [inlined]

[5] instantiate at .\broadcast.jl:256 [inlined]

[6] materialize at .\broadcast.jl:820 [inlined]

[7] _vecjacobian!(::Array{Float64,1}, ::Array{Float64,2}, ::Array{Float64,1}, ::Array{Float64,1}, ::Float64, ::DiffEqSensitivity.ODEQuadratureAdjointSensitivityFunction{DiffEqSensitivity.AdjointDiffCache{Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,ReverseDiff.GradientTape{DiffEqSensitivity.var"#77#86"{DiffEqBase.ODEFunction{true,Reservoir.harmonic2Dv_mwe2.var"#du!#22",LinearAlgebra.UniformScaling{Bool},Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing}},Tuple{ReverseDiff.TrackedArray{Float64,Float64,2,Array{Float64,2},Array{Float64,2}},ReverseDiff.TrackedArray{Float64,Float64,1,Array{Float64,1},Array{Float64,1}},ReverseDiff.TrackedArray{Float64,Float64,1,Array{Float64,1},Array{Float64,1}}},Array{ReverseDiff.TrackedReal{Float64,Float64,ReverseDiff.TrackedArray{Float64,Float64,1,Array{Float64,1},Array{Float64,1}}},1}},Nothing,Nothing,Array{Float64,2},Nothing,Base.OneTo{Int64},UnitRange{Int64},LinearAlgebra.UniformScaling{Bool}},DiffEqSensitivity.QuadratureAdjoint{0,true,Val{:central},Bool},Array{Float64,2},DiffEqBase.ODESolution{Float64,3,Array{Array{Float64,2},1},Nothing,Nothing,Array{Float64,1},Array{Array{Array{Float64,2},1},1},DiffEqBase.ODEProblem{Array{Float64,2},Tuple{Float64,Float64},true,Array{Float64,1},DiffEqBase.ODEFunction{true,Reservoir.harmonic2Dv_mwe2.var"#du!#22",LinearAlgebra.UniformScaling{Bool},Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing},Base.Iterators.Pairs{Symbol,Real,Tuple{Symbol,Symbol,Symbol},NamedTuple{(:jac, :abstol, :reltol),Tuple{Bool,Float64,Float64}}},DiffEqBase.StandardODEProblem},OrdinaryDiffEq.Tsit5,OrdinaryDiffEq.InterpolationData{DiffEqBase.ODEFunction{true,Reservoir.harmonic2Dv_mwe2.var"#du!#22",LinearAlgebra.UniformScaling{Bool},Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing},Array{Array{Float64,2},1},Array{Float64,1},Array{Array{Array{Float64,2},1},1},OrdinaryDiffEq.Tsit5Cache{Array{Float64,2},Array{Float64,2},Array{Float64,2},OrdinaryDiffEq.Tsit5ConstantCache{Float64,Float64}}},DiffEqBase.DEStats},DiffEqBase.ODEFunction{true,Reservoir.harmonic2Dv_mwe2.var"#du!#22",LinearAlgebra.UniformScaling{Bool},Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing}}, ::DiffEqSensitivity.ReverseDiffVJP{false}, ::Nothing, ::Nothing) at C:\Users\user.julia\packages\DiffEqSensitivity\XQ1vJ\src\local_sensitivity\derivative_wrappers.jl:228

[8] _vecjacobian! at C:\Users\user.julia\packages\DiffEqSensitivity\XQ1vJ\src\local_sensitivity\derivative_wrappers.jl:185 [inlined]

[9] #vecjacobian!#20 at C:\Users\user.julia\packages\DiffEqSensitivity\XQ1vJ\src\local_sensitivity\derivative_wrappers.jl:147 [inlined]

[10] vecjacobian! at C:\Users\user.julia\packages\DiffEqSensitivity\XQ1vJ\src\local_sensitivity\derivative_wrappers.jl:147 [inlined]

[11] (::DiffEqSensitivity.ODEQuadratureAdjointSensitivityFunction{DiffEqSensitivity.AdjointDiffCache{Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,ReverseDiff.GradientTape{DiffEqSensitivity.var"#77#86"{DiffEqBase.ODEFunction{true,Reservoir.harmonic2Dv_mwe2.var"#du!#22",LinearAlgebra.UniformScaling{Bool},Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing}},Tuple{ReverseDiff.TrackedArray{Float64,Float64,2,Array{Float64,2},Array{Float64,2}},ReverseDiff.TrackedArray{Float64,Float64,1,Array{Float64,1},Array{Float64,1}},ReverseDiff.TrackedArray{Float64,Float64,1,Array{Float64,1},Array{Float64,1}}},Array{ReverseDiff.TrackedReal{Float64,Float64,ReverseDiff.TrackedArray{Float64,Float64,1,Array{Float64,1},Array{Float64,1}}},1}},Nothing,Nothing,Array{Float64,2},Nothing,Base.OneTo{Int64},UnitRange{Int64},LinearAlgebra.UniformScaling{Bool}},DiffEqSensitivity.QuadratureAdjoint{0,true,Val{:central},Bool},Array{Float64,2},DiffEqBase.ODESolution{Float64,3,Array{Array{Float64,2},1},Nothing,Nothing,Array{Float64,1},Array{Array{Array{Float64,2},1},1},DiffEqBase.ODEProblem{Array{Float64,2},Tuple{Float64,Float64},true,Array{Float64,1},DiffEqBase.ODEFunction{true,Reservoir.harmonic2Dv_mwe2.var"#du!#22",LinearAlgebra.UniformScaling{Bool},Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing},Base.Iterators.Pairs{Symbol,Real,Tuple{Symbol,Symbol,Symbol},NamedTuple{(:jac, :abstol, :reltol),Tuple{Bool,Float64,Float64}}},DiffEqBase.StandardODEProblem},OrdinaryDiffEq.Tsit5,OrdinaryDiffEq.InterpolationData{DiffEqBase.ODEFunction{true,Reservoir.harmonic2Dv_mwe2.var"#du!#22",LinearAlgebra.UniformScaling{Bool},Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing},Array{Array{Float64,2},1},Array{Float64,1},Array{Array{Array{Float64,2},1},1},OrdinaryDiffEq.Tsit5Cache{Array{Float64,2},Array{Float64,2},Array{Float64,2},OrdinaryDiffEq.Tsit5ConstantCache{Float64,Float64}}},DiffEqBase.DEStats},DiffEqBase.ODEFunction{true,Reservoir.harmonic2Dv_mwe2.var"#du!#22",LinearAlgebra.UniformScaling{Bool},Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing}})(::Array{Float64,1}, ::Array{Float64,1}, ::Array{Float64,1}, ::Float64) at C:\Users\user.julia\packages\DiffEqSensitivity\XQ1vJ\src\local_sensitivity\quadrature_adjoint.jl:29

[12] ODEFunction at C:\Users\user.julia\packages\DiffEqBase\uSSHl\src\diffeqfunction.jl:248 [inlined]

[13] initialize!(::OrdinaryDiffEq.ODEIntegrator{OrdinaryDiffEq.Tsit5,true,Array{Float64,1},Nothing,Float64,Array{Float64,1},Float64,Float64,Float64,Array{Array{Float64,1},1},DiffEqBase.ODESolution{Float64,2,Array{Array{Float64,1},1},Nothing,Nothing,Array{Float64,1},Array{Array{Array{Float64,1},1},1},DiffEqBase.ODEProblem{Array{Float64,1},Tuple{Float64,Float64},true,Array{Float64,1},DiffEqBase.ODEFunction{true,DiffEqSensitivity.ODEQuadratureAdjointSensitivityFunction{DiffEqSensitivity.AdjointDiffCache{Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,ReverseDiff.GradientTape{DiffEqSensitivity.var"#77#86"{DiffEqBase.ODEFunction{true,Reservoir.harmonic2Dv_mwe2.var"#du!#22",LinearAlgebra.UniformScaling{Bool},Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing}},Tuple{ReverseDiff.TrackedArray{Float64,Float64,2,Array{Float64,2},Array{Float64,2}},ReverseDiff.TrackedArray{Float64,Float64,1,Array{Float64,1},Array{Float64,1}},ReverseDiff.TrackedArray{Float64,Float64,1,Array{Float64,1},Array{Float64,1}}},Array{ReverseDiff.TrackedReal{Float64,Float64,ReverseDiff.TrackedArray{Float64,Float64,1,Array{Float64,1},Array{Float64,1}}},1}},Nothing,Nothing,Array{Float64,2},Nothing,Base.OneTo{Int64},UnitRange{Int64},LinearAlgebra.UniformScaling{Bool}},DiffEqSensitivity.QuadratureAdjoint{0,true,Val{:central},Bool},Array{Float64,2},DiffEqBase.ODESolution{Float64,3,Array{Array{Float64,2},1},Nothing,Nothing,Array{Float64,1},Array{Array{Array{Float64,2},1},1},DiffEqBase.ODEProblem{Array{Float64,2},Tuple{Float64,Float64},true,Array{Float64,1},DiffEqBase.ODEFunction{true,Reservoir.harmonic2Dv_mwe2.var"#du!#22",LinearAlgebra.UniformScaling{Bool},Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing},Base.Iterators.Pairs{Symbol,Real,Tuple{Symbol,Symbol,Symbol},NamedTuple{(:jac, :abstol, :reltol),Tuple{Bool,Float64,Float64}}},DiffEqBase.StandardODEProblem},OrdinaryDiffEq.Tsit5,OrdinaryDiffEq.InterpolationData{DiffEqBase.ODEFunction{true,Reservoir.harmonic2Dv_mwe2.var"#du!#22",LinearAlgebra.UniformScaling{Bool},Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing},Array{Array{Float64,2},1},Array{Float64,1},Array{Array{Array{Float64,2},1},1},OrdinaryDiffEq.Tsit5Cache{Array{Float64,2},Array{Float64,2},Array{Float64,2},OrdinaryDiffEq.Tsit5ConstantCache{Float64,Float64}}},DiffEqBase.DEStats},DiffEqBase.ODEFunction{true,Reservoir.harmonic2Dv_mwe2.var"#du!#22",LinearAlgebra.UniformScaling{Bool},Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing}},LinearAlgebra.UniformScaling{Bool},Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing},Base.Iterators.Pairs{Symbol,DiffEqBase.CallbackSet{Tuple{},Tuple{DiffEqBase.DiscreteCallback{DiffEqCallbacks.var"#33#36"{Base.RefValue{Union{Nothing, Float64}}},DiffEqCallbacks.var"#34#37"{DiffEqSensitivity.var"#94#96"{Base.RefValue{Int64},Array{Float64,1}},DiffEqSensitivity.var"#95#97"{DiffEqSensitivity.var"#df#132"{Array{Float64,3},Array{Float64,2},Colon},DiffEqSensitivity.QuadratureAdjoint{0,true,Val{:central},Bool},Base.OneTo{Int64},UnitRange{Int64},LinearAlgebra.UniformScaling{Bool},Bool,Nothing,Nothing,Array{Float64,2},Nothing,Bool,Array{Float64,1},Array{Float64,1},Array{Float64,2},Base.RefValue{Int64},Int64,LinearAlgebra.UniformScaling{Bool}},Base.RefValue{Union{Nothing, Float64}}},DiffEqCallbacks.var"#35#38"{typeof(DiffEqBase.INITIALIZE_DEFAULT),Bool,DiffEqSensitivity.var"#94#96"{Base.RefValue{Int64},Array{Float64,1}},Base.RefValue{Union{Nothing, Float64}},DiffEqCallbacks.var"#34#37"{DiffEqSensitivity.var"#94#96"{Base.RefValue{Int64},Array{Float64,1}},DiffEqSensitivity.var"#95#97"{DiffEqSensitivity.var"#df#132"{Array{Float64,3},Array{Float64,2},Colon},DiffEqSensitivity.QuadratureAdjoint{0,true,Val{:central},Bool},Base.OneTo{Int64},UnitRange{Int64},LinearAlgebra.UniformScaling{Bool},Bool,Nothing,Nothing,Array{Float64,2},Nothing,Bool,Array{Float64,1},Array{Float64,1},Array{Float64,2},Base.RefValue{Int64},Int64,LinearAlgebra.UniformScaling{Bool}},Base.RefValue{Union{Nothing, Float64}}}}}}},Tuple{Symbol},NamedTuple{(:callback,),Tuple{DiffEqBase.CallbackSet{Tuple{},Tuple{DiffEqBase.DiscreteCallback{DiffEqCallbacks.var"#33#36"{Base.RefValue{Union{Nothing, Float64}}},DiffEqCallbacks.var"#34#37"{DiffEqSensitivity.var"#94#96"{Base.RefValue{Int64},Array{Float64,1}},DiffEqSensitivity.var"#95#97"{DiffEqSensitivity.var"#df#132"{Array{Float64,3},Array{Float64,2},Colon},DiffEqSensitivity.QuadratureAdjoint{0,true,Val{:central},Bool},Base.OneTo{Int64},UnitRange{Int64},LinearAlgebra.UniformScaling{Bool},Bool,Nothing,Nothing,Array{Float64,2},Nothing,Bool,Array{Float64,1},Array{Float64,1},Array{Float64,2},Base.RefValue{Int64},Int64,LinearAlgebra.UniformScaling{Bool}},Base.RefValue{Union{Nothing, Float64}}},DiffEqCallbacks.var"#35#38"{typeof(DiffEqBase.INITIALIZE_DEFAULT),Bool,DiffEqSensitivity.var"#94#96"{Base.RefValue{Int64},Array{Float64,1}},Base.RefValue{Union{Nothing, Float64}},DiffEqCallbacks.var"#34#37"{DiffEqSensitivity.var"#94#96"{Base.RefValue{Int64},Array{Float64,1}},DiffEqSensitivity.var"#95#97"{DiffEqSensitivity.var"#df#132"{Array{Float64,3},Array{Float64,2},Colon},DiffEqSensitivity.QuadratureAdjoint{0,true,Val{:central},Bool},Base.OneTo{Int64},UnitRange{Int64},LinearAlgebra.UniformScaling{Bool},Bool,Nothing,Nothing,Array{Float64,2},Nothing,Bool,Array{Float64,1},Array{Float64,1},Array{Float64,2},Base.RefValue{Int64},Int64,LinearAlgebra.UniformScaling{Bool}},Base.RefValue{Union{Nothing, Float64}}}}}}}}}},DiffEqBase.StandardODEProblem},OrdinaryDiffEq.Tsit5,OrdinaryDiffEq.InterpolationData{DiffEqBase.ODEFunction{true,DiffEqSensitivity.ODEQuadratureAdjointSensitivityFunction{DiffEqSensitivity.AdjointDiffCache{Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,ReverseDiff.GradientTape{DiffEqSensitivity.var"#77#86"{DiffEqBase.ODEFunction{true,Reservoir.harmonic2Dv_mwe2.var"#du!#22",LinearAlgebra.UniformScaling{Bool},Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing}},Tuple{ReverseDiff.TrackedArray{Float64,Float64,2,Array{Float64,2},Array{Float64,2}},ReverseDiff.TrackedArray{Float64,Float64,1,Array{Float64,1},Array{Float64,1}},ReverseDiff.TrackedArray{Float64,Float64,1,Array{Float64,1},Array{Float64,1}}},Array{ReverseDiff.TrackedReal{Float64,Float64,ReverseDiff.TrackedArray{Float64,Float64,1,Array{Float64,1},Array{Float64,1}}},1}},Nothing,Nothing,Array{Float64,2},Nothing,Base.OneTo{Int64},UnitRange{Int64},LinearAlgebra.UniformScaling{Bool}},DiffEqSensitivity.QuadratureAdjoint{0,true,Val{:central},Bool},Array{Float64,2},DiffEqBase.ODESolution{Float64,3,Array{Array{Float64,2},1},Nothing,Nothing,Array{Float64,1},Array{Array{Array{Float64,2},1},1},DiffEqBase.ODEProblem{Array{Float64,2},Tuple{Float64,Float64},true,Array{Float64,1},DiffEqBase.ODEFunction{true,Reservoir.harmonic2Dv_mwe2.var"#du!#22",LinearAlgebra.UniformScaling{Bool},Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing},Base.Iterators.Pairs{Symbol,Real,Tuple{Symbol,Symbol,Symbol},NamedTuple{(:jac, :abstol, :reltol),Tuple{Bool,Float64,Float64}}},DiffEqBase.StandardODEProblem},OrdinaryDiffEq.Tsit5,OrdinaryDiffEq.InterpolationData{DiffEqBase.ODEFunction{true,Reservoir.harmonic2Dv_mwe2.var"#du!#22",LinearAlgebra.UniformScaling{Bool},Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing},Array{Array{Float64,2},1},Array{Float64,1},Array{Array{Array{Float64,2},1},1},OrdinaryDiffEq.Tsit5Cache{Array{Float64,2},Array{Float64,2},Array{Float64,2},OrdinaryDiffEq.Tsit5ConstantCache{Float64,Float64}}},DiffEqBase.DEStats},DiffEqBase.ODEFunction{true,Reservoir.harmonic2Dv_mwe2.var"#du!#22",LinearAlgebra.UniformScaling{Bool},Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing}},LinearAlgebra.UniformScaling{Bool},Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing},Array{Array{Float64,1},1},Array{Float64,1},Array{Array{Array{Float64,1},1},1},OrdinaryDiffEq.Tsit5Cache{Array{Float64,1},Array{Float64,1},Array{Float64,1},OrdinaryDiffEq.Tsit5ConstantCache{Float64,Float64}}},DiffEqBase.DEStats},DiffEqBase.ODEFunction{true,DiffEqSensitivity.ODEQuadratureAdjointSensitivityFunction{DiffEqSensitivity.AdjointDiffCache{Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,ReverseDiff.GradientTape{DiffEqSensitivity.var"#77#86"{DiffEqBase.ODEFunction{true,Reservoir.harmonic2Dv_mwe2.var"#du!#22",LinearAlgebra.UniformScaling{Bool},Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing}},Tuple{ReverseDiff.TrackedArray{Float64,Float64,2,Array{Float64,2},Array{Float64,2}},ReverseDiff.TrackedArray{Float64,Float64,1,Array{Float64,1},Array{Float64,1}},ReverseDiff.TrackedArray{Float64,Float64,1,Array{Float64,1},Array{Float64,1}}},Array{ReverseDiff.TrackedReal{Float64,Float64,ReverseDiff.TrackedArray{Float64,Float64,1,Array{Float64,1},Array{Float64,1}}},1}},Nothing,Nothing,Array{Float64,2},Nothing,Base.OneTo{Int64},UnitRange{Int64},LinearAlgebra.UniformScaling{Bool}},DiffEqSensitivity.QuadratureAdjoint{0,true,Val{:central},Bool},Array{Float64,2},DiffEqBase.ODESolution{Float64,3,Array{Array{Float64,2},1},Nothing,Nothing,Array{Float64,1},Array{Array{Array{Float64,2},1},1},DiffEqBase.ODEProblem{Array{Float64,2},Tuple{Float64,Float64},true,Array{Float64,1},DiffEqBase.ODEFunction{true,Reservoir.harmonic2Dv_mwe2.var"#du!#22",LinearAlgebra.UniformScaling{Bool},Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing},Base.Iterators.Pairs{Symbol,Real,Tuple{Symbol,Symbol,Symbol},NamedTuple{(:jac, :abstol, :reltol),Tuple{Bool,Float64,Float64}}},DiffEqBase.StandardODEProblem},OrdinaryDiffEq.Tsit5,OrdinaryDiffEq.InterpolationData{DiffEqBase.ODEFunction{true,Reservoir.harmonic2Dv_mwe2.var"#du!#22",LinearAlgebra.UniformScaling{Bool},Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing},Array{Array{Float64,2},1},Array{Float64,1},Array{Array{Array{Float64,2},1},1},OrdinaryDiffEq.Tsit5Cache{Array{Float64,2},Array{Float64,2},Array{Float64,2},OrdinaryDiffEq.Tsit5ConstantCache{Float64,Float64}}},DiffEqBase.DEStats},DiffEqBase.ODEFunction{true,Reservoir.harmonic2Dv_mwe2.var"#du!#22",LinearAlgebra.UniformScaling{Bool},Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing}},LinearAlgebra.UniformScaling{Bool},Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing},OrdinaryDiffEq.Tsit5Cache{Array{Float64,1},Array{Float64,1},Array{Float64,1},OrdinaryDiffEq.Tsit5ConstantCache{Float64,Float64}},OrdinaryDiffEq.DEOptions{Float64,Float64,Float64,Float64,typeof(DiffEqBase.ODE_DEFAULT_NORM),typeof(LinearAlgebra.opnorm),DiffEqBase.CallbackSet{Tuple{},Tuple{DiffEqBase.DiscreteCallback{DiffEqCallbacks.var"#33#36"{Base.RefValue{Union{Nothing, Float64}}},DiffEqCallbacks.var"#34#37"{DiffEqSensitivity.var"#94#96"{Base.RefValue{Int64},Array{Float64,1}},DiffEqSensitivity.var"#95#97"{DiffEqSensitivity.var"#df#132"{Array{Float64,3},Array{Float64,2},Colon},DiffEqSensitivity.QuadratureAdjoint{0,true,Val{:central},Bool},Base.OneTo{Int64},UnitRange{Int64},LinearAlgebra.UniformScaling{Bool},Bool,Nothing,Nothing,Array{Float64,2},Nothing,Bool,Array{Float64,1},Array{Float64,1},Array{Float64,2},Base.RefValue{Int64},Int64,LinearAlgebra.UniformScaling{Bool}},Base.RefValue{Union{Nothing, Float64}}},DiffEqCallbacks.var"#35#38"{typeof(DiffEqBase.INITIALIZE_DEFAULT),Bool,DiffEqSensitivity.var"#94#96"{Base.RefValue{Int64},Array{Float64,1}},Base.RefValue{Union{Nothing, Float64}},DiffEqCallbacks.var"#34#37"{DiffEqSensitivity.var"#94#96"{Base.RefValue{Int64},Array{Float64,1}},DiffEqSensitivity.var"#95#97"{DiffEqSensitivity.var"#df#132"{Array{Float64,3},Array{Float64,2},Colon},DiffEqSensitivity.QuadratureAdjoint{0,true,Val{:central},Bool},Base.OneTo{Int64},UnitRange{Int64},LinearAlgebra.UniformScaling{Bool},Bool,Nothing,Nothing,Array{Float64,2},Nothing,Bool,Array{Float64,1},Array{Float64,1},Array{Float64,2},Base.RefValue{Int64},Int64,LinearAlgebra.UniformScaling{Bool}},Base.RefValue{Union{Nothing, Float64}}}}}}},typeof(DiffEqBase.ODE_DEFAULT_ISOUTOFDOMAIN),typeof(DiffEqBase.ODE_DEFAULT_PROG_MESSAGE),typeof(DiffEqBase.ODE_DEFAULT_UNSTABLE_CHECK),DataStructures.BinaryHeap{Float64,DataStructures.LessThan},DataStructures.BinaryHeap{Float64,DataStructures.LessThan},Nothing,Nothing,Int64,Tuple{},Tuple{},Tuple{}},Array{Float64,1},Float64,Nothing,OrdinaryDiffEq.DefaultInit}, ::OrdinaryDiffEq.Tsit5Cache{Array{Float64,1},Array{Float64,1},Array{Float64,1},OrdinaryDiffEq.Tsit5ConstantCache{Float64,Float64}}) at C:\Users\user.julia\packages\OrdinaryDiffEq\NsugH\src\perform_step\low_order_rk_perform_step.jl:623

[14] __init(::DiffEqBase.ODEProblem{Array{Float64,1},Tuple{Float64,Float64},true,Array{Float64,1},DiffEqBase.ODEFunction{true,DiffEqSensitivity.ODEQuadratureAdjointSensitivityFunction{DiffEqSensitivity.AdjointDiffCache{Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,ReverseDiff.GradientTape{DiffEqSensitivity.var"#77#86"{DiffEqBase.ODEFunction{true,Reservoir.harmonic2Dv_mwe2.var"#du!#22",LinearAlgebra.UniformScaling{Bool},Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing}},Tuple{ReverseDiff.TrackedArray{Float64,Float64,2,Array{Float64,2},Array{Float64,2}},ReverseDiff.TrackedArray{Float64,Float64,1,Array{Float64,1},Array{Float64,1}},ReverseDiff.TrackedArray{Float64,Float64,1,Array{Float64,1},Array{Float64,1}}},Array{ReverseDiff.TrackedReal{Float64,Float64,ReverseDiff.TrackedArray{Float64,Float64,1,Array{Float64,1},Array{Float64,1}}},1}},Nothing,Nothing,Array{Float64,2},Nothing,Base.OneTo{Int64},UnitRange{Int64},LinearAlgebra.UniformScaling{Bool}},DiffEqSensitivity.QuadratureAdjoint{0,true,Val{:central},Bool},Array{Float64,2},DiffEqBase.ODESolution{Float64,3,Array{Array{Float64,2},1},Nothing,Nothing,Array{Float64,1},Array{Array{Array{Float64,2},1},1},DiffEqBase.ODEProblem{Array{Float64,2},Tuple{Float64,Float64},true,Array{Float64,1},DiffEqBase.ODEFunction{true,Reservoir.harmonic2Dv_mwe2.var"#du!#22",LinearAlgebra.UniformScaling{Bool},Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing},Base.Iterators.Pairs{Symbol,Real,Tuple{Symbol,Symbol,Symbol},NamedTuple{(:jac, :abstol, :reltol),Tuple{Bool,Float64,Float64}}},DiffEqBase.StandardODEProblem},OrdinaryDiffEq.Tsit5,OrdinaryDiffEq.InterpolationData{DiffEqBase.ODEFunction{true,Reservoir.harmonic2Dv_mwe2.var"#du!#22",LinearAlgebra.UniformScaling{Bool},Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing},Array{Array{Float64,2},1},Array{Float64,1},Array{Array{Array{Float64,2},1},1},OrdinaryDiffEq.Tsit5Cache{Array{Float64,2},Array{Float64,2},Array{Float64,2},OrdinaryDiffEq.Tsit5ConstantCache{Float64,Float64}}},DiffEqBase.DEStats},DiffEqBase.ODEFunction{true,Reservoir.harmonic2Dv_mwe2.var"#du!#22",LinearAlgebra.UniformScaling{Bool},Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing}},LinearAlgebra.UniformScaling{Bool},Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing},Base.Iterators.Pairs{Symbol,DiffEqBase.CallbackSet{Tuple{},Tuple{DiffEqBase.DiscreteCallback{DiffEqCallbacks.var"#33#36"{Base.RefValue{Union{Nothing, Float64}}},DiffEqCallbacks.var"#34#37"{DiffEqSensitivity.var"#94#96"{Base.RefValue{Int64},Array{Float64,1}},DiffEqSensitivity.var"#95#97"{DiffEqSensitivity.var"#df#132"{Array{Float64,3},Array{Float64,2},Colon},DiffEqSensitivity.QuadratureAdjoint{0,true,Val{:central},Bool},Base.OneTo{Int64},UnitRange{Int64},LinearAlgebra.UniformScaling{Bool},Bool,Nothing,Nothing,Array{Float64,2},Nothing,Bool,Array{Float64,1},Array{Float64,1},Array{Float64,2},Base.RefValue{Int64},Int64,LinearAlgebra.UniformScaling{Bool}},Base.RefValue{Union{Nothing, Float64}}},DiffEqCallbacks.var"#35#38"{typeof(DiffEqBase.INITIALIZE_DEFAULT),Bool,DiffEqSensitivity.var"#94#96"{Base.RefValue{Int64},Array{Float64,1}},Base.RefValue{Union{Nothing, Float64}},DiffEqCallbacks.var"#34#37"{DiffEqSensitivity.var"#94#96"{Base.RefValue{Int64},Array{Float64,1}},DiffEqSensitivity.var"#95#97"{DiffEqSensitivity.var"#df#132"{Array{Float64,3},Array{Float64,2},Colon},DiffEqSensitivity.QuadratureAdjoint{0,true,Val{:central},Bool},Base.OneTo{Int64},UnitRange{Int64},LinearAlgebra.UniformScaling{Bool},Bool,Nothing,Nothing,Array{Float64,2},Nothing,Bool,Array{Float64,1},Array{Float64,1},Array{Float64,2},Base.RefValue{Int64},Int64,LinearAlgebra.UniformScaling{Bool}},Base.RefValue{Union{Nothing, Float64}}}}}}},Tuple{Symbol},NamedTuple{(:callback,),Tuple{DiffEqBase.CallbackSet{Tuple{},Tuple{DiffEqBase.DiscreteCallback{DiffEqCallbacks.var"#33#36"{Base.RefValue{Union{Nothing, Float64}}},DiffEqCallbacks.var"#34#37"{DiffEqSensitivity.var"#94#96"{Base.RefValue{Int64},Array{Float64,1}},DiffEqSensitivity.var"#95#97"{DiffEqSensitivity.var"#df#132"{Array{Float64,3},Array{Float64,2},Colon},DiffEqSensitivity.QuadratureAdjoint{0,true,Val{:central},Bool},Base.OneTo{Int64},UnitRange{Int64},LinearAlgebra.UniformScaling{Bool},Bool,Nothing,Nothing,Array{Float64,2},Nothing,Bool,Array{Float64,1},Array{Float64,1},Array{Float64,2},Base.RefValue{Int64},Int64,LinearAlgebra.UniformScaling{Bool}},Base.RefValue{Union{Nothing, Float64}}},DiffEqCallbacks.var"#35#38"{typeof(DiffEqBase.INITIALIZE_DEFAULT),Bool,DiffEqSensitivity.var"#94#96"{Base.RefValue{Int64},Array{Float64,1}},Base.RefValue{Union{Nothing, Float64}},DiffEqCallbacks.var"#34#37"{DiffEqSensitivity.var"#94#96"{Base.RefValue{Int64},Array{Float64,1}},DiffEqSensitivity.var"#95#97"{DiffEqSensitivity.var"#df#132"{Array{Float64,3},Array{Float64,2},Colon},DiffEqSensitivity.QuadratureAdjoint{0,true,Val{:central},Bool},Base.OneTo{Int64},UnitRange{Int64},LinearAlgebra.UniformScaling{Bool},Bool,Nothing,Nothing,Array{Float64,2},Nothing,Bool,Array{Float64,1},Array{Float64,1},Array{Float64,2},Base.RefValue{Int64},Int64,LinearAlgebra.UniformScaling{Bool}},Base.RefValue{Union{Nothing, Float64}}}}}}}}}},DiffEqBase.StandardODEProblem}, ::OrdinaryDiffEq.Tsit5, ::Tuple{}, ::Tuple{}, ::Tuple{}, ::Type{Val{true}}; saveat::Tuple{}, tstops::Tuple{}, d_discontinuities::Tuple{}, save_idxs::Nothing, save_everystep::Bool, save_on::Bool, save_start::Bool, save_end::Bool, callback::DiffEqBase.CallbackSet{Tuple{},Tuple{DiffEqBase.DiscreteCallback{DiffEqCallbacks.var"#33#36"{Base.RefValue{Union{Nothing, Float64}}},DiffEqCallbacks.var"#34#37"{DiffEqSensitivity.var"#94#96"{Base.RefValue{Int64},Array{Float64,1}},DiffEqSensitivity.var"#95#97"{DiffEqSensitivity.var"#df#132"{Array{Float64,3},Array{Float64,2},Colon},DiffEqSensitivity.QuadratureAdjoint{0,true,Val{:central},Bool},Base.OneTo{Int64},UnitRange{Int64},LinearAlgebra.UniformScaling{Bool},Bool,Nothing,Nothing,Array{Float64,2},Nothing,Bool,Array{Float64,1},Array{Float64,1},Array{Float64,2},Base.RefValue{Int64},Int64,LinearAlgebra.UniformScaling{Bool}},Base.RefValue{Union{Nothing, Float64}}},DiffEqCallbacks.var"#35#38"{typeof(DiffEqBase.INITIALIZE_DEFAULT),Bool,DiffEqSensitivity.var"#94#96"{Base.RefValue{Int64},Array{Float64,1}},Base.RefValue{Union{Nothing, Float64}},DiffEqCallbacks.var"#34#37"{DiffEqSensitivity.var"#94#96"{Base.RefValue{Int64},Array{Float64,1}},DiffEqSensitivity.var"#95#97"{DiffEqSensitivity.var"#df#132"{Array{Float64,3},Array{Float64,2},Colon},DiffEqSensitivity.QuadratureAdjoint{0,true,Val{:central},Bool},Base.OneTo{Int64},UnitRange{Int64},LinearAlgebra.UniformScaling{Bool},Bool,Nothing,Nothing,Array{Float64,2},Nothing,Bool,Array{Float64,1},Array{Float64,1},Array{Float64,2},Base.RefValue{Int64},Int64,LinearAlgebra.UniformScaling{Bool}},Base.RefValue{Union{Nothing, Float64}}}}}}}, dense::Bool, calck::Bool, dt::Float64, dtmin::Nothing, dtmax::Float64, force_dtmin::Bool, adaptive::Bool, gamma::Rational{Int64}, abstol::Float64, reltol::Float64, qmin::Rational{Int64}, qmax::Int64, qsteady_min::Int64, qsteady_max::Int64, qoldinit::Rational{Int64}, fullnormalize::Bool, failfactor::Int64, beta1::Nothing, beta2::Nothing, maxiters::Int64, internalnorm::typeof(DiffEqBase.ODE_DEFAULT_NORM), internalopnorm::typeof(LinearAlgebra.opnorm), isoutofdomain::typeof(DiffEqBase.ODE_DEFAULT_ISOUTOFDOMAIN), unstable_check::typeof(DiffEqBase.ODE_DEFAULT_UNSTABLE_CHECK), verbose::Bool, timeseries_errors::Bool, dense_errors::Bool, advance_to_tstop::Bool, stop_at_next_tstop::Bool, initialize_save::Bool, progress::Bool, progress_steps::Int64, progress_name::String, progress_message::typeof(DiffEqBase.ODE_DEFAULT_PROG_MESSAGE), userdata::Nothing, allow_extrapolation::Bool, initialize_integrator::Bool, alias_u0::Bool, alias_du0::Bool, initializealg::OrdinaryDiffEq.DefaultInit, kwargs::Base.Iterators.Pairs{Symbol,Bool,Tuple{Symbol},NamedTuple{(:jac,),Tuple{Bool}}}) at C:\Users\user.julia\packages\OrdinaryDiffEq\NsugH\src\solve.jl:403