%
% Figure 18.7 - Determining a Dynamic Matrix
%
%
% load step up/down data
%
clear all;
load data_18_3_up;
su = x;
load data_18_3_down;
sd = x;
clear x;
delu = 0.1;
%
figure;
plot( su(:,1), su(:,2) );
set( gca, 'fontsize', 16 );
xlabel( 'Time in minutes' );
ylabel( 'Sensor signals' );
hold on;
plot( sd(:,1), sd(:,2) );
%
% select size of prediction vector and control
% interval - np*delt should encompass the step
% response
%
np = 30;
delt = 10;
%
a = dynamic_matrix( su, sd, delu, np, delt );
save dmc a
%
yo = mean( [ su(1,2); sd(1,2) ] );
u = [ delu; zeros(np-1,1) ];
plot( delt*(1:np), yo+a*u, 'o' );
plot( delt*(1:np), yo-a*u, 'o' );
hold off;
%
%print -f1 -deps2 fig18-7a.eps
%
