Code covered by the BSD License  

Highlights from
System Identification using GA with a GUI interface

image thumbnail

System Identification using GA with a GUI interface

by

 

28 Jun 2006 (Updated )

Idnetifying ARX model of a system using Genetic Algorithms with a GUI interface and compare it to Le

arx2(y, u, na, nb, nk, error, pop, mutation, no_of_generations)
function [A B] = arx2(y, u, na, nb, nk, error, pop, mutation, no_of_generations)


%% This function estimates the ARX model parameters
% [A B o] = arx2(y, u, na, nb, nk)
% y is the output, u is the input
% na nb nk   ==> orders   
% A, B       ==>  ARX model parameters

global Na Nb Nk Y U
Na = na; Nb = nb; Nk = nk; Y = y; U = u;

% consistency check
if size(Y, 1) < Na || size(U, 1) < Nb
    sprintf('Needs more input or output data')
    A = []; B = []; return
end
if size(U, 1) ~= size(Y, 1)
    sprintf('number of input and output data must be the same')
    A = []; B = []; return
end

% calling GA function
[A B] = genalg(error, pop, mutation, no_of_generations);
% o = zeros(size(Y,1),1);
% for t = max(Na+1,Nb+Nk) : size(Y)
%     o(t) = -a*o(t-Na:t-1) + b*U(t-Nk-Nb+1:t-Nk); % ARX model
% end

Contact us