# DifferentialEquations - Derivatives in ODE function/ nesting AD

**URL:** <https://discourse.julialang.org/t/differentialequations-derivatives-in-ode-function-nesting-ad/50100>\
**Category:** Machine Learning\
**Tags:** differentiation\
**Created:** [November 13, 2020, 5:33pm UTC](https://discourse.julialang.org/t/differentialequations-derivatives-in-ode-function-nesting-ad/50100 "2020-11-13T17:33:09Z")\
**Posts on this page:** 1\
**Showing post:** 4

<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:** [November 15, 2020, 10:59pm UTC](https://discourse.julialang.org/t/differentialequations-derivatives-in-ode-function-nesting-ad/50100/4 "2020-11-15T22:59:24Z")

</div>

> [@Andreas\_Schlaginhauf](#):
>
> In the meantime, I’ll give it a try to implement the adjoint method for DDEs.

Even with the new AD, this will be needed because the missing component cannot be calculated without a derivative rule to catch the discontinuity. The issue to follow is:

> <https://github.com/SciML/SciMLSensitivity.jl/issues/281>
>
> For simple cases we can just differentiate through the DDE solver but if the DDE… system contains parameter-dependent C1-discontinuities the forward sensitivities have jump discontinuities which, e.g., ForwardDiff can't deal with (see https://github.com/SciML/DelayDiffEq.jl/pull/183 and https://epubs.siam.org/doi/abs/10.1137/100814949).
> 
> Hence it would be great if we could add forward sensitivity equations and adjoint methods for DDEs. I would like to help with getting them in here, I've just never worked on DiffEqSensitivity and hence might need some guidance and/or time to get started. I would assume that (hopefully) one can exploit the existing implementations for ODEs.

An implementation of Enright’s corrections is needed regardless of what AD is used, so it would be much appreciated!

---

_[View the full topic](https://discourse.julialang.org/t/differentialequations-derivatives-in-ode-function-nesting-ad/50100)._
