Package Scientific :: Package Functions :: Module Derivatives :: Class DerivVar

[frames] | no frames]

# Class DerivVar

Numerical variable with automatic derivatives of arbitrary order

Instance Methods

__abs__(self) |

__add__(self, other) |

__cmp__(self, other) |

__coerce__(self, other) |

__div__(self, other) |

`list`

__getitem__(self, order) Returns: a list of all derivatives of the given order |

__init__(self, value, index=0, order=1, recursive=None) |

__mul__(self, other) |

__neg__(self) |

__nonzero__(self) |

__pos__(self) |

__pow__(self, other, z=None) |

__radd__(self, other) |

__rdiv__(self, other) |

__repr__(self) |

__rmul__(self, other) |

__rpow__(self, other) |

__rsub__(self, other) |

__str__(self) |

__sub__(self, other) |

arccos(self) |

arcsin(self) |

arctan(self) |

arctan2(self, other) |

cos(self) |

cosh(self) |

exp(self) |

log(self) |

log10(self) |

sign(self) |

sin(self) |

sinh(self) |

sqrt(self) |

tan(self) |

tanh(self) |

DerivVar

toOrder(self, order) Returns: a DerivVar object with a lower derivative order |

Method Details

### __getitem__(self, order)
(Indexing operator)

Parameters:
  - `order` (`int`) - derivative order
Returns: `list`
  a list of all derivatives of the given order
Raises:
  - `ValueError` - if order < 0 or order > self.order

### __init__(self, value, index=0, order=1, recursive=None)
(Constructor)

Parameters:
  - `value` (number) - the numerical value of the variable
  - `index` (`int`) - the variable index, which serves to distinguish between variables and as an index for the derivative lists. Each explicitly created instance of DerivVar must have a unique index.
  - `order` (`int`) - the derivative order
Raises:
  - `ValueError` - if order < 0

### toOrder(self, order)

Parameters:
  - `order` (`int`) - the highest derivative order to be kept
Returns: DerivVar
  a DerivVar object with a lower derivative order