I used DifferentialEquations.jl to solve a DAE in 2017-2018 or so. I just tried to re-run the Jupyter notebook, and now I get an error message… Here is the essence of my past set-up:
function seborg_is(err,dxdt,x,par,t)
...
end
The model has 45 variables (differential + algebraic). I have defined initial values dxdt0
and x0
that used to work. I have defined a parameter vector par_is
. Then I do:
# Specifying differential variables
diff_vars = fill(false,45)
diff_vars[1:4] = true
# Time span
tspan = (0.,10.)
# Problem definition
probis = DAEProblem(seborg_is,dxdt0,x0,tspan,par_is,differential_vars=diff_vars)
Here, the 5th argument (par_is
) is the parameter vector meant to be used in function seborg_is
. The current documentation doesn’t really say whether I’m allowed to specify the parameter vector like this – this used to work, but may have changed??
When I specify the DAE problem probis
, I get the following error message:
MethodError: no method matching setindex_shape_check(::Bool, ::Int64)
Closest candidates are:
setindex_shape_check(!Matched::AbstractArray{#s75,1} where #s75, ::Integer) at indices.jl:218
setindex_shape_check(!Matched::AbstractArray{#s75,1} where #s75, ::Integer, !Matched::Integer) at indices.jl:221
setindex_shape_check(!Matched::AbstractArray{#s75,2} where #s75, ::Integer, !Matched::Integer) at indices.jl:225
...
Stacktrace:
[1] macro expansion at .\multidimensional.jl:722 [inlined]
[2] _unsafe_setindex!(::IndexLinear, ::Array{Bool,1}, ::Bool, ::UnitRange{Int64}) at .\multidimensional.jl:717
[3] _setindex! at .\multidimensional.jl:712 [inlined]
[4] setindex!(::Array{Bool,1}, ::Bool, ::UnitRange{Int64}) at .\abstractarray.jl:1074
[5] top-level scope at In[47]:3
Questions:
- What has changed?
- How can I modify my code?