def bode (tf, plot = False): print "=================================================================="; gm, pm, wg, wp = ctrl.margin (tf); print "Gain Margin: ", gm, " dB in ", wg, " rad/s"; #Verificar informacoes print "Phase Margin: ", gm, "deg in", wp, " rad/s"; mag, pha, w = ctrl.bode_plot (tf); if (plot == True): p = Plotter ({'type' : 'log', 'grid' : True}); p.subplot ([(w, 20*np.log10(mag)), (w, (180*pha/np.pi))], ["Gain (dB)", "Phase (deg)"]); return gm, pm, wg, wp