I am trying to solve a set of differential equations and I want to change the algorithm at a certain point in time. I could do it between Tsit5 and Vern7 as described in Julia documentation (commented line in the code below works). But when I try to run it with two Sundial algorithms I get an error that says:
ERROR: LoadError: MethodError: no method matching qmin_default(::ARKODE{:Newton, :Dense, :Dense, Sundials.Explicit, Nothing, Int32, Nothing, Nothing})
Is there a workaround for this error, or is it not possible to use composite algorithms when working with Sundial?
reltolp=1e-10
abstolp=1e-10
function choice_function(integrator)
choice = (Int(integrator.t>1e-8) + 1)
if(choice == 2)
reltolp=1e-6
abstolp=1e-6
end
return choice
end
#alg_switch = CompositeAlgorithm((Tsit5(),Vern7()),choice_function)
alg_switch = CompositeAlgorithm((ARKODE(Sundials.Explicit(),etable = Sundials.DORMAND_PRINCE_7_4_5),CVODE_Adams(linear_solver=:GMRES,krylov_dim=10)),choice_function)
sol = solve(prob,alg_switch,reltol=reltolp,abstol=abstolp,saveat=1e-8)