plotting state space models gives two different results

10 views (last 30 days)
Hey all,
I identified a discretized second order state space model with a discrete second order state space model, just to check if my code is working before I add noise. But, when I plot the identified model as following: bode(ss_ms)
(ms stands for multisine input)
i get something totally different than when I plot it as following: bode(ss_ms.A, ss_ms.B, ss_ms.C, ss_ms.D)
The second way gives me a frequency response which is the same as the original system. However, if I use the "compare" command to see the goodness of fit, the ss_ms system fits 100% to the validation data.
This is not really a problem, as I can use the second method to plot my system, but I can't do that when I identify ARX or ARMAX models. If I plot those models: bode(arx_ms) bode(armax_ms)
I get the same result as bode(ss_ms). The "compare" command results in 100% fit for all the models.
What am I doing wrong?
ps: when I used lsim to simulate the identification data, both ways of plotting the transfer functions resulted in the same plot. Now I'm using the more correct dlsim (because I use discrete models).
Thank you in advance!

Answers (1)

Rajiv Singh
Rajiv Singh on 13 Dec 2012
Not sure what your question is. But some notes: - COMPARE results are in general not reproducible by lsim unless you make sure to use the same initial conditions are used by COMPARE. See:
- No need to use DLSIM; LSIM can simulate continuous as well as discrete-time systems. For identified models (idss) you can also use SIM.
- BODE(A,B,C,D) is an obsolete syntax. It plots the frequency response of the continuous-time system ss(A,B,C,D). If you identified a discrete-time model, the correct command to use is BODE(MODEL), where MODEL is the identified model.
Please revisit the sample time of identified systems and that of the expected (?) system. It seems you are mixing these things.

Categories

Find more on Linear Model Identification in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!