control.input_output_response(sys, T, U=0.0, X0=0, params={}, transpose=False, return_x=False, squeeze=None, solve_ivp_kwargs={}, **kwargs)

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.

  • 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 and if the system has a single output, return the system output as a 1D array rather than a 2D array. If False, return the system output as a 2D array even if the system is SISO. Default value set by config.defaults[‘control.squeeze_time_response’].

  • solve_ivp_method (str, optional) – Set the method used by scipy.integrate.solve_ivp(). Defaults to ‘RK45’.

  • solve_ivp_kwargs (str, optional) – Pass additional keywords to scipy.integrate.solve_ivp().


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

  • yout (array) – Response of the system. If the system is SISO and squeeze is not True, the array is 1D (indexed by time). If the system is not SISO or squeeze is False, the array is 2D (indexed by the output number and time).

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

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

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