CPCLAB-UNIPI / SIPPY

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

Cannot reproduce MIMO StateSpace result. #21

Closed nrgopalrao closed 4 years ago

nrgopalrao commented 4 years ago

Dear Sippy teams,

I have tried reproducing the MIMO example present in your publication but unfortunately, Sippy returns matrices of different order. If I change the 'SS_fixed_order' parameter, I am able to obtain matrices of required order but the error between SIPPY result and plant model is very high and does not look like what you have presented in the research paper. I am attaching the code I have used for your perusal. Request you to kindly have a look and advise changes.

Thanks and Regards, Gopal.` MIMO_SS.txt

`

CPCLAB-UNIPI commented 4 years ago

Dear Gopal,

You can choose the correct order with 'SS_fixed_order=3' .

The identification proposed in the paper is closed-loop, therefore it is different from that simulated by you.

You have small typo errors in the code as follows:

"fset.white_noise_var: this function generates a white noise matrix (rows with zero mean). The input arguments are:

  1. L: size (number of columns of the returned matrix);
  2. Var: variance list; e.g. the following command line: noise=white_noise_var(100,[1,2]) returns a matrix that has 100 columns and two-row vectors with variances 1 and 2"

Var= [0.15, 0.15] # you have 2 outputs noise = fset.white_noise_var(npts, Var)

Consider that lower variances are used in the paper.

"x,y_hat=SS_lsim_innovation_form(A,B,C,D,K,y,u,x0)"

xid, yid = fsetSIM.SS_lsim_innovation_form(sys_id_p.A, sys_id_p.B,\ sys_id_p.C, sys_id_p.D,\ sys_id_p.K, y_tot, U, sys_id_p.x0)

The order of U and Y is reversed.

Hoping to have answered your questions. Best Wishes, the Sippy teams.

nrgopalrao commented 4 years ago

Hi SIPPY teams,

Thank you for your response. After making the changes you mentioned, the script works as expected. Appreciate the help. I close this issue now.

Regards, Gopal