control.iosys.input_output_response

control.iosys.input_output_response(sys, T, U=0.0, X0=0, params={}, method='RK45', return_x=False, squeeze=True)

Compute the output response of a system to a given input.

Simulate a dynamical system with a given input and return its output and state values.

Parameters
  • sys (InputOutputSystem) – Input/output system to simulate.

  • T (array-like) – Time steps at which the input is defined; values must be evenly spaced.

  • U (array-like or number, optional) – Input array giving input at each time T (default = 0).

  • X0 (array-like or number, optional) – Initial condition (default = 0).

  • return_x (bool, optional) – If True, return the values of the state at each time (default = False).

  • squeeze (bool, optional) – If True (default), squeeze unused dimensions out of the output response. In particular, for a single output system, return a vector of shape (nsteps) instead of (nsteps, 1).

Returns

  • T (array) – Time values of the output.

  • yout (array) – Response of the system.

  • xout (array) – Time evolution of the state vector (if return_x=True)

Raises
  • TypeError – If the system is not an input/output system.

  • ValueError – If time step does not match sampling time (for discrete time systems)