simulation with ARX models
조회 수: 9 (최근 30일)
이전 댓글 표시
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?
댓글 수: 0
답변 (2개)
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.
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
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.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Data Preparation Basics에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!