27 lines
1.3 KiB
Mathematica
27 lines
1.3 KiB
Mathematica
|
type = 'max';
|
||
|
A = [
|
||
|
%x1 x2 x3 x4 x5 x6 x7 x8 x9 x10 x11 x12 x13 x14 x15 x16
|
||
|
1 0 0 0 1 0 0 0 1 0 0 0 1 0 0 0;
|
||
|
0 1 0 0 0 1 0 0 0 1 0 0 0 1 0 0;
|
||
|
0 0 1 0 0 0 1 0 0 0 1 0 0 0 1 0;
|
||
|
0 0 0 1 0 0 0 1 0 0 0 1 0 0 0 1;
|
||
|
320 0 0 0 510 0 0 0 630 0 0 0 125 0 0 0;
|
||
|
0 320 0 0 0 510 0 0 0 630 0 0 0 125 0 0;
|
||
|
0 0 320 0 0 0 510 0 0 0 630 0 0 0 125 0;
|
||
|
0 0 0 320 0 0 0 510 0 0 0 630 0 0 0 125;
|
||
|
1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0;
|
||
|
0 0 0 0 1 1 1 1 0 0 0 0 0 0 0 0;
|
||
|
0 0 0 0 0 0 0 0 1 1 1 1 0 0 0 0;
|
||
|
0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1];
|
||
|
|
||
|
h = [18; 32; 25; 17; 11930; 22552; 11209; 5870; 16; 32; 40; 28];
|
||
|
|
||
|
% c is row vector form of following matrix C
|
||
|
C = [135; 200; 410; 520] * [1 1.1 1.2 1.3];
|
||
|
c = C';
|
||
|
c = c(:)';
|
||
|
|
||
|
sign = ones(1,12) * -1;
|
||
|
|
||
|
[z,x_B,index_B] = simplex (type,A,h,c,sign);
|
||
|
histogram([index_B x_B']')
|