# Does composite algorithm work with Sundials? I get an error

**URL:** <https://discourse.julialang.org/t/does-composite-algorithm-work-with-sundials-i-get-an-error/74990>\
**Category:** New to Julia\
**Tags:** question\
**Created:** [January 21, 2022, 3:24pm UTC](https://discourse.julialang.org/t/does-composite-algorithm-work-with-sundials-i-get-an-error/74990 "2022-01-21T15:24:15Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Shashank](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/shashank/32/12323_2.png) [@Shashank](https://discourse.julialang.org/u/Shashank)\
**Post date:** [January 21, 2022, 3:24pm UTC](https://discourse.julialang.org/t/does-composite-algorithm-work-with-sundials-i-get-an-error/74990/1 "2022-01-21T15:24:15Z")

</div>

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?

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

```

---

<div class="post-metadata">

**Author:** ![ChrisRackauckas](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chrisrackauckas/32/77_2.png) [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)\
**Post date:** [January 21, 2022, 3:33pm UTC](https://discourse.julialang.org/t/does-composite-algorithm-work-with-sundials-i-get-an-error/74990/2 "2022-01-21T15:33:49Z")

</div>

> [Does composite algorithm work with Sundials?](https://discourse.julialang.org/t/does-composite-algorithm-work-with-sundials-i-get-an-error/74990)

It does not. The documentation mentions it’s part of the OrdinaryDiffEq.jl set of methods.

---

<div class="post-metadata">

**Author:** ![Shashank](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/shashank/32/12323_2.png) [@Shashank](https://discourse.julialang.org/u/Shashank)\
**Post date:** [January 21, 2022, 3:35pm UTC](https://discourse.julialang.org/t/does-composite-algorithm-work-with-sundials-i-get-an-error/74990/3 "2022-01-21T15:35:48Z")

</div>

Sorry, I did not know that. Thanks for the prompt reply.
