CPCLAB-UNIPI / SIPPY

Systems Identification Package for PYthon
GNU Lesser General Public License v3.0
274 stars 92 forks source link

Most examples do not work #3

Closed CameronDevine closed 5 years ago

CameronDevine commented 6 years ago

I attempted to run the examples, but I could only get the SS.py script to run. There appears to be a problem with the shape of one of the outputs of lsim. The error messages can be found here, https://travis-ci.org/CameronDevine/SIPPY/jobs/413816972

don4get commented 5 years ago

Same here, is there something I can do to help you solve these examples? lsim is not part of control but control.matlab. I made that move and then I got this error:


File "SIPPY/Examples/ARMAX_MIMO.py", line 121, in <module>
    err_outputH[0,:], Time, Xsim = cnt.lsim(H_sample1, err_inputH[0,:], Time)
ValueError: could not broadcast input array from shape (401,1) into shape (401)
CPCLAB-UNIPI commented 5 years ago

Thanks to everyone for pointing out this problem. We had studied these problems during the past months and it seems that the control package is producing this error. Depending on the version you have installed lsim can be found in control.lsim or in control.matlab.lsim. We are working on a generalization of the code, to avoid this issue.

CameronDevine commented 5 years ago

The following bit of code should fix the issue,

import control as cnt
if not hasattr(cnt, 'lsim'):
   from control.matlab import lsim
   cnt.lsim = lsim
willycamps commented 5 years ago

The following bit of code should fix the issue,

import control as cnt
if not hasattr(cnt, 'lsim'):
   from control.matlab import lsim
   cnt.lsim = lsim

It works perfect, thanks!

CPCLAB-UNIPI commented 5 years ago

Closing this issue due to recent merge.