Sol_graf7.mws                                                               PES = Pesquisa Operacional

Prof. Milton Procópio de Borba

Um exercício com 7 restrições

>   

restart:

 

>   

with(plots):

 

>   

Objetivo:=x+2*y;

Descrição: Descrição: Objetivo := x+2*y

>   

Restricoes:=[ 3*y-x <=9, x-2*y <=10, 2*x+y <=10, 2*x+y >=5, x-y<=3, x>=0,y>=1];

Descrição: Descrição: Restricoes := [3*y-x <= 9, x-2*y <= 10, 2*x+y <= 10, 5 <= 2*x+y, x-y <= 3, 0 <= x, 1 <= y]

>   

Regiao_factivel:=inequal(Restricoes, x=0..5,y=0..5, optionsfeasible=(color=gray),optionsexcluded=(color=white)):

 

>   

reta_otima:=contourplot(Objetivo,x=0..5,y=0..5,contours=[5,6,10],linestyle=4,color=red):

 

>   

display([Regiao_factivel,reta_otima]);

Descrição: Descrição: [Maple Plot]

>   

with(simplex):

 

>   

solve(convert({Restricoes[1],Restricoes[3]},equality));

 

>   

assign(%);

 

>   

Z:=Objetivo;

Descrição: Descrição: {x = 3, y = 4}

Descrição: Descrição: Z := 11