Is there a way to output the final simulated time-response from procest()?
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
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
0 comentarios
Respuesta aceptada
Rajiv Singh
el 15 de Mayo de 2013
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)
0 comentarios
Más respuestas (2)
Rajiv Singh
el 15 de Mayo de 2013
Hi James, If the estimation focus is "simulation", you should not really see this difference. What MATLAB release are you seeing this in?
1 comentario
Arto Kivila
el 15 de Mayo de 2013
Editada: Arto Kivila
el 15 de Mayo de 2013
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
Ver también
Categorías
Más información sobre Linear Model Identification en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!