Skip to content

miso tf2ss fails without slycot #120

Description

@jgoppert

This looks like it is failing to throw the warning to the user about it being miso and not supported without slycot for some reason.

tf = control.tf([[[-235, 1.146e4],
    [-235, 1.146E4],
    [-235, 1.146E4, 0]]],
    [[[1, 48.78, 0],
      [1, 48.78, 0, 0],
      [0.008, 1.39, 48.78]]])
tf
Out[80]:

Input 1 to output 1:
-235 s + 1.146e+04
------------------
  s^2 + 48.78 s

Input 2 to output 1:
-235 s + 1.146e+04
------------------
  s^3 + 48.78 s^2

Input 3 to output 1:
  -235 s^2 + 1.146e+04 s
--------------------------
0.008 s^2 + 1.39 s + 48.78
In [81]:

​
control.tf2ss(tf)
---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
/home/jgoppert/anaconda3/lib/python3.5/site-packages/control-dev-py3.5.egg/control/statesp.py in _convertToStateSpace(sys, **kw)
    646         try:
--> 647             from slycot import td04ad
    648             if len(kw):

ImportError: No module named 'slycot'

During handling of the above exception, another exception occurred:

ValueError                                Traceback (most recent call last)
<ipython-input-81-c8ef26438f31> in <module>()
      1 
----> 2 control.tf2ss(tf)

/home/jgoppert/anaconda3/lib/python3.5/site-packages/control-dev-py3.5.egg/control/statesp.py in tf2ss(*args)
   1082             raise TypeError("tf2ss(sys): sys must be a TransferFunction \
   1083 object.")
-> 1084         return _convertToStateSpace(sys)
   1085     else:
   1086         raise ValueError("Needs 1 or 2 arguments; received %i." % len(args))

/home/jgoppert/anaconda3/lib/python3.5/site-packages/control-dev-py3.5.egg/control/statesp.py in _convertToStateSpace(sys, **kw)
    671             # I think this will fail if num and den aren't 1-D after
    672             # the squeeze
--> 673             lti_sys = lti(squeeze(sys.num), squeeze(sys.den))
    674             return StateSpace(lti_sys.A, lti_sys.B, lti_sys.C, lti_sys.D,
    675                               sys.dt)

/home/jgoppert/anaconda3/lib/python3.5/site-packages/scipy/signal/ltisys.py in __init__(self, *system, **kwargs)
    759         self._den = None
    760 
--> 761         self.num, self.den = normalize(*system)
    762 
    763     def __repr__(self):

/home/jgoppert/anaconda3/lib/python3.5/site-packages/scipy/signal/filter_design.py in normalize(b, a)
   1084     if len(b.shape) == 1:
   1085         b = asarray([b], b.dtype.char)
-> 1086     while a[0] == 0.0 and len(a) > 1:
   1087         a = a[1:]
   1088     outb = b * (1.0) / a[0]

ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()

Metadata

Metadata

Assignees

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions