%This script produces a plot of x_1 and its estimate in Example 3.12.
% The reduced-order estimator is in the loop.

% written by S. H. Zak on Nov. 30, 2000

tspan=[0 10];
x0=[1 .2 -.1 0 0]';
%x0=[4 2 -1 0 0]';
[t,x]=ode45('comp_ro',tspan,x0);
z1=[x(:,4:5) 0.02*x(:,2)]*[-0.5493 0.7586 -0.2507]';
plot(t,x(:,1),t,z1,'--')
set(gca,'Fontsize',12)
xlabel('Time (sec)','Fontsize',12)
title('A plot of x_1 and its estimate (reduced-order estimator) in Example 3.12.','Fontsize',12)
legend('{\it x}_1','{\it x}_1-estimate')
grid
