Package PyDSTool :: Module FuncSpec'
[hide private]
[frames] | no frames]

Module FuncSpec'

source code

Functional specification classes.

   Robert Clewley, August 2005.

This module aids in building internal representations of ODEs, etc.,
particularly for the benefit of Automatic Differentiation
and for manipulation of abstraction digraphs.

Classes [hide private]
  ExpFuncSpec
Explicit definition of vars defined.
  FuncSpec
Functional specification of dynamics: abstract class.
  ImpFuncSpec
Assumes this will be set to equal zero when solving for vars defined.
  RHSfuncSpec
Right-hand side definition for vars defined.
Functions [hide private]
 
_processReused(specnames, specdict, reuseterms, indentstr='', typestr='', endstatementchar='', parseFunc=<function idfn at 0x311f670>)
Process substitutions of reused terms.
source code
 
getSpecFromFile(specfilename)
Read text specs from a file
source code
 
makePartialJac(spec_pair, varnames, select=None)
Use this when parameters have been added to a modified Generator which might clash with aux fn argument names.
source code
 
resolveClashingAuxFnPars(fnspecs, varspecs, parnames)
Use this when parameters have been added to a modified Generator which might clash with aux fn argument names.
source code
Variables [hide private]
  API = API_class()
  Continuous = Continuous Domain
  Discrete = Discrete Domain
  LargestInt32 = 2147483647
  NAMESEP = '.'
  ONES = ['1', '1.0', '1.', '(1)', '(1.0)', '(1.)']
  ZEROS = ['0', '0.0', '0.', '(0)', '(0.0)', '(0.)']
  _1DimplicitSolveMethods = ['newton', 'bisect', 'steffe']
  _all_complex = (<type 'complex'>, <type 'numpy.complexfloating...
  _all_float = (<type 'float'>, <type 'numpy.floating'>, <type '...
  _all_int = (<type 'int'>, <type 'numpy.integer'>, <type 'numpy...
  _all_numpy_complex = (<type 'numpy.complex128'>, <type 'numpy....
  _all_numpy_float = (<type 'numpy.float64'>, <type 'numpy.float...
  _all_numpy_int = (<type 'numpy.int32'>, <type 'numpy.int32'>, ...
  _complex_types = (<type 'complex'>, <type 'numpy.complexfloati...
  _float_types = (<type 'float'>, <type 'numpy.floating'>)
  _implicitSolveMethods = ['newton', 'bisect', 'steffe', 'fsolve']
  _indentstr = ' '
  _int_types = (<type 'int'>, <type 'numpy.integer'>)
  _num_equivtype = {<type 'float'>: <type 'numpy.float64'>, <typ...
  _num_maxmin = {<type 'numpy.int32'>: [-2147483648, 2147483647]...
  _num_name2equivtypes = {'float': (<type 'float'>, <type 'numpy...
  _num_name2type = {'float': <type 'numpy.float64'>, 'int': <typ...
  _num_type2name = {<type 'float'>: 'float', <type 'int'>: 'int'...
  _num_types = (<type 'float'>, <type 'int'>, <type 'numpy.float...
  _pytypefromtype = {<type 'numpy.int32'>: <type 'int'>, <type '...
  _real_types = (<type 'int'>, <type 'numpy.integer'>, <type 'fl...
  _seq_types = (<type 'list'>, <type 'tuple'>, <type 'numpy.ndar...
  builtinFnSigInfo = {'for': 4, 'getbound': 2, 'getindex': 1, 'g...
  builtin_auxnames = ['globalindepvar', 'initcond', 'heav', 'if'...
  name_chars_RE = re.compile(r'\w')
  null_predicate = null_predicate_class(None)
  num_chars = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9']
  protected_allnames = ['acos', 'asin', 'atan', 'atan2', 'ceil',...
  protected_auxnamesDB = ModelSpec internal helper class: auxfnD...
  protected_macronames = ['for', 'if', 'max', 'min', 'sum']
  protected_mathnames = ['acos', 'asin', 'atan', 'atan2', 'ceil'...
  protected_randomnames = ['BPF', 'LOG4', 'NV_MAGICCONST', 'RECI...
  protected_scipynames = ['sign', 'mod']
  protected_specialfns = ['special_airy', 'special_airye', 'spec...
  syms = {0: 'ENDMARKER', 1: 'NAME', 2: 'NUMBER', 3: 'STRING', 4...
  targetLangs = ['c', 'python', 'matlab']
Function Details [hide private]

makePartialJac(spec_pair, varnames, select=None)

source code 
Use this when parameters have been added to a modified Generator which
might clash with aux fn argument names. (E.g., used by find_nullclines).

'select' option (list of varnames) selects those entries from the Jac of the varnames,
   e.g. for constructing Jacobian w.r.t. 'parameters' using a parameter formerly
   a variable (e.g. for find_nullclines).

resolveClashingAuxFnPars(fnspecs, varspecs, parnames)

source code 

Use this when parameters have been added to a modified Generator which might clash with aux fn argument names. (E.g., used by find_nullclines). Will remove arguments that are now considered parameters by the system, in both the function definitions and their use in specs for the variables.


Variables Details [hide private]

_all_complex

Value:
(<type 'complex'>,
 <type 'numpy.complexfloating'>,
 <type 'numpy.complex128'>,
 <type 'numpy.complex64'>,
 <type 'numpy.complex128'>)

_all_float

Value:
(<type 'float'>,
 <type 'numpy.floating'>,
 <type 'numpy.float64'>,
 <type 'numpy.float32'>,
 <type 'numpy.float64'>)

_all_int

Value:
(<type 'int'>,
 <type 'numpy.integer'>,
 <type 'numpy.int32'>,
 <type 'numpy.int32'>,
 <type 'numpy.int8'>,
 <type 'numpy.int16'>,
 <type 'numpy.int32'>,
 <type 'numpy.int64'>)

_all_numpy_complex

Value:
(<type 'numpy.complex128'>,
 <type 'numpy.complex64'>,
 <type 'numpy.complex128'>)

_all_numpy_float

Value:
(<type 'numpy.float64'>,
 <type 'numpy.float32'>,
 <type 'numpy.float64'>)

_all_numpy_int

Value:
(<type 'numpy.int32'>,
 <type 'numpy.int32'>,
 <type 'numpy.int8'>,
 <type 'numpy.int16'>,
 <type 'numpy.int32'>,
 <type 'numpy.int64'>)

_complex_types

Value:
(<type 'complex'>, <type 'numpy.complexfloating'>)

_num_equivtype

Value:
{<type 'float'>: <type 'numpy.float64'>,
 <type 'int'>: <type 'numpy.int32'>,
 <type 'numpy.integer'>: <type 'numpy.int32'>,
 <type 'numpy.floating'>: <type 'numpy.float64'>,
 <type 'numpy.int8'>: <type 'numpy.int32'>,
 <type 'numpy.int16'>: <type 'numpy.int32'>,
 <type 'numpy.int32'>: <type 'numpy.int32'>,
 <type 'numpy.int32'>: <type 'numpy.int32'>,
...

_num_maxmin

Value:
{<type 'numpy.int32'>: [-2147483648, 2147483647],
 <type 'numpy.float64'>: [-inf, inf]}

_num_name2equivtypes

Value:
{'float': (<type 'float'>,
           <type 'numpy.floating'>,
           <type 'numpy.float64'>,
           <type 'numpy.float32'>,
           <type 'numpy.float64'>),
 'int': (<type 'int'>,
         <type 'numpy.integer'>,
         <type 'numpy.int32'>,
...

_num_name2type

Value:
{'float': <type 'numpy.float64'>, 'int': <type 'numpy.int32'>}

_num_type2name

Value:
{<type 'float'>: 'float',
 <type 'int'>: 'int',
 <type 'numpy.integer'>: 'int',
 <type 'numpy.floating'>: 'float',
 <type 'numpy.int8'>: 'int',
 <type 'numpy.int16'>: 'int',
 <type 'numpy.int32'>: 'int',
 <type 'numpy.int32'>: 'int',
...

_num_types

Value:
(<type 'float'>,
 <type 'int'>,
 <type 'numpy.floating'>,
 <type 'numpy.integer'>)

_pytypefromtype

Value:
{<type 'numpy.int32'>: <type 'int'>,
 <type 'numpy.float64'>: <type 'float'>}

_real_types

Value:
(<type 'int'>,
 <type 'numpy.integer'>,
 <type 'float'>,
 <type 'numpy.floating'>)

_seq_types

Value:
(<type 'list'>, <type 'tuple'>, <type 'numpy.ndarray'>)

builtinFnSigInfo

Value:
{'for': 4,
 'getbound': 2,
 'getindex': 1,
 'globalindepvar': 1,
 'heav': 1,
 'if': 3,
 'initcond': 1,
 'max': 1,
...

builtin_auxnames

Value:
['globalindepvar', 'initcond', 'heav', 'if', 'getindex', 'getbound']

protected_allnames

Value:
['acos',
 'asin',
 'atan',
 'atan2',
 'ceil',
 'cos',
 'cosh',
 'degrees',
...

protected_auxnamesDB

Value:
ModelSpec internal helper class: auxfnDBclass object

protected_mathnames

Value:
['acos',
 'asin',
 'atan',
 'atan2',
 'ceil',
 'cos',
 'cosh',
 'degrees',
...

protected_randomnames

Value:
['BPF',
 'LOG4',
 'NV_MAGICCONST',
 'RECIP_BPF',
 'Random',
 'SG_MAGICCONST',
 'SystemRandom',
 'TWOPI',
...

protected_specialfns

Value:
['special_airy',
 'special_airye',
 'special_ai_zeros',
 'special_bi_zeros',
 'special_ellipj',
 'special_ellipk',
 'special_ellipkinc',
 'special_ellipe',
...

syms

Value:
{0: 'ENDMARKER',
 1: 'NAME',
 2: 'NUMBER',
 3: 'STRING',
 4: 'NEWLINE',
 5: 'INDENT',
 6: 'DEDENT',
 7: 'LPAR',
...