Code covered by the BSD License

# Reduced-order inf. horizon time-inv. discr.-time LQG control for systems with white parameters

### Gerard Van Willigenburg (view profile)

08 Jun 2008 (Updated )

Optimal reduced-order compensation of discrete-time linear systems with white parameters

examps.m
```% EXAMPS: Examples from the paper
clear;

%Initialization
global beta nc
opt=[]; opt(1)=1e-7; opt(4)=50; opt(5)=0.5; opt(6)=1;

% Use SDOPE to compute reduced-order compensators for example 1
for beta=[5e-4 5e-3];
for nc=5:-1:1
[f,k,l,sigp,sigs,spr,pt,st,ph,sh,trps]=sprotin1('ex1w',opt);
disp(' '); disp(['beta=' num2str(beta) ' nc=' num2str(nc) ' example 1 with SDOPE']);
disp([sigp, sigs]);
end
end

% Use CDOPE to compute erroneous reduced-order compensators for example 1
% Several different algorithm initializations used
beta=5e-4; nc=3; z5=zeros(5); pshi=diag([1 1 1 0 0]);
[f,k,l,sigp,sigs,spr,pt,st,ph,sh,trps]=sprotino('ex1w',opt,z5,z5,pshi,pshi);
disp(' '); disp(['beta=' num2str(beta) ' nc=' num2str(nc) ' example 1 with CDOPE']);
disp([sigp, sigs]);

pshi=diag([1 0 1 1 0]);
[f,k,l,sigp,sigs,spr,pt,st,ph,sh,trps]=sprotino('ex1w',opt,z5,z5,pshi,pshi);
disp(' '); disp(['beta=' num2str(beta) ' nc=' num2str(nc) ' example 1 with CDOPE']);
disp([sigp, sigs]);

pshi=diag([1 1 0 1 0]);
[f,k,l,sigp,sigs,spr,pt,st,ph,sh,trps]=sprotino('ex1w',opt,z5,z5,pshi,pshi);
disp(' '); disp(['beta=' num2str(beta) ' nc=' num2str(nc) ' example 1 with CDOPE']);
disp([sigp, sigs]);

% Use SDOPE to compute reduced-order compensators for example 2, beta = 0
disp(' ');disp(' Example 2 with SDOPE');
beta=0; nc=1; opt(6)=2;
randn('seed',1); rand('seed',1);
[f,k,l,sigp,sigs,spr,pt,st,ph,sh,trps]=sprotin1('ex2w',opt);
disp(['beta=' num2str(beta) ' nc=' num2str(nc) ' first solution:']);
disp([sigp, sigs]);
randn('seed',9); rand('seed',9);
[f,k,l,sigp,sigs,spr,pt,st,ph,sh,trps]=sprotin1('ex2w',opt);
disp(['beta=' num2str(beta) ' nc=' num2str(nc) ' second solution:']);
disp([sigp, sigs]);

% Use SDOPE to compute reduced-order compensators for example 2, beta = 5e-2
beta=5e-2; nc=1;
randn('seed',1); rand('seed',1);
[f,k,l,sigp,sigs,spr,pt,st,ph,sh,trps]=sprotin1('ex2w',opt);
disp(['beta=' num2str(beta) ' nc=' num2str(nc) ' first solution:']);
disp([sigp, sigs]);
randn('seed',9); rand('seed',9);
[f,k,l,sigp,sigs,spr,pt,st,ph,sh,trps]=sprotin1('ex2w',opt);
disp(['beta=' num2str(beta) ' nc=' num2str(nc) ' second solution:']);
disp([sigp, sigs]);```