How can I slove ecomic dispatch problem by nonlinear constarin function?
Afficher commentaires plus anciens
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)
Walter Roberson
le 14 Mai 2019
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
Catégories
En savoir plus sur Write Constraints dans Centre d'aide et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!