Control.tf2ss () работает неправильно после установки slycot - PullRequest
0 голосов
/ 13 февраля 2019

Модуль control.tf2ss () отлично работает в системах SISO, но после установки slycot (что необходимо для систем MIMO) функция возвращает ошибку (для систем SISO и MIMO).

После установки модуля slycot следующий код

A = numpy.array([[1., -2], [3, -4]])
B = numpy.array([[5.], [7]])
C = numpy.array([[6., 8]])
D = numpy.array([[9.]])
sys1 = control.ss(A, B, C, D)
control.ss2tf(sys1)

возвращает

ValueError                                Traceback (most recent call last)
<ipython-input-20-5160baa6cd95> in <module>
      4 D = numpy.array([[9.]])
      5 sys1 = control.ss(A, B, C, D)
----> 6 control.ss2tf(sys1)

C:\ProgramData\Anaconda3\lib\site-packages\control\xferfcn.py in ss2tf(*args)
   1315         sys = args[0]
   1316         if isinstance(sys, StateSpace):
-> 1317             return _convertToTransferFunction(sys)
   1318         else:
   1319             raise TypeError("ss2tf(sys): sys must be a StateSpace object.  It \

C:\ProgramData\Anaconda3\lib\site-packages\control\xferfcn.py in _convertToTransferFunction(sys, **kw)
   1097                 # Make sure to convert system matrices to numpy arrays
   1098                 tfout = tb04ad(sys.states, sys.inputs, sys.outputs, array(sys.A),
-> 1099                                array(sys.B), array(sys.C), array(sys.D), tol1=0.0)
   1100 
   1101                 # Preallocate outputs.

C:\ProgramData\Anaconda3\lib\site-packages\slycot\transform.py in tb04ad(n, m, p, A, B, C, D, tol1, tol2, ldwork)
    328         e = ValueError(error_text)
    329         e.info = out[-1]
--> 330         raise e
    331 
    332     A,B,C,Nr,index,dcoeff,ucoeff = out[:-1]

ValueError: The following argument had an illegal value: A

Я запустил диагностику на модуле slycot и получил следующие результаты

>>> import slycot
>>> slycot.test("full")
Running unit tests for slycot
NumPy version 1.15.4
NumPy relaxed strides checking option: True
NumPy is installed in C:\ProgramData\Anaconda3\lib\site-packages\numpy
Python version 3.7.1 (default, Dec 10 2018, 22:54:23) [MSC v.1915 64 bit (AMD64)]
nose version 1.3.7
Wrong parameter 1 in LAPACKE_chetrs_rook
Wrong parameter 1 in LAPACKE_chetrs_rook
Wrong parameter 1 in LAPACKE_chetrs_rook
Wrong parameter 1 in LAPACKE_chetrs_rook
Wrong parameter 1 in LAPACKE_chetrs_rook
Wrong parameter 1 in LAPACKE_chetrs_rook
Wrong parameter 1 in LAPACKE_chetrs_rook
Wrong parameter 1 in LAPACKE_chetrs_rook
Wrong parameter 1 in LAPACKE_chetrs_rook
Wrong parameter 1 in LAPACKE_dsytrs
Wrong parameter 1 in LAPACKE_cheevx_work
Wrong parameter 1 in LAPACKE_checon
Wrong parameter 1 in LAPACKE_cheevx_work
Wrong parameter 1 in LAPACKE_cggesx_work
Wrong parameter 1 in LAPACKE_checon
.C:\ProgramData\Anaconda3\lib\site-packages\slycot\tests\test.py:16: PendingDeprecationWarning: the matrix subclass is not the recommended way to represent matrices or deal with linear algebra (see https://docs.scipy.org/doc/numpy/user/numpy-for-matlab-users.html). Please adjust your code to use regular ndarray.
  a = matrix("-2 0.5;-1.6 -5")
Wrong parameter 1 in LAPACKE_chetrs_rook
Wrong parameter 1 in LAPACKE_chetrs_rook
Wrong parameter 1 in LAPACKE_chetrs_rook
Wrong parameter 1 in LAPACKE_chetrs_rook
Wrong parameter 1 in LAPACKE_dgeesx
Wrong parameter 1 in LAPACKE_dgeesx
Wrong parameter 1 in LAPACKE_dgeesx
Wrong parameter 1 in LAPACKE_dgeesx
Wrong parameter 1 in LAPACKE_dsytrs
Wrong parameter 1 in LAPACKE_dsytrs
Wrong parameter 1 in LAPACKE_dpoequ

У меня явно проблема с LAPACKE, но я не могу ее найти.

Заранее благодарю за помощь!

...