% easy examples - Magnitude Optimum for delayed inputs
%case 3: : PID controller / oscillating element plus time-delay element

Vs=2; Tau=1; D=0.3; T3=0.1; Case3_bo_d_gen=[]; Case3_bo_d_speso=[];
for i=1:3 k=10^(i-1); 
         Reg = bo_d_gen(13,Vs,1,conv([k^2*Tau^2  k*2*D*Tau  1],[k*T3  1]));
         % bo_d_gen: code 13 or 3 means PID controller
         %           code 13: switch off for display commands    
         Case3_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(13,Vs,D,k*Tau,k*T3);
         % bo_d_speso: code 13 or 3 means case 3 regarding plant structure
         %             code 13: switch off for display commands
         Case3_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, 
Case3_bo_d_gen, Case3_bo_d_speso, 
format short,
disp('"bo_d_case3_01_sim.slx" will be called - compare parameters')
bo_d_case3_01_sim; sim('bo_d_case3_01_sim',800),
