simulation with ARX models
20 次查看(过去 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 中查找有关 Nonlinear ARX Models 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!