# Differential equations: Vern family solver, lazy option question

**URL:** https://discourse.julialang.org/t/differential-equations-vern-family-solver-lazy-option-question/39865
**Category:** General Usage
**Created:** [May 21, 2020, 2:21am UTC](https://discourse.julialang.org/t/differential-equations-vern-family-solver-lazy-option-question/39865 "2020-05-21T02:21:03Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Egwene\_al\_Vere](https://avatars.discourse-cdn.com/v4/letter/e/df788c/32.png) [@Egwene\_al\_Vere](https://discourse.julialang.org/u/Egwene_al_Vere)
#### Post date: [May 21, 2020, 2:21am UTC](https://discourse.julialang.org/t/differential-equations-vern-family-solver-lazy-option-question/39865/1 "2020-05-21T02:21:03Z")

</div>

For the Verner family solver of `DifferentialEquations.jl`, `Vern6()` through `Vern9()`, it is documented that the interpolation is “lazy” and

> These methods when lazy assume that the parameter vector `p` will be unchanged between the moment of the interval solving and the interpolation. If `p` is changed in a ContinuousCallback, or in a DiscreteCallback and the continuous solution is used after the full solution, then set `lazy=false` .  
> [link](https://docs.sciml.ai/stable/solvers/ode_solve/#Full-List-of-Methods-1)

In my code, I used p to allocate the temporary matrix for things like `mul!` e.g.

```julia
hdim = 10

p = (
     x=zeros(Complex{Float64}, hdim, hdim), 
     y=zeros(Complex{Float64}, hdim, hdim)
)

```

and in the ode problem function, `p.x`, `p.y`, etc is used to hold temporary allocations, pseudo-code:

```julia
function f!(du,u,p,t)

...
mul!(p.x, a, b)
...

...
du .= p.x .+ p.y

end

```

so p changes during calculation (different p before and after `f!` gets called, and different p at different times). However, different input value of p does not change the calculation result since it’s always overwritten inside `f!()` with e.g. `mul!(p.x, a, b)`. In this case, is the `lazy=false` option needed? Thanks a lot!

---

<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: [May 21, 2020, 2:40am UTC](https://discourse.julialang.org/t/differential-equations-vern-family-solver-lazy-option-question/39865/2 "2020-05-21T02:40:53Z")

</div>

> [@Egwene\_al\_Vere](#):
>
> In this case, is the `lazy=false` option needed?

Nope, you’re fine.

---

<div class="post-metadata">

### Author: ![Egwene\_al\_Vere](https://avatars.discourse-cdn.com/v4/letter/e/df788c/32.png) [@Egwene\_al\_Vere](https://discourse.julialang.org/u/Egwene_al_Vere)
#### Post date: [May 21, 2020, 2:44am UTC](https://discourse.julialang.org/t/differential-equations-vern-family-solver-lazy-option-question/39865/3 "2020-05-21T02:44:43Z")

</div>

I thought so. Thanks a lot!
