필터 지우기
필터 지우기

nonlinear bounded constraints in fmincon

조회 수: 3 (최근 30일)
hussain askar
hussain askar 2021년 10월 27일
답변: arushi 2024년 4월 12일
I would like to add a nonlinear bounded constraint to my fmincon function i MATLAB, how can I break this constraint into two nonlinear inequality constraints? This is the ramp limit constraint used for generators
-DR<= p(i,t+1) - p(i,t) <= UR
  댓글 수: 1
hussain askar
hussain askar 2021년 10월 27일
can i break it like this?
function [c,ceq] = mycon(p)
c = [-DR(i)-p(h+1,i)+p(h,i);p(h+1,i)-p(h,i)-UR(i)];

댓글을 달려면 로그인하십시오.

답변 (1개)

arushi
arushi 2024년 4월 12일
Hi Hussain
You can break the ramp limit constraint into two nonlinear inequality constraints for use with MATLAB's fmincon function as you've described. The ramp limit constraint ensures that the change in power output between two time periods does not exceed specified down and up ramp limits, (DR) and (UR), respectively.
In fmincon, the nonlinear constraints function should return two outputs: c and ceq. Here, c represents the nonlinear inequality constraints which should be less than or equal to 0, and ceq represents the nonlinear equality constraints which should be equal to 0.
Your proposed function looks correct with a minor adjustment for indexing clarity and ensuring it matches MATLAB's 1-based indexing. Just make sure that DR(i) and UR(i) are correctly defined for each generator i, and that p is indexed correctly considering MATLAB's indexing. Also, ensure you adjust h and i according to your loop or vectorization structure.
Hope this helps.

제품


릴리스

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by