simulation with ARX models

조회 수: 9 (최근 30일)
Filippo
Filippo 2013년 12월 5일
답변: Luis Freire 2017년 6월 1일
Hi, using the system identification tool, I've created a model SISO arx[400 400 1], I've exported this model in the workspace, and now I would like to simulate this model. I wrote in matlab command window something like: >>simulation=sim(arx4004001,[input]); The problem is that, plotting this simulation I expected something like what i can see in the model output from SID, but it is completely different. Maybe the sintax is wrong? can someone help me please?

답변 (2개)

Arkadiy Turevskiy
Arkadiy Turevskiy 2013년 12월 9일
Not 100% clear what you mean, but my guess is that you want the result of what you are doing at command line to look like the "model output" plot in the GUI, and what you are getting is something different.
If that is the case, then most likely the issue is the initial conditions for the model. The GUI automatically estimates initial conditions from data and uses them in the plot.
When you use sim at the command line, the initial conditions are set to 0 by default.
This is explained here.
So to get the same plot for sim as in the GUI, you need to estimate and use initial conditions.
here is an example of what you could do:
load dryer2 % example data file shipping with System Identification Toolbox
dry = iddata(y2,u2,0.08); % create iddata object
arxmodel=arx(dry,[4 4 1]); %estimate arx441 model - use your own order as needed
x0=findstates(arxmodel,dry); % find initial condition
OPT = simOptions('InitialCondition',x0); % specify simulation option to use init.cond.
ssmodel=idss(arxmodel); % convert the model to idss to be able to specify initial condition
sim(ssmodel,dry,OPT) % simulate with initial condition
  댓글 수: 2
Filippo
Filippo 2013년 12월 10일
Thank you Arkadiy, you exacly understand which was my problem.
I've tryed the solution you gave me, but it's not working, maybe because I'm using the MATLAB version r2007a.
When I try the function findstates, I get the error: ??? Undefined function or method 'findstates' for input arguments of type 'idpoly'.
I don't know if this is about my old version or licences.
Can you please help me again
Arkadiy Turevskiy
Arkadiy Turevskiy 2013년 12월 10일
In that case please contact technical support, maybe they can help.

댓글을 달려면 로그인하십시오.


Luis Freire
Luis Freire 2017년 6월 1일
You can also try with the lsim function from the control toolbox, you will be able to simulate the response of a model given a bunch of imput parameters.

카테고리

Help CenterFile Exchange에서 Data Preparation Basics에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by