数学建模与数学实验(第3版)课件+matlab
源代码在线查看: gying2.m
clear
%x0=[3 5 0 7 0 1 0 0 4 0 6 10 5 1 2 7]';
%x0=[ 3.0000 5.0000 0.0707 7.0000 0 0.9293 0 0 3.9293 0 6.0000 10.0707 6.3875 4.3943 5.7511 7.1867]';
%x0=[ 3.0000 5.0000 0.3094 7.0000 0.0108 0.6798 0 0 3.6906 0 5.9892 10.3202 5.5369 4.9194 5.8291 7.2852]';
x0=[3 5 4 7 1 0 0 0 0 0 5 11 5.6348 4.8687 7.2479 7.7499]';
A=[1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 1 1 1 1 1 1 0 0 0 0];
B=[20;20];
Aeq=[1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0
0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0
0 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0
0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 0
0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0
0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0];
beq=[3 5 4 7 6 11]';
vlb=[zeros(12,1);-inf;-inf;-inf;-inf];
vub=[];
[x,fval,exitflag]=fmincon('liaoch',x0,A,B,Aeq,beq,vlb,vub)