Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MOESP and N4SID not always working #8

Open
Jelmer44 opened this issue Jun 12, 2019 · 1 comment
Open

MOESP and N4SID not always working #8

Jelmer44 opened this issue Jun 12, 2019 · 1 comment

Comments

@Jelmer44
Copy link

I'm trying to use this for my thesis, but the MOESP and N4SID algorithms seem not to give the right values. I'm using an input u in the form u = 5 * sin(0.3t) computing the output through scipy.signal.dlsim and my matrices have the form A = [0 1;-a -b] B = [0;1], C= [0, 1], D=0 with a and b between 0 and 2.
The generated matrices by the MOESP and N4SID are very far off, I'm not an experted in this field, do you have any idea why it is not working? They are accurate when I'm using an input of random variables between [-0.5,0.5].

@CPCLAB-UNIPI
Copy link
Owner

Dear Jelmer44,
sorry for the delay in our reply.

To answer your issue please consider two different aspects which make your generated matrices different from the actual ones.

  1. sinusoidal inputs are surely less informative than specific input signals as PRBS (pseudo-random binary signal) or GBN (generalized binary noise), as they only excite your system at the unique frequency of the input (0.3 in your case).

  2. In addition, note that when you are identifying a input-output model (e.g., transfer functions TF), there is only one correct model which corresponds exactly to your actual dynamics.
    Otherwise, when managing with state-space (SS) models, there are infinite similar models which correspond to your actual dynamics.
    Note that transformation from SS to TF is unique, while the opposite in not, as there are infinite transformations called "realizations" and infinite SS systems similar by a base-matrix T.

Consider the following Input-output equivalence between two state-space models (with same number of states):
original system
xk+1 = Axk + Buk
yk = Cxk + Duk

similar system
with zk = T xk
zk+1 = TAT^{-1}zk + TBuk = At zk + Bt uk
yk = CT^{-1}zk + Duk = Ct zk + D uk

Invariant parameters:
D does not change
A and At have same eigenvalues (poles of G(z))
Gain matrix G(1) = C(I - A)^{-1}B + D is the same Gt (1) = Ct (I - At)^{-1}Bt + Dt

Therefore, your identified systems may be all similar to the actual one.

Hoping to have clarified all your doubts.
Best

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants