Ok, I tried:
differential_vars = ones(Bool, 36)
solver = IDA(linear_solver=:Dense)
dt = 0.5
t_start = 0.0
t_end = 5*dt
tspan = (t_start, t_end)
prob = DAEProblem(residual!, yd0, y0, tspan, differential_vars=differential_vars)
integrator = init(prob, solver, abstol=0.000001, reltol=0.001)
for i in 1:5
step!(integrator, dt, stop_at_tdt=true)
for (u,t) in tuples(integrator)
@show u[18], t
end
end
But the parameter stop_at_tdt is not accepted:
julia> include("src/RTSim.jl")
[728.4833579505422, 734.950422647022, 741.5051811137938, 748.1406855648668, 754.8497626818295, 761.6991795961667]
ERROR: LoadError: MethodError: no method matching step!(::Sundials.IDAIntegrator{Vector{Float64}, Vector{Float64}, SciMLBase.NullParameters, Sundials.Handle{Sundials.IDAMem}, DAESolution{Float64, 2, Vector{MVector{36, Float64}}, Nothing, Nothing, Nothing, Vector{Float64}, DAEProblem{MVector{36, Float64}, MVector{36, Float64}, Tuple{Float64, Float64}, true, SciMLBase.NullParameters, DAEFunction{true, typeof(residual!), Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing}, Base.Iterators.Pairs{Union{}, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, Vector{Bool}}, IDA{:Dense, Nothing, Nothing}, SciMLBase.HermiteInterpolation{Vector{Float64}, Vector{MVector{36, Float64}}, Vector{MVector{36, Float64}}}, DiffEqBase.DEStats}, IDA{:Dense, Nothing, Nothing}, Sundials.var"#104#108"{DAEProblem{MVector{36, Float64}, MVector{36, Float64}, Tuple{Float64, Float64}, true, SciMLBase.NullParameters, DAEFunction{true, typeof(residual!), Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing}, Base.Iterators.Pairs{Union{}, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, Vector{Bool}}, Tuple{Int64}, Tuple{Int64}}, Sundials.FunJac{Sundials.var"#104#108"{DAEProblem{MVector{36, Float64}, MVector{36, Float64}, Tuple{Float64, Float64}, true, SciMLBase.NullParameters, DAEFunction{true, typeof(residual!), Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing}, Base.Iterators.Pairs{Union{}, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, Vector{Bool}}, Tuple{Int64}, Tuple{Int64}}, Nothing, Nothing, SciMLBase.NullParameters, Nothing, Nothing, MVector{36, Float64}, Vector{Float64}, Nothing, Nothing}, Nothing, Sundials.DEOptions{DataStructures.BinaryMinHeap{Float64}, DataStructures.BinaryMinHeap{Float64}, CallbackSet{Tuple{}, Tuple{}}, Float64, Float64, typeof(DiffEqBase.ODE_DEFAULT_PROG_MESSAGE)}, Vector{Float64}, Tuple{Int64}, Tuple{Int64}, MVector{36, Float64}, Sundials.LinSolHandle{Sundials.Dense}, Sundials.MatrixHandle{Sundials.DenseMatrix}, Nothing}, ::Float64; stop_at_tdt=true)
Closest candidates are:
step!(::SciMLBase.DEIntegrator, ::Any) at /home/ufechner/.julia/packages/SciMLBase/Z1NtH/src/integrator_interface.jl:576 got unsupported keyword argument "stop_at_tdt"
step!(::SciMLBase.DEIntegrator, ::Any, ::Any) at /home/ufechner/.julia/packages/SciMLBase/Z1NtH/src/integrator_interface.jl:576 got unsupported keyword argument "stop_at_tdt"
step!(::Sundials.AbstractSundialsIntegrator) at /home/ufechner/.julia/packages/Sundials/vDmSJ/src/common_interface/integrator_types.jl:236 got unsupported keyword argument "stop_at_tdt"
...
Stacktrace:
[1] top-level scope
You can find the complete code here: KiteViewer/RTSim.jl at sim · ufechner7/KiteViewer · GitHub
Any idea?