control.initial_response

control.initial_response(sysdata, timepts=None, initial_state=0, output_indices=None, timepts_num=None, params=None, transpose=False, return_states=False, squeeze=None, **kwargs)[source]

Compute the initial condition response for a linear system.

If the system has multiple outputs (MIMO), optionally, one output may be selected. If no selection is made for the output, all outputs are given.

For information on the shape of parameters T, X0 and return values T, yout, see Time series data conventions.

Parameters
sysdataI/O system or list of I/O systems

I/O system(s) for which initial response is computed.

timepts (or T)array_like or float, optional

Time vector, or simulation time duration if a number (time vector is auto-computed if not given; see step_response for more detail).

initial_state (or X0)array_like or float, optional

Initial condition (default = 0). Numbers are converted to constant arrays with the correct shape.

output_indices (or output)int

Index of the output that will be used in this simulation. Set to None to not trim outputs.

timepts_num (or T_num)int, optional

Number of time steps to use in simulation if timepts is not provided as an array (auto-computed if not given); ignored if the system is discrete time.

paramsdict, optional

If system is a nonlinear I/O system, set parameter values.

transposebool, optional

If True, transpose all input and output arrays (for backward compatibility with MATLAB and scipy.signal.lsim). Default value is False.

return_states (or return_x)bool, optional

If True, return the state vector when assigning to a tuple (default = False). See forced_response for more details.

squeezebool, optional

By default, if a system is single-input, single-output (SISO) then the output response is returned as a 1D array (indexed by time). If squeeze = True, remove single-dimensional entries from the shape of the output even if the system is not SISO. If squeeze = False, keep the output as a 2D array (indexed by the output number and time) even if the system is SISO. The default value can be set using config.defaults['control.squeeze_time_response'].

Returns
resultsTimeResponseData or TimeResponseList

Time response represented as a TimeResponseData object or list of TimeResponseData objects. See forced_response for additional information.

Notes

This function uses the forced_response function with the input set to zero.

Examples

>>> G = ct.rss(4)
>>> T, yout = ct.initial_response(G)