why does the estimated state-space model using n4sid not show the same output in Simulink?

I used Matlab system identification toolbox to estimate a state-space model for a MISO system using the n4sid algorithm, I created a state-space (idss) to be used with the idss block in Simulink. The problem is that the obtained output in Simulink does not look like the one which is shown when using the compare command and taking into account the intial condition (x0).
does anyone have an idea why the output in Simulink is not the same as in compare?
thanks in advance
F.B

1 Comment

Well, this is a late answer. You probably have found the solution. If not, I choose to mention one thing: Have you defined deviation variables as the data you're dealing with?

Sign in to comment.

Answers (1)

Without much knowledge of your system, some of the questions that may be worth looking into are:
  1. Is the input provided to the Simulink model the same as the input you used for system identification?
  2. If the input signal is the same, was the sample time of that signal the same? I sometimes got tripped up because I accidentally set the data sample time to 1 second instead of my actual sample time.
  3. Are the Simulink solver settings not in a good place? That is, if you reduce the simulation time-step, tighten the tolerances, etc. do the simulation results change significantly?
  4. Is your Simulink scope cutting off a significant amount of data? The default settings in scopes make it so that you only retain the last couple thousand data points, which can make the results look bad. Check the values on the time axis to see if they indeed capture the whole simulation time.
Also, based on your question, I'm guessing you already tried going through the 3-step process mentioned in the Initial states (state-space only: idss, idgrey) section in the link below, right?
- Sebastian

Asked:

on 8 Jun 2015

Community Treasure Hunt

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

Start Hunting!