% check_bo_d_case5: comparison of bo_d_speso and dr_d_wedz
% for examle case 5:

Vs5=0.4, TSu=2.7;  T01=14.2;  T02=7;   %parameters
c5num=1; c5den=conv([TSu  1],conv([T01  0],[T02  0]));

% Here PID-type == code 13 or 03
optim=optimset('display','off');
R3gen__VR_TN_TR0_TV=bo_d_gen(13,Vs5,c5num,c5den,[],[],[],optim),
VRc5= R3gen__VR_TN_TR0_TV(1,1),   TNc5 =R3gen__VR_TN_TR0_TV(1,2),
T0c5 =R3gen__VR_TN_TR0_TV(1,3),   TVc5 =R3gen__VR_TN_TR0_TV(1,4),

% Naslin Polynomial Method (Doppelverhältnisse=double cross ratio),common
% code 15
R2_dr_xz=dr_d_wedz(15,Vs5,TSu,T01,T02);        
VRdrX_c5=R2_dr_xz{1,1},  TNdrX_c5=R2_dr_xz{1,2},  TVdrX_c5=R2_dr_xz{1,3}
Z1xc5   =R2_dr_xz{2,1},     Z2xc5=R2_dr_xz{2,2},     T0xc5=R2_dr_xz{2,3}
Rrefc5zae=[Z1xc5*Z2xc5  Z1xc5+Z2xc5  1];     % see above: dr_d_wedz call
Rrefc5nen=[0            T0xc5        0];
Rrefc5=tf(Rrefc5zae,Rrefc5nen);              % dr_d_wedz controller
Frefc5=tf(1,Rrefc5zae);                      % dr_d_wedz pre-filter

R2_dr_dz=dr_d_wedz(16,Vs5,TSu,T01,T02); % double zero: code 16
VRdrD_c5=R2_dr_dz{1,1},  TNdrD_c5=R2_dr_dz{1,2},  TVdrD_c5=R2_dr_dz{1,3}
Z1dc5   =R2_dr_dz{2,1},     Z2dc5=R2_dr_dz{2,2}

case5_bo_d_sim; sim('case5_bo_d_sim',300)
