Filter löschen
Filter löschen

nonlinear bounded constraints in fmincon

3 Ansichten (letzte 30 Tage)
hussain askar
hussain askar am 27 Okt. 2021
Beantwortet: arushi am 12 Apr. 2024
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 Kommentar
hussain askar
hussain askar am 27 Okt. 2021
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)];

Melden Sie sich an, um zu kommentieren.

Antworten (1)

arushi
arushi am 12 Apr. 2024
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.

Produkte


Version

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by