% % Matlab/Octave script that solves the Columbia River Pollution Problem % (See January 30 In class Notes) % % The variable order is % % x'=[x1 x2 x3 y1 y2 y3] % % The objective is to minimize z=c'x where c=[20;30;40;100000;60000;40000]; % which can also be written % c=[20 30 40 100000 60000 40000]'; % or as % c=[20,30,40,100000,60000,40000]'; % all column vectors. % The A matrix of coefficients depends on the % large number M, so declare it first. M=500000; % Now construct A: A=[-0.40 -0.25 -0.20 0 0 0 -0.30 -0.20 -0.25 0 0 0 1 0 0 -M 0 0 0 1 0 0 -M 0 0 0 1 0 0 -M]; % The b (column) vector: b=[-80000;-50000;0;0;0]; % lower and upper bounds (column vectors) lb=zeros(6,1); ub=[M;M;M;1;1;1]; % declare the integer variables by index I=[4 5 6]; % all others will be real valued (1,2,3 in this case). % finally call the solver % Notice that there are no equality constraints so those entries are [] % And, dflag is set to "true" so that results will be displayed nicely for you dflag=true; [x,f]=mip(c,A,b,[],[],lb,ub,I,dflag);