-
-
Notifications
You must be signed in to change notification settings - Fork 79
Open
Description
The following code gives an unexpected output:
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, true)
for (u,t) in tuples(integrator)
@show u[18], t
end
end
Output:
(u[18], t) = (368.74700170881215, 0.6359999999999999)
(u[18], t) = (368.7470017992227, 0.7719999999999998)
(u[18], t) = (368.7470020404195, 1.0439999999999996)
(u[18], t) = (368.74700225092147, 1.3159999999999994)
(u[18], t) = (368.74700290175184, 1.859999999999999)
(u[18], t) = (368.7470033622797, 2.4039999999999986)
(u[18], t) = (368.74700352032835, 2.5)
I would expect the results at 0.5, 1, 1.5, 2.0 and 2.5 seconds simulation time.
Full example: https://github.com/ufechner7/KiteViewer/blob/sim/src/RTSim_bug.jl
Metadata
Metadata
Assignees
Labels
No labels