Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

To resolve issues starting MATLAB on Mac OS X 10.10 (Yosemite) visit: http://www.mathworks.com/matlabcentral/answers/159016

System identification tool and Simulink

Asked by Markus on 22 Aug 2012

Hi guys,

i have create some estimation models in the SI Tool. They have a fitness of 94%. Also the fitness ot my validation data is not bad. Like 82%. This is the result of a Hammerstein-Wiener-Model.

No i want this result simulate in Simulink. I use the block for Hammerstein-Wiener-Models, the inputs, and a scope for the output.

Why i get a differ of the simulationresult and SI-Tool result??

Has anyone an idea why the result are not same??

Marcus

0 Comments

Markus

2 Answers

Answer by Arkadiy Turevskiy on 22 Aug 2012
Edited by Arkadiy Turevskiy on 22 Aug 2012
Accepted answer

Most likely this happens due to initial conditions. In the GUI and in the COMPARE function, the fit is computed by estimating the initial conditions (by default) that maximize the fit to the data. In Simulink, you have to enter the appropriate initial conditions yourself based on your knowledge of the state of the system at the start of the simulation. By default, initial conditions are set to zero in the Simulink block.

See the doc for idnlhw, specifically the section "idnlhw States" for information on how to set initial conditions.

HTH.

Arkadiy

0 Comments

Arkadiy Turevskiy
Answer by Markus on 24 Aug 2012

Hi Arkadiy, thx for ur answer. Great!! It works with the command of findstates.

But i have now another problem. Mybe i have only a thought blocking:-). I hope u can explain it to me.

i set the inital conditons with the findstates command. x0 = findstates(mhw1,z1,[],'maxiter',50);

If i started the simulation i get the same results like the SI-tool. But it should also applied to other datasets.

I replace the dataset z1 against an other dataset called z2. If i started the simulation again i get not used results. I have to set new intital conditions for a new dataset. Is it right??

But how it works if i used this model for a live simulation forecast?

1 Comment

Rajiv Singh on 7 Sep 2012

Initial conditions should not be thought of as a property of the model. It is really the effect of the environment on the initial set up of the model. In a real-life application, you should think about what conditions existed before the model simulation started, or what type of assumptions you can make about them. Some common choices are:

 - system at rest (zero)
 - system at steady state equilibrium (constant I/o values)
 - system at some operating point specified in various ways; use  isnlhw/findop to transform your specifications to numerical values of states.

If the goal is to pick initial states that maximize the fit to some measured output signal for a given input signal, then FINDSTATES is your friend.

Markus

Contact us