%  Example 3.6.  Generates the steady-state output correlation matrix.
clear
%  Input the state model matrices.
A=[0  1
   0 -1];
B=[ 0
   0.1];
C=[1 0];
%  Generate a state feedback controller for this system.
p=[-1-j -1+j];
K=place(A,B,p)
%  Generate the closed loop state model.
Acl=A-B*K
Bcl=-B*K
Ccl=C
%  Compute the closed loop transfer function model.
[nu1,de]=ss2tf(Acl,Bcl,Ccl,[0 0],1)
[nu2,de]=ss2tf(Acl,Bcl,Ccl,[0 0],2)
%  Input the noise spectral density matrix.
Sw=diag([.0025 .05]);
%  Compute for the steady-state, state correlation matrix.
Sigmax=lyap(Acl,Bcl*Sw*Bcl');
%  Compute for the steady-state, output correlation matrix.
Sigmay=C*Sigmax*C';
%  Compute the standard deviation of the output (in degrees).
sigmay=sqrt(Sigmay);
sigmaydeg=57.3*sigmay
