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

Use Wfact when it is available #847

Merged
merged 4 commits into from Jul 31, 2019
Merged

Use Wfact when it is available #847

merged 4 commits into from Jul 31, 2019

Conversation

YingboMa
Copy link
Member

This PR depends on SciML/DiffEqBase.jl#303

@YingboMa
Copy link
Member Author

using OrdinaryDiffEq, ModelingToolkit, Test
function lotka(du,u,p,t)
  x = u[1]
  y = u[2]
  du[1] = p[1]*x - p[2]*x*y
  du[2] = -p[3]*y + p[4]*x*y
end

prob = ODEProblem(lotka,[1.0,1.0],(0.0,1.0),[1.5,1.0,3.0,1.0])
de = ModelingToolkit.modelingtoolkitize(prob)
prob2 = remake(prob, f=ODEFunction(de..., Val(false), Wfact=true))

sol = solve(prob, KenCarp4())

@test Array( solve(prob2, Rodas5()) )  Array( solve(prob, Rodas5()) )
@test Array( solve(prob2, KenCarp4(), tstops=sol.t, adaptive=false) )  Array( solve(prob, KenCarp4(), tstops=sol.t, adaptive=false) )
julia> @test Array( solve(prob2, Rodas5()) )  Array( solve(prob, Rodas5()) )
Test Passed

julia> @test Array( solve(prob2, KenCarp4(), tstops=sol.t, adaptive=false) )  Array( solve(prob, KenCarp4(), tstops=sol.t, adaptive=false) )
Test Passed

@codecov
Copy link

codecov bot commented Jul 31, 2019

Codecov Report

Merging #847 into master will decrease coverage by 1.19%.
The diff coverage is 20%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master     #847     +/-   ##
=========================================
- Coverage   80.35%   79.15%   -1.2%     
=========================================
  Files          90       90             
  Lines       29846    29849      +3     
=========================================
- Hits        23982    23628    -354     
- Misses       5864     6221    +357
Impacted Files Coverage Δ
src/derivative_utils.jl 55.03% <20%> (-20.94%) ⬇️
src/perform_step/composite_perform_step.jl 30.43% <0%> (-47.83%) ⬇️
src/composite_algs.jl 60% <0%> (-36%) ⬇️
src/composite_solution.jl 23.8% <0%> (-33.34%) ⬇️
src/derivative_wrappers.jl 56.6% <0%> (-13.21%) ⬇️
src/caches/basic_caches.jl 74.07% <0%> (-8.69%) ⬇️
src/cache_utils.jl 8.33% <0%> (-8.34%) ⬇️
src/perform_step/fixed_timestep_perform_step.jl 89.74% <0%> (-7.98%) ⬇️
src/perform_step/rosenbrock_perform_step.jl 90.68% <0%> (-7.97%) ⬇️
... and 20 more

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 2749f37...05dc945. Read the comment docs.

@coveralls
Copy link

coveralls commented Jul 31, 2019

Coverage Status

Coverage increased (+9.9%) to 88.124% when pulling 05dc945 on myb/Wfact into 2749f37 on master.

@ChrisRackauckas
Copy link
Member

Waiting on JuliaNLSolvers/NLsolve.jl#220 I think.

@ChrisRackauckas ChrisRackauckas merged commit 5c26d3b into master Jul 31, 2019
@ChrisRackauckas ChrisRackauckas deleted the myb/Wfact branch July 31, 2019 21:48
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

3 participants