You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello I was playing around with the DDE solver on some equations and consistently Dopri5 doesn't integrate properly.
MWE :
using DifferentialEquations
using DelimitedFiles
using PyPlot
using Metrics
# Basic check 1 =========================================functionbasic_check_1(du, u, h, p, t)
tau = p
hist1 =h(p, t - tau)[1]
du[1] = u[1] * (1- hist1)
endh(p, t) =1.2*ones(1)
u0 = [1.2]
tau =1.0
lags = [tau]
p = (tau)
tspan = (0.0, 20.0)
prob =DDEProblem(basic_check_1, u0, h, tspan, p; constant_lags=lags)
alg =MethodOfSteps(Tsit5()) # doesn't work with DP5 DP8 but works with Tsit5 and Bosh3
sol =solve(prob, alg, saveat=0.1)
usol =transpose(hcat(sol.u...))
time = sol.t
alg2 =MethodOfSteps(DP5()) # doesn't work with DP5 DP8 but works with Tsit5 and Bosh3
sol2 =solve(prob, alg2, saveat=0.1)
usol2 =transpose(hcat(sol2.u...))
alg3 =MethodOfSteps(BS3()) # doesn't work with DP5 DP8 but works with Tsit5 and Bosh3
sol3 =solve(prob, alg3, saveat=0.1)
usol3 =transpose(hcat(sol3.u...))
plot(sol.t, usol, linestyle="dashed", label="Tsit5")
plot(sol.t, usol2, linestyle="dashdot", label="Dopri5")
plot(sol.t, usol3, linestyle="dotted", label="Bosh3")
plt.title("x' = x * (1 - x(t-1))")
plt.legend()
plt.xlabel("Time")
# plt.savefig("exp1.png")
plt.show()
plt.close()
I haven't checked the source code but I would guess that it comes from the Butcher tableau if an ODE example with Dopri5 doesn't work (I didn't check)
The text was updated successfully, but these errors were encountered:
Hello I was playing around with the DDE solver on some equations and consistently Dopri5 doesn't integrate properly.
MWE :
I haven't checked the source code but I would guess that it comes from the Butcher tableau if an ODE example with Dopri5 doesn't work (I didn't check)
The text was updated successfully, but these errors were encountered: