-
-
Notifications
You must be signed in to change notification settings - Fork 197
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add non-lazy mode #418
add non-lazy mode #418
Conversation
Still need to only non-lazy if adaptivity succeeds |
Fixes #285 |
Visual test case: using OrdinaryDiffEq
using StaticArrays
f(x, p, t) = SVector(x[2], -x[2]-x[1]+p[1]) # x'' + x' + x = ±p₁
h(u, t, integrator) = u[1]-integrator.p[2] # switching surface x = ±p₂;
g(integrator) = (integrator.p .= -integrator.p) # impact map (p₁, p₂) = -(p₁, p₂)
prob = ODEProblem(f, # RHS
SVector(0.0, 1.0), # initial value
(0.0, 100.0), # time interval
MVector(1.0, 1.0)) # parameters
cb = ContinuousCallback(h, g)
sol = solve(prob, DP8(), callback=cb)
plot(sol,vars=(1,2))
sol = solve(prob, BS5(lazy=false), callback=cb);
plot(sol,vars=(1,2))
sol = solve(prob, Vern6(lazy=false), callback=cb);
plot(sol,vars=(1,2))
sol = solve(prob, Vern7(lazy=false), callback=cb);
plot(sol,vars=(1,2))
sol = solve(prob, Vern8(lazy=false), callback=cb);
plot(sol,vars=(1,2))
sol = solve(prob, Vern9(lazy=false), callback=cb);
plot(sol,vars=(1,2)) |
@YingboMa I'll merge this soon. Note the changes to |
Codecov Report
@@ Coverage Diff @@
## master #418 +/- ##
==========================================
+ Coverage 83.32% 83.47% +0.14%
==========================================
Files 78 78
Lines 23258 23462 +204
==========================================
+ Hits 19380 19585 +205
+ Misses 3878 3877 -1
Continue to review full report at Codecov.
|
No description provided.