# Getting second derivatives at every possible time point w.r.t. parameters

**URL:** <https://discourse.julialang.org/t/getting-second-derivatives-at-every-possible-time-point-w-r-t-parameters/58130>\
**Category:** General Usage\
**Tags:** question, diffeq\
**Created:** [March 28, 2021, 6:51pm UTC](https://discourse.julialang.org/t/getting-second-derivatives-at-every-possible-time-point-w-r-t-parameters/58130 "2021-03-28T18:51:39Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![donkeysaddle](https://avatars.discourse-cdn.com/v4/letter/d/3e96dc/32.png) [@donkeysaddle](https://discourse.julialang.org/u/donkeysaddle)\
**Post date:** [March 28, 2021, 6:51pm UTC](https://discourse.julialang.org/t/getting-second-derivatives-at-every-possible-time-point-w-r-t-parameters/58130/1 "2021-03-28T18:51:39Z")

</div>

I have used ODEForwardSensitivityProblem to great effect to get derivatives of the equations in my system w.r.t the parameters at every possible time point.

Is there a way to get the Hessian at every possible time point?

---

<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:** [March 28, 2021, 9:29pm UTC](https://discourse.julialang.org/t/getting-second-derivatives-at-every-possible-time-point-w-r-t-parameters/58130/2 "2021-03-28T21:29:25Z")

</div>

[https://diffeq.sciml.ai/stable/analysis/sensitivity/#Second-Order-Sensitivity-Analysis-via-second\_order\_sensitivities-(Experimental)](https://diffeq.sciml.ai/stable/analysis/sensitivity/#Second-Order-Sensitivity-Analysis-via-second_order_sensitivities-(Experimental))

---

<div class="post-metadata">

**Author:** ![philipptempel](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/philipptempel/32/25025_2.png) [@philipptempel](https://discourse.julialang.org/u/philipptempel)\
**Post date:** [May 12, 2021, 3:07pm UTC](https://discourse.julialang.org/t/getting-second-derivatives-at-every-possible-time-point-w-r-t-parameters/58130/3 "2021-05-12T15:07:55Z")

</div>

Great to see the second-order sensitivities being implemented into Julia.

Still, one question remains for my case, not sure if it applies to @donkeysaddle’s case, too:  
What if I don’t have a loss function with respect to which I want to calculate the Hessian, but I need the Hessian of the system’s ODE at points in time wrt some system parameters or the system’s initial state?  
Then, I cannot use the system, or can I?  
There’s a publication on how to derive higher-order sensitivities of ODEs/DAEs by Barrio from 2006 ([The Society for Industrial and Applied Mathematics](https://doi.org/10.1137/030601892)) which is what I would need

---

<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 13, 2021, 1:08am UTC](https://discourse.julialang.org/t/getting-second-derivatives-at-every-possible-time-point-w-r-t-parameters/58130/4 "2021-05-13T01:08:25Z")

</div>

> [@philipptempel](#):
>
> Still, one question remains for my case, not sure if it applies to @donkeysaddle’s case, too:  
> What if I don’t have a loss function with respect to which I want to calculate the Hessian, but I need the Hessian of the system’s ODE at points in time wrt some system parameters or the system’s initial state?  
> Then, I cannot use the system, or can I?  
> There’s a publication on how to derive higher-order sensitivities of ODEs/DAEs by Barrio from 2006 ([https://doi.org/10.1137/030601892](https://doi.org/10.1137/030601892)) which is what I would need

You can just use [GitHub - JuliaDiff/TaylorSeries.jl: Taylor polynomial expansions in one and several independent variables.](https://github.com/JuliaDiff/TaylorSeries.jl) for doing Taylor-mode automatic differentiation which is equivalent and more general.
