# dlode45

Deep learning solution of nonstiff ordinary differential equation (ODE)

## Syntax

## Description

The neural ordinary differential equation (ODE) operation returns the solution of a specified ODE.

The `dlode45`

function applies the neural ODE operation to `dlarray`

data.
Using `dlarray`

objects makes working with high
dimensional data easier by allowing you to label the dimensions. For example, you can label
which dimensions correspond to spatial, time, channel, and batch dimensions using the
`"S"`

, `"T"`

, `"C"`

, and
`"B"`

labels, respectively. For unspecified and other dimensions, use the
`"U"`

label. For `dlarray`

object functions that operate
over particular dimensions, you can specify the dimension labels by formatting the
`dlarray`

object directly, or by using the `DataFormat`

option.

**Note**

The `dlode45`

function best suits neural ODE and custom training loop
workflows. To solve ODEs for other workflows, use `ode45`

.

specifies additional options using one or more name-value arguments. For example, `Y`

= dlode45(`odefun`

,`tspan`

,`Y0`

,`theta`

,`Name=Value`

)```
Y
= dlode45(odefun,tspan,Y0,theta,GradientMode="adjoint")
```

integrates the system of
ODEs given by `odefun`

and computes gradients by solving the associated
adjoint ODE system.

## Examples

## Input Arguments

## Output Arguments

## Algorithms

The neural ordinary differential equation (ODE) operation returns the solution of a specified ODE. In particular, given an input, a neural ODE operation outputs the numerical
solution of the ODE $$y\prime =f(t,y,\theta )$$ for the time horizon
(*t _{0}*,

*t*) and with the initial condition

_{1}*y(t*, where

_{0}) = y_{0}*t*and

*y*denote the ODE function inputs and

*θ*is a set of learnable parameters. Typically, the initial condition

*y*is either the network input or the output of another deep learning operation.

_{0}The `dlode45`

function uses the `ode45`

function, which is based on an explicit Runge-Kutta (4,5) formula, the
Dormand-Prince pair. It is a single-step solver–in computing
*y(t _{n})*, it needs only the solution at the
immediately preceding time point,

*y(t*[2] [3].

_{n-1})## References

[1] Chen, Ricky T. Q., Yulia Rubanova, Jesse Bettencourt, and David Duvenaud. “Neural Ordinary Differential Equations.” Preprint, submitted June 19, 2018. https://arxiv.org/abs/1806.07366.

[2] Dormand, J. R., and P. J. Prince.
“A Family of Embedded Runge-Kutta Formulae.” *Journal of Computational and Applied
Mathematics* 6, no. 1 (March 1980): 19–26.
https://doi.org/10.1016/0771-050X(80)90013-3.

[3] Shampine, Lawrence F., and Mark W. Reichelt. “The MATLAB ODE Suite.” SIAM Journal on Scientific Computing 18, no. 1 (January 1997): 1–22. https://doi.org/10.1137/S1064827594276424.

## Version History

**Introduced in R2021b**