% Sensitivity analysis % We consider the problem given in Kartik's lecture notes on sensitivity analysis % Kartik's MATLAB session % To try out the session type the following commands (in that order!) clear all; c=[5 1 -12 0]'; A=[3 2 1 0; 5 3 0 1]; b=[10 16]'; eps = 1e-6; B=[3 4]; [obj,x,y] = revised_simplex(c,A,b,eps,B); % Optimal solution is % x= [2 2 0 0], y=[-10 7] for a objective value of 12 % Case a) Adding a new column A1 = [A [1 1]']; c1 = [c; 1]; B1 = [1 2]; % We can reoptimize with the revised simplex method [obj1,x1,y1] = revised_simplex(c1,A1,b,eps,B1); % Optimal solution is % x = [3 0 0 0 1], y=[0 1] for a objective value of 16 % Case b) Adding a new inequality constraint A2 = [A zeros(2,1); 1 1 0 0 -1]; c2 = [c; 0]; b2 = [b; 5]; % We will reoptimize with the dual simplex method x0 = [2 2 0 0 -1]'; x2 = dual_simplex(c2,A2,b2,eps,x0); % Optimal solution is % x = [0 5 0 1 0] for a objective value of 5 % Case c) Changes to the rhs vector b b3 = [11 16]'; x0 = [-1 7 0 0]'; % We will reoptimize with the dual simplex method x3 = dual_simplex(c,A,b3,eps,x0); % Optimal solution is % x = [0 5.33 0.33 0] for a objective value of 1.33 % Case d) Changes in c_N c4 = [5 1 -9 0]'; B4 = [1 2]; % We will reoptimize with the primal simplex method [obj,x4,y4] = revised_simplex(c4,A,b,eps,B4); % Optimal solution is % x = [3.2 0 0.4 0], y = [-9 6.4] for a objective value of 12.4