d=[
1000 700 680 450;
16.19 16.6 16.5 19.7;
0.00048 0.002 0.00211 0.00398;
300 200 150 100;
150 100 30 25;
];
%M文件fmin.m
function f=fmin(PG);
f=d(3,1)*PG(1)^2+d(2,1)*PG(1)+d(1,1)
+d(3,2)*PG(2)^2+d(2,2)*PG(2)+d(1,2)
+d(3,3)*PG(3)^2+d(2,3)*PG(3)+d(1,3)
+d(3,4)*PG(4)^2+d(2,4)*PG(4)+d(1,4);
end
function [g,h]=fmin1(PG);
pl=[410];
g=[];
h=PG(1)+PG(2)+PG(3)+PG(4)-pl;
end
Ib=[d(5,1);d(5,2);d(5,3);d(5,4)];
Ub=[d(4,1);d(4,2);d(4,3);d(4,4)];
[PG,fval]=fmincon(@fmin,rand(4,1),[],[],[],[],Ib,Ub,@fmin1)