-------------------------------------------------------------- lines 6-71 of file: example/atomic_four/lin_ode/rev_depend.cpp -------------------------------------------------------------- {xrst_begin atomic_four_lin_ode_rev_depend.cpp} {xrst_spell cccc } Atomic Linear ODE Reverse Dependency Analysis: Example and Test ############################################################### Purpose ******* This example demonstrates calculating reverse dependency with the :ref:`atomic_four_lin_ode-name` class; see :ref:`atomic_four_lin_ode_rev_depend.hpp-name` . y(t, x) ******* We are given a positive integer m and define :math:`y : \B{R} \times \B{R}^m \rightarrow \B{R}^m` by .. math:: y(t, x) = \prod_{i=0}^m x_i t^i / i ! It follows that .. math:: \partial_t y_i (t, x) = \left \{ \begin{array}{ll} 0 & \R{if} \; i = 0 \\ x_i y_{i-1} (t, x) & \R{otherwise} \end{array} \right . \\ \partial_t y (t, x) = \left( \begin{array}{cccc} 0 & 0 & \cdots & 0 \\ x_1 & 0 & \cdots & 0 \\ 0 & x_2 & & 0 \\ \vdots & & \ddots & \vdots \\ 0 & 0 & \cdots & x_m \end{array} \right) y (t, x) \W{,} y (0, x) = \left( \begin{array}{c} x_0 \\ 0 \\ \vdots \\ 0 \\ \end{array} \right) Problem Parameters ****************** The following problem parameters can be changed: {xrst_literal // BEGIN_PROBLEM_PARAMETERS // END_PROBLEM_PARAMETERS } Source ****** {xrst_literal // BEGIN C++ // END C++ } {xrst_end atomic_four_lin_ode_rev_depend.cpp}