lines 6-66 of file: example/python/numeric/rosen3_step_xam.py # {xrst_begin numeric_rosen3_step_xam.py} # {xrst_spell # rl # rosenbrock # } # {xrst_comment_ch #} # # # Example Computing Derivative A Rosenbrock Ode Solution # ###################################################### # # y(t, x) # ******* # The two initial value problems below have the following solution: # # .. math:: # # y_i (t, x) = ( t^{i+1} / (i+1) ! ) \prod_{j=0}^i x_j # # First ODE # ********* # # .. math:: # # f(t, y, x) = # \left\{ \begin{array}{rl} # x_0 & {\rm if} \; i = 0 \\ # x_i y_{i-1} (t) & {\rm otherwise} # \end{array} \right. # # with the initial condition :math:`y(0) = 0` # # Second ODE # ********** # # .. math:: # # f(t, y, x) = ( t^i / i ! ) \prod_{j=0}^i x_j # # with the initial condition :math:`y(0) = 0` # # Derivative of Solution # ********************** # For this special case, the partial derivative of the solution with respect # to the j-th component of the vector :math:`x` is # # .. math:: # # \partial_{x(j)} y_i (t, x) = \left\{ \begin{array}{rl} # y_i (t, x) / x_j & {\rm if} \; j \leq i \\ # 0 & {\rm otherwise} # \end{array} \right. # # Source Code # *********** # {xrst_literal # # BEGIN_PYTHON # # END_PYTHON # } # # {xrst_end numeric_rosen3_step_xam.py}