PrevNext

 \newcommand{\B}[1]{{\bf #1}}  \newcommand{\R}[1]{{\rm #1}}
pycppad-20121020: A Python Algorithm Derivative Package
Manual split into sections    Manual as one web page
Math displayed using Latex    pycppad.htm    _printable.htm
Math displayed using MathML    pycppad.xml    _printable.xml

License
BSD

Syntax
from pycppad import *

Purpose
The command above imports a boost::python interface to the C++ Algorithmic Differentiation (AD) package CppAD .

Simple Example
 
from pycppad import *
def pycppad_test_get_started() :
  def F(x) :                                   # function to be differentiated
    return exp(-(x[0]**2. + x[1]**2.) / 2.)    # is Gaussian density
  x     = numpy.array( [ 1.,  2.] )
  a_x   = independent(x)
  a_y   = numpy.array( [ F(a_x) ] ) 
  f     = adfun(a_x, a_y)
  J     = f.jacobian(x)                        # J = F'(x)
  assert abs( J[0, 0] + F(x) * x[0] ) < 1e-10  # J[0,0] ~= - F(x) * x[0]
  assert abs( J[0, 1] + F(x) * x[1] ) < 1e-10  # J[0,1] ~= - F(x) * x[1]


Features
Operator overloading is used to store the operation sequence corresponding to a python algorithm. The operation sequence can be evaluated to obtain new function values or derivatives of arbitrary order. In addition, multiple levels of AD are supported. This means that AD derivatives can be used in the definition of a function which in turn can be differentiated using AD. See whats_new_12 for a list of recent extensions and bug fixes.

Contents
_contentsTable of Contents
installInstalling pycppad
get_started.pyget_started: Example and Test
exampleList of All the pycppad Examples
ad_variableAD Variable Methods
ad_functionAD Function Methods
two_levels.pyUsing Two Levels of AD: Example and Test
runge_kutta_4Fourth Order Runge Kutta
whats_new_12Extensions, Bug Fixes, and Changes During 2012
licenseLicense
_referenceAlphabetic Listing of Cross Reference Tags
_indexKeyword Index
_searchSearch Python Algorithmic Differentiation Using CppAD
_externalExternal Internet References

Input File: doc.omh