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.
- Returns:
Same as
poly
but differentiated with respect todiffvars
.- Examples:
>>> 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])