def redraw(self): """ Redraw all diagrams """ self.draw_pz(self.sys) self.f_bode.clf() plt.figure(self.f_bode.number) control.matlab.bode(self.sys, logspace(-2, 2, 1000)) plt.suptitle('Bode Diagram') self.f_nyquist.clf() plt.figure(self.f_nyquist.number) control.matlab.nyquist(self.sys, logspace(-2, 2, 1000)) plt.suptitle('Nyquist Diagram') self.f_step.clf() plt.figure(self.f_step.number) try: # Step seems to get intro trouble # with purely imaginary poles yvec, tvec = control.matlab.step(self.sys) plt.plot(tvec.T, yvec) except: print("Error plotting step response") plt.suptitle('Step Response') self.canvas_pzmap.draw() self.canvas_bode.draw() self.canvas_step.draw() self.canvas_nyquist.draw()
def redraw(self): """ Redraw all diagrams """ self.draw_pz(self.sys) self.f_bode.clf() plt.figure(self.f_bode.number) control.matlab.bode(self.sys, logspace(-2, 2)) plt.suptitle('Bode Diagram') self.f_nyquist.clf() plt.figure(self.f_nyquist.number) control.matlab.nyquist(self.sys, logspace(-2, 2)) plt.suptitle('Nyquist Diagram') self.f_step.clf() plt.figure(self.f_step.number) try: # Step seems to get intro trouble # with purely imaginary poles tvec, yvec = control.matlab.step(self.sys) plt.plot(tvec.T, yvec) except: print("Error plotting step response") plt.suptitle('Step Response') self.canvas_pzmap.draw() self.canvas_bode.draw() self.canvas_step.draw() self.canvas_nyquist.draw()
def testNyquist(self, siso): """Call nyquist()""" nyquist(siso.ss1) nyquist(siso.tf1) nyquist(siso.tf2) w = logspace(-3, 3) nyquist(siso.tf2, w) (real, imag, freq) = nyquist(siso.tf2, w, plot=False)
def testFreqresp(self, siso): """Call freqresp()""" w = logspace(-3, 3) freqresp(siso.ss1, w) freqresp(siso.ss2, w) freqresp(siso.ss3, w) freqresp(siso.tf1, w) freqresp(siso.tf2, w) freqresp(siso.tf3, w)
def testBode(self, siso, mplcleanup): """Call bode()""" bode(siso.ss1) bode(siso.tf1) bode(siso.tf2) (mag, phase, freq) = bode(siso.tf2, plot=False) bode(siso.tf1, siso.tf2) w = logspace(-3, 3) bode(siso.ss1, w) bode(siso.ss1, siso.tf2, w)
def testNichols_logspace(self, siso, mplcleanup): """Call nichols() with logspace w""" w = logspace(-3, 3) nichols(siso.tf2, w)