% Paper 2021 Vrancic/Huba: High-Order Filtered PID Controller Tuning Based
% on Magnitude Optimum; Mathematics 2021, 9, 1340, 24 pages;
% plant equation (38):
Vs4=1;
num4=1;
Td4=1;  % dead time
den4=conv([1 1],conv([1 1],[1 1]));
% filter in controller for realization <--> Simulink: TF=0.001 typically;
% vector with different parameters, but no filter polynomial here:
TFV4=[ 0  0.0702  0.125  0.170 ];

TF=TFV4(2);
den_ad1=conv([TF  1],[TF  1]);   den_ad2=conv(den_ad1,[TF  1]); % order 3
    den42=conv(den_ad2,den4);
Ru42=bo_u_gen02(14,Vs4,num4,den42,Td4,23), %PID2 undel [VR,TN,T0,TV,TQ,TT]
% for comparison paper table 6:
ParPap42=[1.597 1.597/0.498 1/0.498 1.752/1.597 0.668/1.597 0 0],
% for simulink:
Ru42zae=[Ru42(5)*Ru42(2)  Ru42(4)*Ru42(2)  Ru42(2)  1],
Ru42nen=conv(den_ad2,[Ru42(3)  0]),    % Ru42(3) = TR0 = integrator

TF=TFV4(3);
den_ad1=conv([TF  1],[TF  1]);   den_ad2=conv(den_ad1,[TF  1]);
den_ad3=conv(den_ad2,[TF  1]);                                  % order 4
    den43=conv(den_ad3,den4);
Ru43=bo_u_gen02(15,Vs4,num4,den43,Td4,23), % PID3 undel [VR,TN,T0,TV,TQ,TT]
% for comparison paper table 6:
ParPap43=[1.992 1.992/0.554 1/0.554 2.674/1.992 1.596/1.992 0.362/1.992 0],
% for simulink:
Ru43zae=[Ru43(6)*Ru43(2)  Ru43(5)*Ru43(2)  Ru43(4)*Ru43(2)  Ru43(2)  1],
Ru43nen=conv(den_ad3,[Ru43(3)  0]),       % Ru43(3) = TR0 = integrator

TF=TFV4(4);
den_ad1=conv([TF  1],[TF  1]);   den_ad2=conv(den_ad1,[TF  1]);
den_ad3=conv(den_ad2,[TF  1]);   den_ad4=conv(den_ad3,[TF  1]); % order 5
    den44=conv(den_ad4,den4);
Ru44=bo_u_gen02(16,Vs4,num4,den44,Td4,23), % PID4 undel [VR,TN,T0,TV,TQ,TT]
% for comparison paper table 6:
ParPap44=[2.308  2.308/0.579  1/0.579...
                 3.629/2.308  2.832/2.308  1.117/2.308 0.185/2.308],
% for simulink:
             Ru44zae=[Ru44(7)*Ru44(2)  Ru44(6)*Ru44(2)  Ru44(5)*Ru44(2)...
                                           Ru44(4)*Ru44(2)  Ru44(2)  1],
Ru44nen=conv(den_ad4,[Ru44(3)  0]),       % Ru44(3) = TR0 = integrator
