# Rodas5 and ModelingToolkit much slower than Sundials' IDA on large systems

**URL:** <https://discourse.julialang.org/t/rodas5-and-modelingtoolkit-much-slower-than-sundials-ida-on-large-systems/60712>\
**Category:** Modelling & Simulations\
**Tags:** modelingtoolkit\
**Created:** [May 7, 2021, 1:15pm UTC](https://discourse.julialang.org/t/rodas5-and-modelingtoolkit-much-slower-than-sundials-ida-on-large-systems/60712 "2021-05-07T13:15:33Z")\
**Posts on this page:** 1\
**Showing post:** 7

<div class="post-metadata">

**Author:** ![bmetherall](https://avatars.discourse-cdn.com/v4/letter/b/b38774/32.png) [@bmetherall](https://discourse.julialang.org/u/bmetherall)\
**Post date:** [May 10, 2021, 5:56pm UTC](https://discourse.julialang.org/t/rodas5-and-modelingtoolkit-much-slower-than-sundials-ida-on-large-systems/60712/7 "2021-05-10T17:56:24Z")

</div>

Thanks

> [@ChrisRackauckas](#):
>
> Follow the MTK tutorials.
> 
> [https://mtk.sciml.ai/dev/tutorials/ode\_modeling/#Symbolic-and-sparse-derivatives-1](https://mtk.sciml.ai/dev/tutorials/ode_modeling/#Symbolic-and-sparse-derivatives-1)
> 
> `jac=true,sparse=true` creates the sparse form, and the sparsity detection is so quick that giving the sparsity pattern wouldn’t help. But if you don’t do `sparse=true` , it’ll create the dense Jacobian in the naïve way which won’t scale well.

Does this work with DAEs and Sundials? If I do

```julia
	prob = DAEProblem(model!, dICs, ICs, tspan, params, differential_vars = differential_vars; jac = true, sparse = true)
	@time sol = solve(prob, IDA(linear_solver = :KLU), reltol = 1e-10, abstol = 1e-6)

```

I get `ERROR: LoadError: MethodError: no method matching nonzeros(::Nothing)`; it looks like the Jacobian and/or the sparsity aren’t actually being added to the problem and used. If I use the default solver, adding `jac = true, sparse = true` doesn’t change the timing, or allocations.

---

_[View the full topic](https://discourse.julialang.org/t/rodas5-and-modelingtoolkit-much-slower-than-sundials-ida-on-large-systems/60712)._
