www.gusucode.com > ident 案例代码 matlab源码程序 > ident/EstimatingProcessModelsWithFreeParametersExample.m

    %% Estimate Process Models with Free Parameters
%%
% This example shows how to estimate the parameters of a first-order
% process model: 
% 
% $$G(s) = \frac{{{K_p}}}{{1 + s{T_{p1}}}}{e^{ - s{T_d}}}$$
%
% This process has two inputs and the response from each input is estimated
% by a first-order process model. All parameters are free to vary. 
%%
% Load estimation data.

% Copyright 2015 The MathWorks, Inc.

load co2data
%%
% Specify known sample time of 0.5 min.
Ts = 0.5;
%%
% Split data set into estimation data |ze| and validation data |zv|.
ze = iddata(Output_exp1,Input_exp1,Ts,...
                        'TimeUnit','min');
zv = iddata(Output_exp2,Input_exp2,Ts,...
                        'TimeUnit','min');
%%
% Estimate model with one pole, a delay, and a first-order disturbance
% component. The data contains known offsets. Specify them using the
% |InputOffset| and |OutputOffset| options.
opt = procestOptions;
opt.InputOffset = [170;50];
opt.OutputOffset = -45;
opt.Display = 'on';
opt.DisturbanceModel = 'arma1';
m = procest(ze,'p1d',opt)
%%
% Use dot notation to get the value of any model parameter. For example,
% get the value of dc gain parameter |Kp| .
m.Kp