nonlinear bounded constraints in fmincon

4 visualizzazioni (ultimi 30 giorni)
hussain askar
hussain askar il 27 Ott 2021
Risposto: arushi il 12 Apr 2024 alle 6:57
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 Commento
hussain askar
hussain askar il 27 Ott 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)];

Accedi per commentare.

Risposte (1)

arushi
arushi il 12 Apr 2024 alle 6:57
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.

Prodotti


Release

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by