0% found this document useful (0 votes)
36 views2 pages

Practise Script

This document contains two examples of linear programming models. The first model has decision variables x(j) with objective function coefficient c(j) and capacity restrictions b(i). The second model uses binary variables x(i) with objective coefficients b(i) and a single capacity K, restricting the sum of w(i)*x(i).

Uploaded by

Huỳnh Huỳnh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
36 views2 pages

Practise Script

This document contains two examples of linear programming models. The first model has decision variables x(j) with objective function coefficient c(j) and capacity restrictions b(i). The second model uses binary variables x(i) with objective coefficients b(i) and a single capacity K, restricting the sum of w(i)*x(i).

Uploaded by

Huỳnh Huỳnh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

PRACTISE 1 – 15/04/2024

sets
I restrictions /1,2,3/
J columns /1*4/
;

parameter
c(j) coefficient of objective function /1 90, 2 50, 3 70, 4 40/
b(i) capacity restriction /1 30
2 24
3 36/
;
table a(i,j) parameter of capacity usage
1 2 3 4
1 2 -1 1 2
2 1 2 3 -1
3 3 2 -1 2
;

free Variables
F variable of objective function
;

positive Variables
x(j) quantity of j
;

Equations
OF objective function
CR capacity restriction
;

OF..F=E=sum(j, c(j)*x(j));
CR(i).. sum(j,a(i,j)*x(j)) =L= b(i);

model example1 /OF,CR/


solve example1 maximizing F using lp;
display F.l, x.l, c, b, a;
Practise 1 – 16/04 - me
sets
I columns /1,2,3,4,5/
;

Parameter
b(i) coefficient of objective function /1 1, 2 2, 3 3, 4 4, 5 5/
K capacity restriction /5/
w(i) parameter of capacity usage /1 1, 2 2, 3 3, 4 4, 5 5/
;
free Variables
F variables of objective function
;

binary Variables
x(i) quantity of i
;

Equations
OF objective function
CR capacity restriction
;
OF..F=E=sum(i, b(i)*x(i));
CR.. sum(i,w(i)*x(i)) =L= K;

model tutorial1 /OF,CR/


solve tutorial1 maximizing F using mip;
display x.l, F.l;

You might also like