% easy examples - Magnitude Optimum for delayed inputs
%case 2: : PID controller / 3 first-order time-delay elements

Vs=2; T1=1; T2=1; T3=0.1; Case2_bo_d_gen=[]; Case2_bo_d_speso=[];
for i=1:3 k=10^(i-1); 
         Reg = bo_d_gen(13,Vs,1,conv(conv([k*T1  1],[k*T2  1]),[k*T3  1]));
         % bo_d_gen: code 13 or 3 means PID controller
         %           code 13: switch off for display commands
         Case2_bo_d_gen(i,:)=...
                          [Reg(1,1:2),Reg(1,4),Reg(1,4)*Reg(1,2),Reg(1,2)];
         [Reg1,Reg2] = bo_d_speso(12,Vs,k*T1,k*T2,k*T3);
         % bo_d_speso: code 12 or 2 means case 2 regarding plant structure
         %             code 12: switch off for display commands
         Case2_bo_d_speso(i,:)=...
           [Reg1(1,1:2),Reg1(1,4),Reg2(1,1)*Reg2(1,2),Reg2(1,1)+Reg2(1,2)];
end
disp('Sequence of parameters VR, TN, TV, TFi2, TFi1:')
format long, 
Case2_bo_d_gen, Case2_bo_d_speso, 
format short,
disp('"bo_d_case2_01_sim.slx" will be called - compare parameters')
bo_d_case2_01_sim; sim('bo_d_case2_01_sim',800),
