Skip to content

Commit

Permalink
don't use Rosenbrock23 with mass matrix
Browse files Browse the repository at this point in the history
  • Loading branch information
oscardssmith committed Dec 4, 2024
1 parent cf13a4f commit 51cf004
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/OrdinaryDiffEqDefault/src/default_alg.jl
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ function stiffchoice(reltol, len, mass_matrix)
elseif len > SMALLSIZE
DefaultSolverChoice.FBDF
else
if reltol < LOW_TOL || !isdiag(mass_matrix)
if reltol < LOW_TOL || mass_matrix != I
DefaultSolverChoice.Rodas5P
else
DefaultSolverChoice.Rosenbrock23
Expand Down
2 changes: 1 addition & 1 deletion lib/OrdinaryDiffEqDefault/test/default_solver_tests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ end
f = ODEFunction(rober_mm, mass_matrix = [1 0 0; 0 1 0; 0 0 0])
prob_rober_mm = ODEProblem(f, [1.0, 0.0, 1.0], (0.0, 1e5), (0.04, 3e7, 1e4))
sol = solve(prob_rober_mm)
@test all(isequal(3), sol.alg_choice)
@test all(isequal(4), sol.alg_choice)
@test sol(0.5) isa Vector{Float64} # test dense output

# test callback on ConstantCache (https://github.com/SciML/OrdinaryDiffEq.jl/issues/2287)
Expand Down

0 comments on commit 51cf004

Please sign in to comment.