From: Ryan K. <rk...@si...> - 2013-08-28 16:06:36
|
I need to calculate 3D bode plots (contour plots) for my work. I am getting this error: /usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/control-0.6d-py2.7.egg/control/xferfcn.pyc in __call__(self, s) 245 else: 246 # SISO transfer function, return a scalar --> 247 return self.horner(s)[0][0] 248 249 def _truncatecoeff(self): /usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/control-0.6d-py2.7.egg/control/xferfcn.pyc in horner(self, s) 560 for j in range(self.inputs): 561 out[i][j] = (polyval(self.num[i][j], s) / --> 562 polyval(self.den[i][j], s)) 563 564 return out ValueError: could not broadcast input array from shape (2,2) into shape (2) Here is code that recreates the problem: import control test = control.TransferFunction(1,[1,1]) s_mat = array([[2j*pi, 3j*pi],[-0.1+2j*pi, -0.1+3j*pi]]) -- Ryan Krauss, Ph.D. Associate Professor Mechanical Engineering Southern Illinois University Edwardsville |