taylor_ode

View page source

AD Theory for Solving ODE’s Using Taylor’s Method

Problem

We are given an initial value problem for \(y : \B{R} \rightarrow \B{R}^n\); i.e., we know \(y(0) \in \B{R}^n\) and we know a function \(g : \B{R}^n \rightarrow \B{R}^n\) such that \(y^1 (t) = g[ y(t) ]\) where \(y^k (t)\) is the k-th derivative of \(y(t)\).

z(t)

We define the function \(z : \B{R} \rightarrow \B{R}^n\) by \(z(t) = g[ y(t) ]\). Given the Taylor coefficients \(y^{(k)} (t)\) for \(k = 0 , \ldots , p\), we can compute \(z^{(p)} (t)\) using forward mode AD on the function \(g(y)\); see forward_order . It follows from \(y^1 (t) = z(t)\) that \(y^{p+1} (t) = z^p (t)\)

\[y^{(p+1)} (t) = z^{(p)} (t) / (k + 1)\]

where \(y^{(k)} (t)\) is the k-th order Taylor coefficient for \(y(t)\); i.e., \(y^k (t) / k !\). Starting with the known value \(y^{(0)} (t)\), this gives a prescription for computing \(y^{(k)} (t)\) for any \(k\).

Taylor’s Method

The p-th order Taylor method for approximates

\[y( t + \Delta t ) \approx y^{(0)} (t) + y^{(1)} (t) \Delta t + \cdots + y^{(p)} (t) \Delta t^p\]

Example

The file taylor_ode.cpp contains an example and test of this method.