control.negate

control.negate(sys, **kwargs)[source]

Return the negative of a system.

Parameters
  • sys (scalar, array, or InputOutputSystem) – I/O systems to negate.

  • inputs (str, or list of str, optional) – List of strings that name the individual signals. If not given, signal names will be of the form s[i] (where s is one of u, or y). See InputOutputSystem for more information.

  • outputs (str, or list of str, optional) – List of strings that name the individual signals. If not given, signal names will be of the form s[i] (where s is one of u, or y). See InputOutputSystem for more information.

  • states (str, or list of str, optional) – List of names for system states. If not given, state names will be of of the form x[i] for interconnections of linear systems or ‘<subsys_name>.<state_name>’ for interconnected nonlinear systems.

  • name (string, optional) – System name (used for specifying signals). If unspecified, a generic name <sys[id]> is generated with a unique integer id.

Returns

out – Negated system.

Return type

scalar, array, or InputOutputSystem

Notes

This function is a wrapper for the __neg__ function in the StateSpace and TransferFunction classes. The output type is the same as the input type.

Examples

>>> G = ct.tf([2], [1, 1])
>>> G.dcgain()
np.float64(2.0)
>>> Gn = ct.negate(G) # Same as sys2 = -sys1.
>>> Gn.dcgain()
np.float64(-2.0)