Is there a way to output the final simulated time-response from procest()?

조회 수: 1 (최근 30일)
I am using procest() to estimate values in a transfer function based on experimental input/output data. The transfer function contains a time delay of around 0.2 seconds.
After procest() is finished, I use compare() to look at the experimental time response vs. the simulated response of the newly-estimated transfer function. The problem: procest() gives a FitPercent around 95% for the model, but compare() gives a terrible FitPercent (-13%). This seems to be because the system doesn't respond at all for 0.2 seconds, and the signal develops an offset by that time. I assume that the procest() function simulates the time response differently -- maybe it does some calculation of initial conditions, and does not assume that there was no input to the system before the time vectors you give it. Since the resulting model is not a state-space model, I cannot specify InitialCondition to the compare() or lsim() functions ...
Basically, I want to access the simulated time response from procest() that gives the 95% fit. Or some other method of generating this signal. Thank you for your time,
-James

채택된 답변

Rajiv Singh
Rajiv Singh 2013년 5월 15일
Ah, I see it now: it is the InputOffset that you estimated or supplied during process model estimation but perhaps did not specify for the compare plot. Use compareOptions to specify InputOffset for compare plot:
opt = compareOptions('InputOffset', sys.Report.Parameters.InputOffset);
compare(data, sys, opt)

추가 답변 (2개)

Rajiv Singh
Rajiv Singh 2013년 5월 15일
Hi James, If the estimation focus is "simulation", you should not really see this difference. What MATLAB release are you seeing this in?
  댓글 수: 1
Arto Kivila
Arto Kivila 2013년 5월 15일
편집: Arto Kivila 2013년 5월 15일
Hi, I am working together with James on this problem. We are using Matlab 2013a. Switching the estimation focus to 'simulation' did not change the output of the procest function.
So here is what we have done: %it is a SISO system
sys=procest(...)
Fit to estimation data: 94.39% (simulation focus)
and if we try to use compare(iddata(),sys) the output lines are very different and the fit is like -15%.
using y=lsim(sys,u,t) and y=predict(sys,data,1) give the same shape that could be seen on the compare function output.
When I went into the source files: I found on line 343 of Itidata.m [yp, x0] = predict(D, IOData, K, Init, varargin{:}); ymeas = IOData.y; and when I added save('data','ymeas','yp') and later plotted those they match up perfectly.
I could also see that the model in D is the same one that the procest gave out.
I can get the data to match up if I use the same inputoffset as is used in the Itidata.m files, however I am unsure where it comes form or how could I get it manually.
Thank you very much for your help! Arto

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


James Potter
James Potter 2013년 5월 16일
Perfect, I think that solves the problem. Thanks very much for the help. -James

카테고리

Help CenterFile Exchange에서 Linear Model Identification에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by