Skip to content
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

Merged
merged 10 commits into from
Jul 7, 2018
Merged

add non-lazy mode #418

merged 10 commits into from
Jul 7, 2018

Conversation

ChrisRackauckas
Copy link
Member

No description provided.

@ChrisRackauckas
Copy link
Member Author

Still need to only non-lazy if adaptivity succeeds

@ChrisRackauckas
Copy link
Member Author

Fixes #285

@ChrisRackauckas
Copy link
Member Author

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))

@ChrisRackauckas
Copy link
Member Author

@YingboMa I'll merge this soon. Note the changes to addsteps removes the value-types entirely. This works well on v0.7 anyways because of constant propogation of the bools. But this will need to be considered in the rebase (i.e. accept the changes here since the depwarn fix is nullified by the types no longer existing)

@coveralls
Copy link

coveralls commented Jul 6, 2018

Coverage Status

Coverage decreased (-1.1%) to 74.301% when pulling d3bf319 on lazy6 into 2207147 on master.

@codecov
Copy link

codecov bot commented Jul 6, 2018

Codecov Report

Merging #418 into master will increase coverage by 0.14%.
The diff coverage is 100%.

Impacted file tree graph

@@            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
Impacted Files Coverage Δ
src/dense/stiff_addsteps.jl 87.76% <100%> (ø) ⬆️
src/dense/high_order_rk_addsteps.jl 100% <100%> (ø) ⬆️
src/perform_step/low_order_rk_perform_step.jl 100% <100%> (ø) ⬆️
src/algorithms.jl 97.76% <100%> (ø) ⬆️
src/dense/generic_dense.jl 66.15% <100%> (ø) ⬆️
src/perform_step/verner_rk_perform_step.jl 100% <100%> (ø) ⬆️
src/dense/verner_addsteps.jl 100% <100%> (ø) ⬆️
src/dense/low_order_rk_addsteps.jl 99.39% <100%> (ø) ⬆️
src/integrators/integrator_interface.jl 75.91% <100%> (+0.53%) ⬆️
src/alg_utils.jl 87.22% <0%> (+0.36%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2207147...d3bf319. Read the comment docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants