Question #237088

Use simplex method to maximize 𝑓 = 4𝑥 + 5𝑦 subject to the conditions 𝑥 + 2𝑦 ≤ 5 𝑥 − 2𝑦 ≤ 2 −𝑥 + 𝑦 ≤ 2 2𝑥 + 𝑦 ≤ 6 and 𝑥, 𝑦 ≥ 0.


1
Expert's answer
2021-09-16T00:46:31-0400
close all,
clear all,
clc,

disp('Use simplex method to maximize f = 4x + 5y subject to the conditions ');
disp('x+2y <= 5');
disp('x-2y <= 2');
disp('-x+y <= 2');
disp('2x+y <= 6');
disp('x,y >= 0');
disp(' ');




f = [-4; -5];
A =  [1, 2;
      1, -2;
      -1, 1;
      2, 1];
b = [5; 2; 2; 6];

lb=zeros(2,1);
ub=[1e4;1e4];
Aeq=[];
beq=[];
x0=[];
[x,fval,exitflag,output] = linprog(f,A,b,Aeq,beq,lb,ub,x0);
disp(['x = ',num2str(x(1)),'32,',', y = ',num2str(x(2))]);
disp(['Max f = ',num2str(fval)]);




Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!
LATEST TUTORIALS
APPROVED BY CLIENTS