chaospy.derivative¶
- chaospy.derivative(poly: Union[numpy._typing._array_like._SupportsArray[numpy.dtype], numpy._typing._nested_sequence._NestedSequence[numpy._typing._array_like._SupportsArray[numpy.dtype]], bool, int, float, complex, str, bytes, numpy._typing._nested_sequence._NestedSequence[Union[bool, int, float, complex, str, bytes]], numpoly.baseclass.ndpoly], *diffvars: Union[numpoly.baseclass.ndpoly, str, int]) numpoly.baseclass.ndpoly [source]¶
Polynomial differential operator.
- Args:
- poly:
Polynomial to differentiate.
- diffvars:
Singleton variables to take derivative off.
- Return:
Same as
poly
but differentiated with respect todiffvars
.- Example:
>>> q0, q1 = numpoly.variable(2) >>> poly = numpoly.polynomial([1, q0, q0*q1**2+1]) >>> poly polynomial([1, q0, q0*q1**2+1]) >>> numpoly.derivative(poly, "q0") polynomial([0, 1, q1**2]) >>> numpoly.derivative(poly, 0, 1) polynomial([0, 0, 2*q1]) >>> numpoly.derivative(poly, q0, q0, q0) polynomial([0, 0, 0])