User`s guide

5 ODE P ara meter Estimation (Grey-Box Modeling)
1 Create the M-le mynoise that computes the state-space matrices as a
function of the ve unknown parameters and the auxiliary variable that
represents the known variance
R2.
Note R2 is treated as an a ux il iary variable rather than assigned a value
in the M-le to let you change this value directly at the comma n d line
and avoid editing the M-le.
function [A,B, C,D, K,x0] = mynoise(par,T,aux)
R2 = aux(1); % Known measurement noise variance
A = [par(1) par(2);1 0];
B = [1;0];
C = [par(3) par(4)];
D=0;
R1 = [par(5) 0;0 0];
[est,K] = kalman(ss(A,eye(2),C,0,T),R1,R2);
% Uses Control System Toolbox product
%u=[]
x0 = [0;0];
2 Specify initial guesses for the unknown parameter values and the auxiliary
parameter value
R2:
par1 = 0.1; % Initial guess for A(1,1)
par2 = -2; % Initial guess for A(1, 2)
par3 = 1; % Initial guess for C(1, 1)
par4 = 3; % Initial guess for C(1, 2)
par5 = 0.2; % Initial guess for R1(1,1)
Pvec = [par1; par2; par3; par4; par5]
auxVal = 1; % R2=1
3 Construct an idgrey model using the m ynoi se M-le:
Minit = idgrey('mynoise',Pvec,'d',auxVal);
The third input argum ent 'd' species a discrete-time system.
4 Estimate the model parameter values from data:
5-14