lines 6-73 of file: python/cmpad/an_ode.py {xrst_begin_parent py_an_ode} {xrst_spell kutta runge yf } Use Python Runge-Kutta Method to Solve an ODE ############################################# Syntax ****** | |tab| *ode* = ``cmpad.an_ode( *like_numpy* )`` | |tab| *ode* . ``setup`` ( *option* ) | |tab| *yf* = *ode* ( *x* ) Prototype ********* {xrst_literal # BEGIN PROTOTYPE # END PROTOTYPE } Algorithm ********* This is a python implementation of the an_ode :ref:`an_ode@Algorithm` . like_numpy ********** This is a :ref:`like_numpy-name` class. It is used to vectorize the :ref:`rk4_step-name` algorithm. ode *** The object *ode* corresponding to :ref:`py_fun_obj@fun_obj` in the function object interface. n_arg ***** see :ref:`an_ode@option@n_arg` . This is the number of elements that are computed by one *like_numpy* operation in the r4k_step algorithm n_other ======= see :ref:`an_ode@option@n_other` . x * This is the :ref:`an_ode@ODE@Parameter Vector` that appears in the ODE. yf ** The return value *yf* is :math:`y(t)` at :math:`t = 2` . {xrst_toc_hidden after python/xam/an_ode.py python/cmpad/runge_kutta.py } Example ******* :ref:`xam_an_ode.py-name` contains an example and test of ``an_ode`` . Source Code *********** :ref:`an_ode.py-name` displays the source code for this algorithm. {xrst_end py_an_ode}