1010import matplotlib .pyplot as plt
1111import warnings
1212
13- def sisotool (sys , kvect = None , xlim_rlocus = None , ylim_rlocus = None ,
14- plotstr_rlocus = 'b' if int (matplotlib .__version__ [0 ]) == 1 else 'C0' ,
15- rlocus_grid = False , omega = None , dB = None , Hz = None ,
16- deg = None , omega_limits = None , omega_num = None ,
17- margins_bode = True , tvect = None ):
13+ def sisotool (sys , kvect = None , xlim_rlocus = None , ylim_rlocus = None ,
14+ plotstr_rlocus = 'C0' , rlocus_grid = False , omega = None , dB = None ,
15+ Hz = None , deg = None , omega_limits = None , omega_num = None ,
16+ margins_bode = True , tvect = None ):
1817 """
1918 Sisotool style collection of plots inspired by MATLAB's sisotool.
2019 The left two plots contain the bode magnitude and phase diagrams.
@@ -26,12 +25,15 @@ def sisotool(sys, kvect = None, xlim_rlocus = None, ylim_rlocus = None,
2625 ----------
2726 sys : LTI object
2827 Linear input/output systems. If sys is SISO, use the same
29- system for the root locus and step response. If sys is
30- two-input, two-output, insert the negative of the selected gain
31- between the first output and first input and use the second input
32- and output for computing the step response. This allows you to see
33- the step responses of more complex systems while using sisotool,
34- for example, systems with a feedforward path into the plant.
28+ system for the root locus and step response. If it is desired to
29+ see a different step response than feedback(K*loop,1), sys can be
30+ provided as a two-input, two-output system (e.g. by using
31+ :func:`bdgalg.connect' or :func:`iosys.interconnect`). Sisotool
32+ inserts the negative of the selected gain K between the first output
33+ and first input and uses the second input and output for computing
34+ the step response. This allows you to see the step responses of more
35+ complex systems, for example, systems with a feedforward path into the
36+ plant or in which the gain appears in the feedback path.
3537 kvect : list or ndarray, optional
3638 List of gains to use for plotting root locus
3739 xlim_rlocus : tuple or list, optional
@@ -108,12 +110,8 @@ def sisotool(sys, kvect = None, xlim_rlocus = None, ylim_rlocus = None,
108110
109111def _SisotoolUpdate (sys , fig , K , bode_plot_params , tvect = None ):
110112
111- if int (matplotlib .__version__ [0 ]) == 1 :
112- title_font_size = 12
113- label_font_size = 10
114- else :
115- title_font_size = 10
116- label_font_size = 8
113+ title_font_size = 10
114+ label_font_size = 8
117115
118116 # Get the subaxes and clear them
119117 ax_mag , ax_rlocus , ax_phase , ax_step = \
@@ -144,7 +142,7 @@ def _SisotoolUpdate(sys, fig, K, bode_plot_params, tvect=None):
144142
145143 ax_step .set_title ('Step response' ,fontsize = title_font_size )
146144 ax_step .set_xlabel ('Time (seconds)' ,fontsize = label_font_size )
147- ax_step .set_ylabel ('Amplitude ' ,fontsize = label_font_size )
145+ ax_step .set_ylabel ('Output ' ,fontsize = label_font_size )
148146 ax_step .get_xaxis ().set_label_coords (0.5 , - 0.15 )
149147 ax_step .get_yaxis ().set_label_coords (- 0.15 , 0.5 )
150148 ax_step .tick_params (axis = 'both' , which = 'major' , labelsize = label_font_size )
0 commit comments