@@ -204,34 +204,50 @@ class TimeResponseData:
204204
205205 Notes
206206 -----
207- 1. For backward compatibility with earlier versions of python-control,
208- this class has an ``__iter__`` method that allows it to be assigned
209- to a tuple with a variable number of elements. This allows the
210- following patterns to work:
207+ The responses for individual elements of the time response can be
208+ accessed using integers, slices, or lists of signal offsets or the
209+ names of the appropriate signals::
211210
212- t, y = step_response(sys)
213- t, y, x = step_response(sys, return_x=True)
211+ sys = ct.rss(4, 2, 1)
212+ resp = ct.initial_response(sys, X0=[1, 1, 1, 1])
213+ plt.plot(resp.time, resp.outputs['y[0]'])
214214
215- When using this (legacy) interface, the state vector is not affected by
216- the `squeeze` parameter.
215+ In the case of multi-trace data, the responses should be indexed using
216+ the output signal name (or offset) and the input signal name (or
217+ offset)::
217218
218- 2. For backward compatibility with earlier version of python-control,
219- this class has ``__getitem__`` and ``__len__`` methods that allow the
220- return value to be indexed:
219+ sys = ct.rss(4, 2, 2, strictly_proper=True)
220+ resp = ct.step_response(sys)
221+ plt.plot(resp.time, resp.outputs[['y[0]', 'y[1]'], 'u[0]'].T)
221222
222- response[0]: returns the time vector
223- response[1]: returns the output vector
224- response[2]: returns the state vector
223+ For backward compatibility with earlier versions of python-control,
224+ this class has an ``__iter__`` method that allows it to be assigned to
225+ a tuple with a variable number of elements. This allows the following
226+ patterns to work::
225227
226- When using this (legacy) interface, the state vector is not affected by
227- the `squeeze` parameter.
228+ t, y = step_response(sys)
229+ t, y, x = step_response(sys, return_x=True)
228230
229- 3. The default settings for ``return_x``, ``squeeze`` and ``transpose``
230- can be changed by calling the class instance and passing new values:
231+ When using this (legacy) interface, the state vector is not affected
232+ by the `squeeze` parameter.
233+
234+ For backward compatibility with earlier version of python-control, this
235+ class has ``__getitem__`` and ``__len__`` methods that allow the return
236+ value to be indexed:
237+
238+ response[0]: returns the time vector
239+ response[1]: returns the output vector
240+ response[2]: returns the state vector
241+
242+ When using this (legacy) interface, the state vector is not affected
243+ by the `squeeze` parameter.
244+
245+ The default settings for ``return_x``, ``squeeze`` and ``transpose``
246+ can be changed by calling the class instance and passing new values::
231247
232248 response(tranpose=True).input
233249
234- See :meth:`TimeResponseData.__call__` for more information.
250+ See :meth:`TimeResponseData.__call__` for more information.
235251
236252 """
237253
@@ -1302,8 +1318,8 @@ def _process_time_response(
13021318
13031319 Returns
13041320 -------
1305- output: ndarray
1306- Processd signal. If the system is SISO and squeeze is not True,
1321+ output : ndarray
1322+ Processed signal. If the system is SISO and squeeze is not True,
13071323 the array is 1D (indexed by time). If the system is not SISO or
13081324 squeeze is False, the array is either 2D (indexed by output and
13091325 time) or 3D (indexed by input, output, and time).
0 commit comments