PEM grey box using merged data.
Mostrar comentarios más antiguos
I am trying to understand exactly the underlying theory that pem uses working with merged data. Specifically, I am using a grey box model where the initial conditions and Kalman gain is parameterized by me. Is it just performing the identification separately and then combining the result or is it estimated in one run with two sets of initial conditions. Code is included as an example.
%%Define system
A = [0.8 0.1; 0.1 0.7];
B = [0.2; 0.7];
C = [1 0];
D = 0;
Q = 0.1;
R = 0.1;
Ts = 1;
%%Simulate the system twice
n = 200;
y = cell(2, 1);
y{1} = zeros(1, n);
y{2} = y{1};
u = [0*ones(1, 20), 1*ones(1, 30), 2*ones(1, 20), -1*ones(1, 20), 0*ones(1, 30), 2*ones(1, 20), 0*ones(1, 30), -2*ones(1, 30)];
x = zeros(2, n + 1);
for i = 1:2;
if( i == 1 )
x(:, 1) = [4; 4];
else
x(:, 1) = [-1; -1];
end
for k = 1:n;
y{i}(k) = C*x(:, k) + D*u(:, k) + sqrt(R)*randn;
x(:, k + 1) = A*x(:, k) + B*u(:, k) + sqrt(Q)*randn;
end
end
%%plot output
plot([y{1}', y{2}']);
%%gather data
data1 = iddata(y{1}', u', Ts);
data2 = iddata(y{2}', u', Ts);
data_all = merge(data1, data2);
%%identify
model1 = idgrey('sysmodel', zeros(1, 6), 'd');
options = greyestOptions('Display', 'On', 'Focus', 'Prediction');
options.SearchOption.MaxIter = 1000;
model_out = pem(data_all, model1, options);%, 'OutputWeight', [1 0; 0 0]);
MODEL FUNCTION
function [A, B, C, D, K, X0] = sysmodel(phi, Ts, extra)
%SYSMODEL Summary of this function goes here
% Detailed explanation goes here
A = [phi(1) 0.1; 0.1 phi(2)];
B = [0.2; 0.7];
C = [1 0];
D = 0;
K = [phi(3); phi(4)];
X0 = [phi(5); phi(6)];
end
Bump.
2 comentarios
Walter Roberson
el 27 de Ag. de 2012
Is "pem" the Prediction Error Method in this context?
Mike
el 27 de Ag. de 2012
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Linear Model Identification en Centro de ayuda y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!