System Identification using process models with more than 3 poles and/or 2 zeros and delays

8 views (last 30 days)
Hi,
I am trying to find the best continuous-time process model to fit an input-output set of data. However, the idproc command in Matlab can only build models with at most 3 poles, 1 zero and a delay. I would like to build a model with at least 3 poles, 2 zeros and a delay that I can then use with the pem command.
I attempted to solve this problem by using a grey-box model (idnlgrey). I managed to make it work but way in which I implemented the delay made the code really really slow.
I was wondering if there is a better way to do this which would allow me to pass in the delay as another non-fixed parameter.
Thanks in advance,
Renato

Answers (2)

Rajiv Singh
Rajiv Singh on 20 Jul 2011
Delay estimation, I am afraid, does make things difficult. I am guessing your ODE file is returning discretized values of state-space matrices where the order (size of A) depends upon the delay value? Grey box models weren't quite designed to handle variable number of states. If you are using some other approach, please describe.
In general when you have a CT model with free delay, you end up, one way or another, with having to compute the derivative of the model's time domain response w.r.t delay (if you don't do it explicitly, the software will try to do that). This is a nontrivial exercise with a risk of getting bad results because of noise amplification. Using optimization schemes that rely on first order derivatives of response w.r.t system parameters (approach used in system identification toolbox), this is going to remain a difficult task.
Some more robust alternatives are:
(1) Use frequency domain data for estimation: if you can somehow obtain a good frequency domain representation of your data, you may have a better luck with handling delays.
(2) Use fixed delay value. You can obtain the delay value before hand by one of the following techniques:
2a. Use physical insight (experimental evidence of signal propagation delay)
2b. Use non parametric analysis. In particular, compute the impulse response from data and see after how many samples from zero time does the response become significant.
2c. Use DELAYEST command. Using an underlying ARX estimation, DELAYEST tries to determine an optimal delay value for a given model order (orders of numerator and denominator). Note that delay isn't really independent of model orders. For more information, see the following demo:
Convert the discrete sample delay thus obtained into physical delay by using the knowledge of sample time and input intersample behavior. In my experience, DELAYEST (or the closely associated technique in ARXSTRUC/SELSTRUC) often produces good results.
  1 Comment
Renato
Renato on 20 Jul 2011
Hi Rajiv,
Thanks for the answer. My grey-box model approach involved passing the input as a vector into the ODE and interpolating at time t-Td in order to get the value of the delayed input.
Here's an example of my m-file for a 1st order model with delay
function [dx y] = ODE1p(t,x,u,tp,K,td,varargin)
%Output Equation
y = x;
if ~isempty(varargin)
tu=varargin{1}(1); %tu is the time vector for the input
tu=tu{:};
U = varargin{1}(2); %U is the input vector
U=U{:};
end
if t-td <= eps(0)
input=0; %initial conditions are U=0
else
input=interp1(tu,U,t-td);
end
dx = -x*tp+K*input;
end
I was hoping there is a way to estimate the delay as done with the other parameters since I am dealing with over 60 experiments, each with potentially a slightly different delay.

Sign in to comment.


Rajiv Singh
Rajiv Singh on 20 Jul 2011
I did not realize you were using the nonlinear grey box approach. Your attempt looks reasonable to me and I can't think immediately think of anything better. Some thoughts:
A quick test shows that the time consumed by interp1 is proportional to the size of existing data records. If tu and U are quite long, this operation could take some time. In place of interpolation, could you exploit your knowledge of the input intersample behavior (constant or linearly increasing) of your input data? Then, you need to look up no more than two values to determine the in-between value.
(a potential risk) If your input has ZOH behavior, the input will not have a smooth dependence on the delay thus leading to unexpected results.

Community Treasure Hunt

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

Start Hunting!