Linear time invariant systems plots

Created on Wed Apr 3 17:33:29 2024

@author: felipe

Functions:

plotImpulse(system, t[, ax, show])

Plot the impulse response of an LTI system (discrete time)

plotInput(system, u[, t, ax, show])

Plot the response of an LTI system (discrete time) to the input 'u'

plotStep(system, t[, ax, show])

Plot the step response of an LTI system (discrete time)

plot.lti_response.plotImpulse(system, t, ax='None', show=False)

Plot the impulse response of an LTI system (discrete time)

Parameters
  • system (tuple of LTI system as scipy.signal) – The system could be described by the following tuples: 1: (num, den, dt) 2: (zeros, poles, gain, dt) 3: (A, B, C, D, dt)

  • t (1D float array) – Array of the time points, preferable with a sampling time equal of the system

  • ax (matplotlib.pyplot.axes, optional) – Axis where the plot is shown. The default is ‘None’ and shows the plot in a new figure.

  • show (Boolean, optional) – Shows or not the axes at the end of the plotting function. The default is False.

Returns

  • ax (The updated matplotlib.pyplot.axes)

  • Plot in the indicated ‘ax’ or in a new matplotlib.pyplot.figure

plot.lti_response.plotInput(system, u, t=None, ax='None', show=False)

Plot the response of an LTI system (discrete time) to the input ‘u’

Parameters
  • system (tuple of LTI system as scipy.signal) – The system could be described by the following tuples: 1: (num, den, dt) 2: (zeros, poles, gain, dt) 3: (A, B, C, D, dt)

  • u (2D(1D) float array.) – Array of the inputs of the system. If 2D array, the number of rows is the time lenght and the number of columns must be the same as the system inputs.

  • t (1D float array, optional) – Array of the time points, preferable with a sampling time equal of the system. If None, the time array has the same length than the input array.

  • ax (matplotlib.pyplot.axes, optional) – Axis where the plot is shown. The default is ‘None’ and shows the plot in a new figure.

  • show (Boolean, optional) – Shows or not the axes at the end of the plotting function. The default is False.

Returns

  • ax (The updated matplotlib.pyplot.axes)

  • Plot in the indicated ‘ax’ or in a new matplotlib.pyplot.figure

plot.lti_response.plotStep(system, t, ax='None', show=False)

Plot the step response of an LTI system (discrete time)

Parameters
  • system (tuple of LTI system as scipy.signal) – The system could be described by the following tuples: 1: (num, den, dt) 2: (zeros, poles, gain, dt) 3: (A, B, C, D, dt)

  • t (1D float array) – Array of the time points, preferable with a sampling time equal of the system

  • ax (matplotlib.pyplot.axes, optional) – Axis where the plot is shown. The default is ‘None’ and shows the plot in a new figure.

  • show (Boolean, optional) – Shows or not the axes at the end of the plotting function. The default is False.

Returns

  • ax (The updated matplotlib.pyplot.axes)

  • Plot in the indicated ‘ax’ or in a new matplotlib.pyplot.figure