\(\newcommand{\W}[1]{ \; #1 \; }\) \(\newcommand{\R}[1]{ {\rm #1} }\) \(\newcommand{\B}[1]{ {\bf #1} }\) \(\newcommand{\D}[2]{ \frac{\partial #1}{\partial #2} }\) \(\newcommand{\DD}[3]{ \frac{\partial^2 #1}{\partial #2 \partial #3} }\) \(\newcommand{\Dpow}[2]{ \frac{\partial^{#1}}{\partial {#2}^{#1}} }\) \(\newcommand{\dpow}[2]{ \frac{ {\rm d}^{#1}}{{\rm d}\, {#2}^{#1}} }\)
forward_theory¶
View page sourceThe Theory of Forward Mode¶
Taylor Notation¶
In Taylor notation, each variable corresponds to a function of a single argument which we denote by t (see Section 10.2 of Evaluating Derivatives ). Here and below \(X(t)\), \(Y(t)\), and Z ( t ) are scalar valued functions and the corresponding p-th order Taylor coefficients row vectors are \(x\), \(y\) and \(z\); i.e.,
For the purposes of this section, we are given \(x\) and \(y\) and need to determine \(z\).
Binary Operators¶
Addition¶
Subtraction¶
Multiplication¶
Division¶
Standard Math Functions¶
Suppose that \(F\) is a standard math function and
Differential Equation¶
All of the standard math functions satisfy a differential equation of the form
We use \(a\), \(b\) and \(d\) to denote the p-th order Taylor coefficient row vectors for \(A [ X (t) ]\), \(B [ X (t) ]\) and \(D [ X (t) ]\) respectively. We assume that these coefficients are known functions of \(x\), the p-th order Taylor coefficients for \(X(t)\).
Taylor Coefficients Recursion Formula¶
Our problem here is to express \(z\), the p-th order Taylor coefficient row vector for \(Z(t)\), in terms of these other known coefficients. It follows from the formulas above that
where we define
We can compute the value of \(z^{(0)}\) using the formula
Suppose by induction (on \(j\)) that we are given the Taylor coefficients of \(E(t)\) up to order \(j-1\); i.e., \(e^{(k)}\) for \(k = 0 , \ldots , j-1\) and the coefficients \(z^{(k)}\) for \(k = 0 , \ldots , j\). We can compute \(e^{(j)}\) using the formula
We need to complete the induction by finding formulas for \(z^{(j+1)}\). It follows from the definition of \(E(t)\) that
Setting the left and right side coefficients of \(t^j\) equal, and using the formula for Multiplication , we obtain
This completes the induction that computes \(e^{(j)}\) and \(z^{(j+1)}\).
Cases that Apply Recursion Above¶
exp_forward |
|
log_forward |
|
sqrt_forward |
|
sin_cos_forward |
|
atan_forward |
|
asin_forward |
|
acos_forward |
|
pow_forward |
Special Cases¶
tan_forward |
Tangent and Hyperbolic Tangent Forward Taylor Polynomial Theory |
erf_forward |