How can I slove ecomic dispatch problem by nonlinear constarin function?
Show older comments
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
Answers (1)
Walter Roberson
on 14 May 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
Categories
Find more on Write Constraints in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!