# \*Cache and \*ConstantCache versions of ODE solvers. What is the difference?

**URL:** <https://discourse.julialang.org/t/cache-and-constantcache-versions-of-ode-solvers-what-is-the-difference/69810>\
**Category:** Numerics\
**Created:** [October 15, 2021, 8:10am UTC](https://discourse.julialang.org/t/cache-and-constantcache-versions-of-ode-solvers-what-is-the-difference/69810 "2021-10-15T08:10:44Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Andrey](https://avatars.discourse-cdn.com/v4/letter/a/73ab20/32.png) [@Andrey](https://discourse.julialang.org/u/Andrey)\
**Post date:** [October 15, 2021, 8:10am UTC](https://discourse.julialang.org/t/cache-and-constantcache-versions-of-ode-solvers-what-is-the-difference/69810/1 "2021-10-15T08:10:44Z")

</div>

I was going through Rodas4 solver source code and found that there are 2 different implementations of this solver - _Rodas4Cache_ and _Rodas4ConstantCache_. Is there any principal difference between these 2 variants?

It looks that for _Rodas4ConstantCache_ (ODE case) the _tgrad_ argument appears to be unused. Whereas for _Rodas4Cache_ (DAE case which can be represented by ODE in mass matrix form) _tgrad_ is called inside function _calc\_tderivative_ which in turn is called by function _calc\_rosenbrock\_differentiation_. There is selective use of _tgrad_ argument. Was it designed to be like that? Could be that i am getting it wrong.

Will apprecate your input. @ChrisRackauckas

---

<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:** [October 16, 2021, 1:30pm UTC](https://discourse.julialang.org/t/cache-and-constantcache-versions-of-ode-solvers-what-is-the-difference/69810/2 "2021-10-16T13:30:34Z")

</div>

The cache versions are mutating and have all of the arrays cached in there, the non-cached versions are non-mutating and thus don’t cache anything. The non-cached versions should probably make use of tgrad, that’s worth adding. But the cached versions are usually more performance crucial anyways.
