필터 지우기
필터 지우기

Problem on linear programming for the scalar reference governor.

조회 수: 1 (최근 30일)
CHEW Yen LI
CHEW Yen LI 2021년 4월 24일
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

답변 (0개)

카테고리

Help CenterFile Exchange에서 Event Functions에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by