%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 1 till 4, controller: PI

p1den=[            1                 1 ];         p1dt=0.1;
p2den=conv([ 1  1 ]                 ,[ 0.2 1 ]);  p2dt=0;
p3den=[ 0.4907^2   2*0.8660*0.4907   1 ];         p3dt=0.05;
p4den=[ 0.4950^2   2*0.7071*0.4950   1 ];         p4dt=0.2;

% controller parameter sequence: VR_TN_TR0_TV
R1ugen=bo_u_gen(12,1,1,p1den,p1dt,39),
R2ugen=bo_u_gen(12,1,1,p2den),
R3ugen=bo_u_gen(12,1,1,p3den,p3dt,39),
R4ugen=bo_u_gen(12,1,1,p4den,p4dt,39),

R1_bo_d_gen=bo_d_gen(12,1,1,p1den,p1dt,39),
R1_bo_d_PI = bo_d_PI(12,1,1,p1den,p1dt,39),   % for comparison
R2_bo_d_gen=bo_d_gen(12,1,1,p2den),
R2_bo_d_PI = bo_d_PI(12,1,1,p2den),           % for comparison
R3_bo_d_gen=bo_d_gen(12,1,1,p3den,p3dt,39),
R3_bo_d_PI = bo_d_PI(12,1,1,p3den,p3dt,39),   % for comparison
R4_bo_d_gen=bo_d_gen(12,1,1,p4den,p4dt,39),
R4_bo_d_PI = bo_d_PI(12,1,1,p4den,p4dt,39),   % for comparison

cv_PI_1till4_sim; sim('cv_PI_1till4_sim',20)
