Azzera filtri
Azzera filtri

Why am I receive Fmincon error ?

2 visualizzazioni (ultimi 30 giorni)
Oskar S.
Oskar S. il 7 Feb 2023
Commentato: Oskar S. il 7 Feb 2023
I'm getting Fmincon warning every time and how can I fix it ?
demand = [600,900,900,700,800,500,500];
power_from_plant1 = 30; %MW
power_from_plant2 = 50; %MW
cost_plant1 = 150; %kr/MWh
cost_plant2 = 600; %kr/MWh
Tankloss = 0.02; %
A = [];
b = [];
Aeq = [];
beq = [];
LB = [zeros(3,7), zeros(3,7), zeros(3,7)];
UB = [24*ones(3,7), 24*ones(3,7), 300*ones(3,7)];
x0 = ones(3,7);
[xopt,fopt]=fmincon(@fun,x0,A,b,Aeq,beq,LB,UB,@non1con);
Warning: Length of lower bounds is > length(x); ignoring extra bounds.
Warning: Length of upper bounds is > length(x); ignoring extra bounds.
Unrecognized function or variable 'fun'.

Error in fmincon (line 568)
initVals.f = feval(funfcn{3},X,varargin{:});
------> this part

Risposta accettata

Matt J
Matt J il 7 Feb 2023
x0 = ones(3,21);

Più risposte (0)

Tag

Community Treasure Hunt

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

Start Hunting!

Translated by