CPCLAB-UNIPI / SIPPY

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

SIMO/SISO model verification with functionset.validation #42

Closed Ferus-TUB closed 2 years ago

Ferus-TUB commented 2 years ago

Hello,

I had / have an issue regarding the validation of my armax model using the functionsetSIM.validation method. It said that my input Data had the wrong shape (N, 1) and that he expected (N,) or (1,N). This message stayed the same even when I changed the shape. So I figured your code reshapes my Input Data in a way that it doesnt work for a Single Input System or I'm using your lib wrong A simple np.reshape in front of cnt.lsim in line 196 and the other in 219 could fix that for the single input case. So a simple if statement could work.

PS: First time posting an issue, so I'm sorry in advance if I left some critical info.

Best regards, Niels

CPCLAB-UNIPI commented 2 years ago

Dear Niels, thank you for your interest in SIPPY. Some notes about your issue:

Please let us know which version of control you have (control.__version__) and if updating it solves the problem.

Best regards,

SIPPY teams

Ferus-TUB commented 2 years ago

Thank you for the advice but now I got a new error. ValueError: could not broadcast input array from shape (1389,) into shape (1390,) The example works now but in my code for some reason the program simulates (lsim) only till step 1389.

Ferus-TUB commented 2 years ago

I solved it. It was a numpy rounding error. Instead of 1.39 numpy uses 1.38999999 and the dlsim method uses np.floor to calculate the last step which compromises my result.

RBdC commented 2 years ago

OK, good!