# OrdinaryDiffEq.jl Buffer for Past Values Through Previous Iterations

**URL:** https://discourse.julialang.org/t/ordinarydiffeq-jl-buffer-for-past-values-through-previous-iterations/101641
**Category:** Modelling & Simulations
**Tags:** question
**Created:** [July 15, 2023, 12:16am UTC](https://discourse.julialang.org/t/ordinarydiffeq-jl-buffer-for-past-values-through-previous-iterations/101641 "2023-07-15T00:16:12Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![mwu](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mwu/32/51429_2.png) [@mwu](https://discourse.julialang.org/u/mwu)
#### Post date: [July 15, 2023, 12:16am UTC](https://discourse.julialang.org/t/ordinarydiffeq-jl-buffer-for-past-values-through-previous-iterations/101641/1 "2023-07-15T00:16:12Z")

</div>

I have an ODE system from OrdinaryDiffEq.jl. I want to model a digital filter that needs to know the past 7 values of a particular variable. Essentially, I want a buffer of sorts to keep track of the value of this variable through previous iterations of the solver. Currently, I have implemented a sort of sliding window in the canonical variables u where I manually shift over the current values in the array to the left and add the new value at the end.

```julia
for i in 1:6
    u[i - 1] = u[i]
end 
u[6] = value

```

Is there anything built into to DifferentialEquations.jl or Julia that handles this kind of functionality that I’m looking for? Any advice or suggestions is much appreciated.

---

<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: [July 15, 2023, 2:33am UTC](https://discourse.julialang.org/t/ordinarydiffeq-jl-buffer-for-past-values-through-previous-iterations/101641/2 "2023-07-15T02:33:39Z")

</div>

What you’re describing is a delay differential equation.
