RLSE2ndOrderTF - K ThetaHat = ThetaHat + K*(yk -...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
% Recursive least squared error estimator for a SISO system % with TF H(z) = b/(z+a); assume that there is a bias c function Out = RLSE2ndOrderTF(In) f ukm1 = In(1); ukm2 = In(2); % Y = [y(k) y(k-1) y(k-2)] yk = In(3); ykm1 = In(4); % U = [u(k) u(k-1) u(k-2)] % ykm2 = In(5); Lamda = In(6); ThetaHat(:,1)= In(7:11); % Previous estimator state [a1 a2 b0 b1 c]' P = [In(12:16) In(17:21) In(22:26) In(27:31) In(32:36)]; % three columns of P P P = (P + P')/2; % ensure that P is symmetrical s H = [-ykm1 -ykm2 ukm1 ukm2 1]; K = P*H'/(H*P*H'+Lamda);
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: K ThetaHat = ThetaHat + K*(yk - H*ThetaHat); P = (P - K*H*P)/Lamda; P % Check on the bounds of parameters so that the estimated values are not ridiculous a1 = ThetaHat(1); a2 = ThetaHat(2); b0 = ThetaHat(3); b1 = ThetaHat(4); c = ThetaHat(5); %if (a1 < -2) | (a1 > -1), a1 = -2; end; %if (a2 > 1) | (a2 < a1-1) | (a2 < -a1-1), a2 = 0.5; end; if (a1 < -2.0), a1 = -1.0; end; i ThetaHat = [a1; a2; b0; b1; c]; T Out = [ThetaHat; P(:,1); P(:,2); P(:,3); P(:,4); P(:,5)];...
View Full Document

This note was uploaded on 04/17/2011 for the course SYS 635 taught by Professor Re during the Spring '11 term at Albany College of Pharmacy and Health Sciences.

Ask a homework question - tutors are online