How can I slove ecomic dispatch problem by nonlinear constarin function?

function [c,ceq] = circlecon(x)
c = 459 + 6.48*x +0.00128*x^2;
ceq = [0];
A = [459];
b = [3];
Aeq = [32];
beq = [23];
x0 = [1/4,1/4];
nonlcon = @circlecon;
x = fmincon(fun,x0,A,b,Aeq,beq,lb,ub,nonlcon)
end

Réponses (1)

A = [459];
b = [3];
Aeq = [32];
beq = [23];
x0 = [1/4,1/4];
nonlcon = @circlecon;
x = fmincon(fun,x0,A,b,Aeq,beq,lb,ub,nonlcon)
function [c,ceq] = circlecon(x)
c = 459 + 6.48*x +0.00128*x^2;
ceq = [0];
end
This would probably fail because your A and Aeq matrices should have as many columns at the length of x0

Produits

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by