Description
Dear python-control developers,
Thank you very much for the toolbox, which I am using in a process control course at the University of Pisa.
I am having problems in converting a 2-input, 2-output transfer function model into state space.
Here is the minimal code:
import control as cnt
Defining a MIMO system in TF
NUM = [[[12.8], [-18.9]],[[6.6], [-19.4]]]
DEN = [[[16.7, 1.], [21.,1.]],[[10.9,1.], [14.4,1.]]]
G = cnt.TransferFunction(NUM, DEN)
print "MIMO system = ", G
Conversion to state-space
Gss = cnt.tf2ss(G)
Running this code (MacOS X, python 2.7, python-control 0.70) indicates that the transfer function model is properly defined, but then the conversion function returns he following error:
File "/Users/gp/anaconda/lib/python2.7/site-packages/spyder/utils/site/sitecustomize.py", line 866, in runfile
execfile(filename, namespace)
File "/Users/gp/anaconda/lib/python2.7/site-packages/spyder/utils/site/sitecustomize.py", line 94, in execfile
builtins.execfile(filename, *where)
File "/Users/gp/Desktop/MIMOexample.py", line 17, in
Gss = cnt.tf2ss(G)
File "/Users/gp/anaconda/lib/python2.7/site-packages/control/matlab.py", line 764, in tf2ss
return _convertToStateSpace(sys)
File "/Users/gp/anaconda/lib/python2.7/site-packages/control/statesp.py", line 667, in _convertToStateSpace
lti_sys = lti(squeeze(sys.num), squeeze(sys.den))
File "/Users/gp/anaconda/lib/python2.7/site-packages/scipy/signal/ltisys.py", line 761, in init
self.num, self.den = normalize(*system)
File "/Users/gp/anaconda/lib/python2.7/site-packages/scipy/signal/filter_design.py", line 1080, in normalize
raise ValueError("Denominator polynomial must be rank-1 array.")
Is there any error in my code or is this indeed a bug?
Thank you in advance for your time and reply.
Best regards,
Gabriele Pannocchia