Problem on linear programming for the scalar reference governor.

1 visualización (últimos 30 días)
CHEW Yen LI
CHEW Yen LI el 24 de Abr. de 2021
Hi, need some help from those expert on the linear programming for the scalar reference governor. The following question is
where v(t) is the output of the reference governor,
r(t) is the reference input,
v(t-1) is the previous output of the reference governor
O = {(v, x): y(v, x) Y} ,y(v, x) == (CA^k)x+C(I−A) −1(I−A^k)Bv+Dv
So right now I use the matlab function block in the simulink to deal with this issue. The below is the code that I done in the matlab finction block. For the 'myfun' is a m file on the matlab and I call it from the maltab function block at the simulink. Then my problem is my code showing error ''MxArrays inside structures are not supported for code generation.'' Hope those expert at this field can give me the suggestion how my code can be corrected.
function v = SRG1( v_previous, r)
%#codegen
coder.extrinsic('fmincon');
[k.fval.exitflag]=fmincon('myfun');
v= v_previous + k*(r - v_previous);
end
%myfun is a m file
function obj=myfun(k)
obj=-k;
end

Respuestas (0)

Categorías

Más información sobre Simulink en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by