1. Introduction
The FuncSpec.py module deals with the specification of functionality of a Generator (see Generators). A FuncSpec object is passed to a Generator object when it is initialized, which the Generator uses to build internal representations of its trajectory generation functions -- for instance, a function that computes the value of the right-hand side of an ODE, which can be passed to an ODE solver.
2. Target languages
Python, C, ODETools/ADMC++ (automatic differentiation via ODETools). In development:
XPP (X-PhasePlane), DsTool.
3. Sub-classes
There are three subclasses which are specific to the types of Generator that use them. The most important one is RHSfuncSpec, for use with ODE systems and discrete-time maps. ExpFuncSpec is for use with the ExplicitFnGen class, for instance. Similarly, ImpFuncSpec is used by the ImplicitFnGen. These subclasses can be viewed as simply providing types so that a Generator object can better validate the FuncSpec object passed to it. Presently, these subclasses contain no special functionality, but this might change in future revisions.
4. Initialization keywords
On initialization, a new FuncSpec object expects a dictionary or args object containing keyword-value mappings. These must at least contain a name for the object under the keyword 'name', and a list of declared variable names under the key 'vars'. If parameters and external inputs are to be present in the Generator, these are also declared as lists of name strings using the keys 'pars' and 'inputs'. An additional feature in PyDSTool is to allow auxiliary variables to be computed alongside the regular state variables. These variables are declared under the key 'auxvars', but their specifications as algebraic functions of the state, time, and parameters, use the same syntax. The auxiliary variables can also be used for plotting purposes, or for other post-processing analysis and diagnosis of a computed trajectory.
A dictionary of strings containing a representations of the functionality of the Generator is expected under the initialization argument's key 'varspecs'. The dictionary keys are the variable names and auxiliary variable names (if any). The syntax of these specifications is discussed below.
A dictionary of function names -> definition strings must also be specified under the intialization argument key 'fnspecs' for any auxiliary functions declared. The declared parameter names are purely local to the specification string, and are not meant to necessarily correspond to declared variable, parameter, or input names.
Events, autonomous external inputs, algorithmic parameters, and other Generator-specific details may be present in the arguments to initialize a FuncSpec object.
For now, you are encouraged to read the documented code in the FuncSpec.py module to find out more.