# User-defined outputs in DifferentialEquations

**URL:** https://discourse.julialang.org/t/user-defined-outputs-in-differentialequations/20754
**Category:** Modelling & Simulations
**Tags:** diffeq
**Created:** [February 13, 2019, 4:14pm UTC](https://discourse.julialang.org/t/user-defined-outputs-in-differentialequations/20754 "2019-02-13T16:14:02Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![asprionj](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/asprionj/32/6856_2.png) [@asprionj](https://discourse.julialang.org/u/asprionj)
#### Post date: [February 13, 2019, 4:14pm UTC](https://discourse.julialang.org/t/user-defined-outputs-in-differentialequations/20754/1 "2019-02-13T16:14:02Z")

</div>

Hi, is there a possibility to specify outputs that are recorded along the state variables when running a simulation in DifferentialEquations? I could not find anything relating to this in the documentation…

Of course, I can always re-calculate everything from the state-variable traces, but that may be quite some overhead and just is not very handy.

---

<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: [February 13, 2019, 4:18pm UTC](https://discourse.julialang.org/t/user-defined-outputs-in-differentialequations/20754/2 "2019-02-13T16:18:42Z")

</div>

What you’re looking for is explicit algebraic variables, and we don’t have that yet other than via taking control with `SavingCallback`. You can add to the discussion here: [Convenience feature: Include algebraic variables in result · Issue #332 · SciML/DifferentialEquations.jl · GitHub](https://github.com/JuliaDiffEq/DifferentialEquations.jl/issues/332) .

> [@asprionj](#):
>
> but that may be quite some overhead and just is not very handy.

It might not be a clean solution, but the overhead should be minimal, if there is any. The majority of the derivatives are not calculated at end points, so I’m not sure you’d benefit much at all from a built-in solution, other than in terms of code cleanliness.

---

<div class="post-metadata">

### Author: ![mauro3](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mauro3/32/292_2.png) [@mauro3](https://discourse.julialang.org/u/mauro3)
#### Post date: [February 13, 2019, 4:27pm UTC](https://discourse.julialang.org/t/user-defined-outputs-in-differentialequations/20754/3 "2019-02-13T16:27:46Z")

</div>

Could DEDataArrays also be used [http://docs.juliadiffeq.org/latest/features/diffeq\_arrays.html#DEDataArrays-1](http://docs.juliadiffeq.org/latest/features/diffeq_arrays.html#DEDataArrays-1)?

---

<div class="post-metadata">

### Author: ![asprionj](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/asprionj/32/6856_2.png) [@asprionj](https://discourse.julialang.org/u/asprionj)
#### Post date: [February 13, 2019, 4:34pm UTC](https://discourse.julialang.org/t/user-defined-outputs-in-differentialequations/20754/4 "2019-02-13T16:34:54Z")

</div>

Thanks! So I probably was not searching for the right terms 😉  
I’ll read through the discussion you mentioned…
