%Cvejn, J.: The magnitude optimum design of the PI controller for plants 
%with complex roots and dead time. Archives of Control Sciences, vol. 32, 
%no. 1, pp. 5-35, 2022; plant examples: number 5 till 8, controller: PI

p5den=     conv([ 0.4^2     2*0.5*0.4        1 ],[ 1   1 ]);   p5dt=0;
p6den=          [ 0.7071^2  2*0.7071*0.7071  1 ];              p6dt=4;
p7den=          [ 1         2*0.5*1          1 ];              p7dt=0.2;
p8den=conv(conv([ 1.4142^2  2*0.3536*1.4142  1 ],...
                [ 1.4142^2  2*0.3536*1.4142  1 ]),[ 1   1 ]);  p8dt=0;
            
% controller parameter sequence: VR_TN_TR0_TV
R5ugen=bo_u_gen(12,1,1,p5den),
R6ugen=bo_u_gen(12,1,1,p6den,p6dt,39),
R7ugen=bo_u_gen(12,1,1,p7den,p7dt,39),
R8ugen=bo_u_gen(12,1,1,p8den),

R5_bo_d_gen=bo_d_gen(12,1,1,p5den),
R5_bo_d_PI = bo_d_PI(12,1,1,p5den),         % for comparison
R6_bo_d_gen=bo_d_gen(12,1,1,p6den,p6dt,39),
R6_bo_d_PI = bo_d_PI(12,1,1,p6den,p6dt,39), % for comparison
R7_bo_d_gen=bo_d_gen(12,1,1,p7den,p7dt,39),
R7_bo_d_PI = bo_d_PI(12,1,1,p7den,p7dt,39), % for comparison
R8_bo_d_gen=bo_d_gen(12,1,1,p8den),
R8_bo_d_PI = bo_d_PI(12,1,1,p8den),         % for comparison

cv_PI_5till8_sim; sim('cv_PI_5till8_sim',70)
