# How to access optional input functions in sundials.jl IDA solver

**URL:** <https://discourse.julialang.org/t/how-to-access-optional-input-functions-in-sundials-jl-ida-solver/109862>\
**Category:** Modelling & Simulations\
**Tags:** question\
**Created:** [February 7, 2024, 10:33am UTC](https://discourse.julialang.org/t/how-to-access-optional-input-functions-in-sundials-jl-ida-solver/109862 "2024-02-07T10:33:48Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Aniket\_Patra](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/aniket_patra/32/206837_2.png) [@Aniket\_Patra](https://discourse.julialang.org/u/Aniket_Patra)\
**Post date:** [February 7, 2024, 10:33am UTC](https://discourse.julialang.org/t/how-to-access-optional-input-functions-in-sundials-jl-ida-solver/109862/1 "2024-02-07T10:33:48Z")

</div>

Hello!

I am using IDA to solve a system of stiff differential equations. I know that this particular system of equations is singular. However, I am trying to understand the singularity better.

It seems that at some point the adaptive time step (h in IDA) is going to zero. I would like to make `dtmin = 0.01`. When I tried to use `dtmin = 0.01` and `force_dtmin = true` together, I got an error message: `The dtmin argument is ignored by IDA...`

Finally, I receive the error message `[IDAS ERROR] IDASolve At t = 0.116722 and h = 1.85659e-07, the corrector convergence failed repeatedly or with |h| = hmin.`

In the Sundials manual, I saw that IDA allows the user to provide various input functions. For example, there is this main solver optional input function called [`IDASetMinStep()`](https://sundials.readthedocs.io/en/latest/ida/Usage/index.html#c.IDASetMinStep). This takes the default value zero. How can I change this (say, for example, I want to make it 1e-2)?

A more general question would be: How can I pass other input functions from the Sundials manual (other than the ones supported by Sundials.jl – e.g., max\_order, max\_error\_test\_failures etcetra) to IDA()?

---

<div class="post-metadata">

**Author:** ![Oscar\_Smith](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/oscar_smith/32/25343_2.png) [@Oscar\_Smith](https://discourse.julialang.org/u/Oscar_Smith)\
**Post date:** [February 7, 2024, 2:44pm UTC](https://discourse.julialang.org/t/how-to-access-optional-input-functions-in-sundials-jl-ida-solver/109862/2 "2024-02-07T14:44:44Z")

</div>

It appears the reason Sundials.jl doesn’t support dtmin is that it didn’t exist until pretty recently (Sundials 6.2). Hooking it up now that it exists should be pretty easy.

---

<div class="post-metadata">

**Author:** ![Aniket\_Patra](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/aniket_patra/32/206837_2.png) [@Aniket\_Patra](https://discourse.julialang.org/u/Aniket_Patra)\
**Post date:** [February 7, 2024, 3:13pm UTC](https://discourse.julialang.org/t/how-to-access-optional-input-functions-in-sundials-jl-ida-solver/109862/3 "2024-02-07T15:13:38Z")

</div>

Thanks Oscar!

Is there a way for me to make the change right away, or do I have to wait until the Sundials.jl package is updated?

---

<div class="post-metadata">

**Author:** ![Oscar\_Smith](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/oscar_smith/32/25343_2.png) [@Oscar\_Smith](https://discourse.julialang.org/u/Oscar_Smith)\
**Post date:** [February 7, 2024, 4:14pm UTC](https://discourse.julialang.org/t/how-to-access-optional-input-functions-in-sundials-jl-ida-solver/109862/4 "2024-02-07T16:14:18Z")

</div>

Step one is Sundials.jl needs to support Sundials 6 (see [[WIP] Refreshing the wrappers for Sundials 6.6 by ViralBShah · Pull Request #415 · SciML/Sundials.jl · GitHub](https://github.com/SciML/Sundials.jl/pull/415))

---

<div class="post-metadata">

**Author:** ![Aniket\_Patra](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/aniket_patra/32/206837_2.png) [@Aniket\_Patra](https://discourse.julialang.org/u/Aniket_Patra)\
**Post date:** [February 8, 2024, 12:10pm UTC](https://discourse.julialang.org/t/how-to-access-optional-input-functions-in-sundials-jl-ida-solver/109862/5 "2024-02-08T12:10:07Z")

</div>

Thanks very much again for the information.

Inside IDA(), I decreased max\_order, max\_error\_test\_failures, max\_nonlinear\_iters, and max\_convergence\_failures from their default values. This has seemed to have done the trick for now, I think…
