close all
clear all
clc
[Pstruct,Pnormal,P,Obj0,Ts,n,m,p] = PlantS00;
%0th order Youla parameter, easily obtained with LMIs(Variables1) or a simple line search:
DQmix = -9.59;
ObjBestDQ = 119.4;%Corresponding multi-objective value.
QnewZ = ss([],[],[],DQmix,Ts);
globopt = 102.9799;%A priori known value for the global optimum, to draw the rate of convergence towards it (the smallest value found was 102.97996).
for i=1:25
%FIR designs of [S00].
t0 = clock;
[QFIR,ObjBFir(i)] = FIR(Pstruct,i);
tFIR(i)=etime(clock,t0);
figure(1)
plot(0:p:p*i,[ObjBestDQ ObjBFir],'bo')
pause(0.001)
figure(2)
loglog(tFIR,ObjBFir/globopt-1,'bo')
pause(0.001)
%Proposed Growing Youla, with InnerLoop algorithm improving all four state-space matrices of the Youla parameter. The computations do not use the FIR results above.
if(i<16)%Iterations for i>=10 are useless with this example, the multi-objective value is already at the globally optimal level and do not decrease further.
t3 = clock;
[QnewZ,QendZ,ObjBestZ(i)]=InnerLoop(Pstruct,AddPoleFIR(QnewZ),0.0001);
tGrow = etime(clock,t3);
if(i==1)
tGrowT(i) = tGrow;
else
tGrowT(i) = tGrow + tGrowT(i-1);%The total computation time is acumulated, since we start from the controller obtained at the previous i
end
figure(1)
hold on
plot(0:p:p*i,[ObjBestDQ ObjBestZ],'g-s')
pause(0.001)
figure(2)
hold on
loglog(tGrowT,ObjBestZ/globopt-1,'g-s')
pause(0.001)
end
end