Sorry about that. Here is my example again. The reason that my arrays are size 4 is because this is a MWE. So StaticArrays are not really appropriate in this case. Notice that u0
is formed from two arrays since this is more representative of the actual problem I am working with. In the meantime, I have concatenated the two arrays into one long array and am using views.
using DifferentialEquations
using SimpleDiffEq
# Use commas to avoid printing in Atom when writing code
S0 = Array{Float64,1}(undef, 4);
I0 = Array{Float64,1}(undef, 4);
fill!(S0, 4);
fill!(I0, 4);
function households!(du,u,p,t)
(S,I) = u
(βG) = p
infections = βG * sum(S) .+ βG .* I
du[1] = -infections .* S
nothing
end; # no output due to semi-colon
tspan = (0.,5.)
u0 = [S0, I0]
params = [0.5]
prob_ode = ODEProblem(households!,u0,tspan,params);
sol_ode = solve(prob_ode, Tsit5());
Here is the complete error trace:
MethodError: no method matching zero(::Type{Array{Float64,1}})
Closest candidates are:
zero(!Matched::Type{Missing}) at missing.jl:103
zero(!Matched::Type{LibGit2.GitHash}) at /Users/sabae/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.4/LibGit2/src/oid.jl:220
zero(!Matched::Type{Pkg.Resolve.VersionWeight}) at /Users/sabae/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.4/Pkg/src/Resolve/versionweights.jl:15
...
zero(::Array{Array{Float64,1},1}) at abstractarray.jl:902
alg_cache(::Tsit5, ::Array{Array{Float64,1},1}, ::Array{Array{Float64,1},1}, ::Type{T} where T, ::Type{T} where T, ::Type{T} where T, ::Array{Array{Float64,1},1}, ::Array{Array{Float64,1},1}, ::ODEFunction{true,typeof(households!),LinearAlgebra.UniformScaling{Bool},Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing}, ::Float64, ::Float64, ::Float64, ::Array{Float64,1}, ::Bool, ::Val{true}) at low_order_rk_caches.jl:349
__init(::ODEProblem{Array{Array{Float64,1},1},Tuple{Float64,Float64},true,Array{Float64,1},ODEFunction{true,typeof(households!),LinearAlgebra.UniformScaling{Bool},Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing},Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}},DiffEqBase.StandardODEProblem}, ::Tsit5, ::Array{Array{Array{Float64,1},1},1}, ::Array{Float64,1}, ::Array{Any,1}, ::Type{Val{true}}; saveat::Array{Float64,1}, tstops::Array{Float64,1}, d_discontinuities::Array{Float64,1}, save_idxs::Nothing, save_everystep::Bool, save_on::Bool, save_start::Bool, save_end::Bool, callback::Nothing, dense::Bool, calck::Bool, dt::Float64, dtmin::Nothing, dtmax::Float64, force_dtmin::Bool, adaptive::Bool, gamma::Rational{Int64}, abstol::Nothing, reltol::Nothing, 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{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}) at solve.jl:270
__init(::ODEProblem{Array{Array{Float64,1},1},Tuple{Float64,Float64},true,Array{Float64,1},ODEFunction{true,typeof(households!),LinearAlgebra.UniformScaling{Bool},Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing},Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}},DiffEqBase.StandardODEProblem}, ::Tsit5, ::Array{Array{Array{Float64,1},1},1}, ::Array{Float64,1}, ::Array{Any,1}, ::Type{Val{true}}) at solve.jl:67
__init(::ODEProblem{Array{Array{Float64,1},1},Tuple{Float64,Float64},true,Array{Float64,1},ODEFunction{true,typeof(households!),LinearAlgebra.UniformScaling{Bool},Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing},Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}},DiffEqBase.StandardODEProblem}, ::Tsit5, ::Array{Array{Array{Float64,1},1},1}, ::Array{Float64,1}, ::Array{Any,1}) at solve.jl:67
__init(::ODEProblem{Array{Array{Float64,1},1},Tuple{Float64,Float64},true,Array{Float64,1},ODEFunction{true,typeof(households!),LinearAlgebra.UniformScaling{Bool},Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing},Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}},DiffEqBase.StandardODEProblem}, ::Tsit5, ::Array{Array{Array{Float64,1},1},1}, ::Array{Float64,1}) at solve.jl:67
__init(::ODEProblem{Array{Array{Float64,1},1},Tuple{Float64,Float64},true,Array{Float64,1},ODEFunction{true,typeof(households!),LinearAlgebra.UniformScaling{Bool},Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing},Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}},DiffEqBase.StandardODEProblem}, ::Tsit5, ::Array{Array{Array{Float64,1},1},1}) at solve.jl:67
__init(::ODEProblem{Array{Array{Float64,1},1},Tuple{Float64,Float64},true,Array{Float64,1},ODEFunction{true,typeof(households!),LinearAlgebra.UniformScaling{Bool},Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing},Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}},DiffEqBase.StandardODEProblem}, ::Tsit5) at solve.jl:67
__solve(::ODEProblem{Array{Array{Float64,1},1},Tuple{Float64,Float64},true,Array{Float...