lines 8-77 of file: lib/python/cppad_py/independent.py # {xrst_begin py_independent} # {xrst_spell # adynamic # nd # nx # } # {xrst_comment_ch #} # # # Declare Independent Variables and Start Recording # ################################################# # # Syntax # ****** # # | *ax* = ``cppad_py.independent`` ( *x* ) # | ( *ax* , *adynamic* ) = ``cppad_py.independent`` ( *x* , *dynamic* ) # # x # * # This argument is a numpy vector with ``float`` elements. # It specifies the number of independent variables # and their values during the recording. # We use *nx* = *x*\ ``.size`` # to denote the number of independent variables. # # dynamic # ******* # This argument is a numpy vector with ``float`` elements. # It specifies the number of independent dynamic parameters # and their values during the recording. # We use *nd* = *dynamic*\ ``.size`` # to denote the number of independent dynamic parameters. # # ax # ** # This result is a numpy vector with ``a_double`` elements. # This is the vector of independent variables. # It has size *nx* and for # *i* = 0 to *n* -1 # # | |tab| *ax* [ *i* ]. ``value`` () == *x* [ *i* ] # # adynamic # ******** # This result is a numpy vector with ``a_double`` elements. # This is the vector of independent dynamic parameters. # It has size *nd* and for # *i* = 0 to *n* -1 # # | |tab| *adynamic* [ *i* ]. ``value`` () == *dynamic* [ *i* ] # # Purpose # ******* # This starts a recording of the :ref:`a_double-name` operations. # This recording is terminated, and the information is stored, # by calling the :ref:`d_fun_constructor`. # It is terminated, and the information is lost, # by calling :ref:`abort_recording`. # # {xrst_toc_hidden # example/python/core/fun_dynamic_xam.py # } # Example # ******* # Most of the python ``d_fun`` examples use this function. # The :ref:`fun_dynamic_xam.py-name` uses the syntax that includes # dynamic parameters. # # {xrst_end py_independent}