Using the command hinfsyn(), returns the error "Error using DynamicSystem/hinfsyn Plant P must have an explicit state-space realization".
9 views (last 30 days)
Show older comments
Here is the code in which I am getting an error
clear all;
clc;
L=500e-6;
C=40e-6;
R=0.01;
Ts=50e-6;
w_lc = 1/(sqrt(L*C));
w_sys = 2*pi*60;
s = tf('s');
Z_inv = (R+ (L*s));
Y_inv = 1/Z_inv;
Z_cap = 1/C*s;
%controller
% define weights and model matching
%W_cmd_i = ss(w_sys^2/(s^2+w_sys^2)*(7.078e11)^-1*1/1.3 );
%for output current
W_cmd_i= ss(0,0,0,1);
W_perf= ss(makeweight(50,1.5*w_lc,0.5));
G11_ss=ss(0,0,0,1);%for E_ref
G13 = minreal((Z_cap*Y_inv)/(1+(Z_cap*Y_inv)));%for Vinv
G13_ss = ss(G13);
G12= -minreal((Z_cap)/(1+(Z_cap*Y_inv)));%for I_o
G12_ss= ss(G12);
%G_gen=[G11 G12];
%G_ss = ss(G_gen);
%%
%interconnection using connect
G13_ss.InputName ='V_inv';
G13_ss.OutputName ='E_ou';
G12_ss.InputName= 'I_o';
G12_ss.OutputName= 'E_od';
G11_ss.InputName='E_ref';
G11_ss.OutputName= 'E_or';
plant_out = sumblk('sys_out = E_or-E_od-E_ou');
W_cmd_i.InputName='E_ref';
W_cmd_i.OutputName='E_odes';
Z= sumblk('match_err= E_odes-sys_out ');
W_perf.InputName = 'match_err';
W_perf.OutputName='weight_match_err';
Plant_gen= connect(G11_ss,G12_ss,G13_ss,W_cmd_i,W_perf,plant_out,Z,{"E_ref","I_o","V_inv"},{"weight_match_err","sys_out"});
ny = 1;
nu= 1;
[K_ff,CLs,GAMs,INFOs] = hinfsyn(Plant_gen,ny,nu);%<- this is where the error occurs
0 Comments
Answers (1)
Paul
on 9 Aug 2023
Hi BIJIT,
Running the code ....
L=500e-6;
C=40e-6;
R=0.01;
Ts=50e-6;
w_lc = 1/(sqrt(L*C));
w_sys = 2*pi*60;
s = tf('s');
Z_inv = (R+ (L*s));
Y_inv = 1/Z_inv;
Z_cap = 1/C*s;
%controller
% define weights and model matching
%W_cmd_i = ss(w_sys^2/(s^2+w_sys^2)*(7.078e11)^-1*1/1.3 );
%for output current
W_cmd_i= ss(0,0,0,1);
W_perf= ss(makeweight(50,1.5*w_lc,0.5));
G11_ss=ss(0,0,0,1);%for E_ref
G13 = minreal((Z_cap*Y_inv)/(1+(Z_cap*Y_inv)));%for Vinv
G13_ss = ss(G13);
G12= -minreal((Z_cap)/(1+(Z_cap*Y_inv)));%for I_o
G12_ss= ss(G12);
%G_gen=[G11 G12];
%G_ss = ss(G_gen);
%%
%interconnection using connect
G13_ss.InputName ='V_inv';
G13_ss.OutputName ='E_ou';
G12_ss.InputName= 'I_o';
G12_ss.OutputName= 'E_od';
G11_ss.InputName='E_ref';
G11_ss.OutputName= 'E_or';
plant_out = sumblk('sys_out = E_or-E_od-E_ou');
W_cmd_i.InputName='E_ref';
W_cmd_i.OutputName='E_odes';
Z= sumblk('match_err= E_odes-sys_out ');
W_perf.InputName = 'match_err';
W_perf.OutputName='weight_match_err';
Plant_gen= connect(G11_ss,G12_ss,G13_ss,W_cmd_i,W_perf,plant_out,Z,{"E_ref","I_o","V_inv"},{"weight_match_err","sys_out"});
ny = 1;
nu= 1;
Plant_gen is in descriptor form, as indicated by the non-zero E martrix.
Plant_gen.E
It is in descriptor form because some of the transfer functions are improper, i.e., the numerator has higher order than the denominator.
tf(Plant_gen)
[K_ff,CLs,GAMs,INFOs] = hinfsyn(Plant_gen,ny,nu);%<- this is where the error occurs
Are those improper transfer functions expected? Next steps would depend on the answer to that question.
I didn't take the time to try to figure out what in the model is causing those improper transfer functions.
See Also
Categories
Find more on ROS Toolbox in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!