It shows following error 'Simulink does not have enough information to determine output sizes for this block. If you think the errors below are inaccurate, try specifying types for the block inputs and/or sizes for the block outputs.'

5 views (last 30 days)
function [Sa,Sb,Sc] = Control(Vga,Vgb,ika,ikb,Vsa,Vsb) % I_ref=0; % I_meas=0; % Vga=0; % Vgb=0; Ts= 1e-04; p= 2000; Vdc=620; R=0.8; L=0.005; g = 0; v0 = 0; v1 = 2/3*Vdc; v2 = 1/3*Vdc + 1j*sqrt(3)/3*Vdc; v3 = -1/3*Vdc + 1j*sqrt(3)/3*Vdc; v4 = -2/3*Vdc; v5 = -1/3*Vdc - 1j*sqrt(3)/3*Vdc; v6 = 1/3*Vdc - 1j*sqrt(3)/3*Vdc; v7 = 0; v = [v0 v1 v2 v3 v4 v5 v6 v7]; % Switching states states = [0 0 0;1 0 0;1 1 0;0 1 0;0 1 1;0 0 1;1 0 1;1 1 1]; persistent x_old % Initialize values if isempty(x_old), x_old = 1; end
g_opt = 1e10;
x_opt=inf;
% Read current measurements at sampling instant k
for i = 1:7
% i-th voltage vector for current prediction
V1= real(v(i));
V2=Imag(v(i));
Iast1=(2*(Vsa)*p)/(3*((Vsa)^2+(Vsb)^2));
Ibst1=(2*(Vsa)*p)/(3*((Vsa)^2+(Vsb)^2));
% Current prediction at instant k+1
ik1a = ( 0.9841)*ika + (1/R)*(1- 0.9841)*(V1 - Vga);
ik1b = ( 0.9841)*ikb + (1/R)*(1- 0.9841)*(V2 - Vgb);
% Cost function
g = (abs(Iast1 -( ik1a)))^2 + (abs(Ibst1 -( ik1b)))^2;
if (g<g_opt)
g_opt = g;
x_opt = i;
end
end
x_old = x_opt;
Sa = states(x_opt,1);
Sb = states(x_opt,2);
Sc = states(x_opt,3);
end

Answers (0)

Categories

Find more on Simulink 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!