You are on page 1of 14

Software and examples

Optimisation Software

LINGO

Used to solve optimisation problems


To start entering a new optimisation problem type:
Model:

Enter the objective function by typing:


min = ;

or

max = ;

Then enter the constraints.


Each line must end by a semi-colon ;
The final statement in the problem should be end

Optimisation Software

Resolving MEA Example in LINGO


LINGO Input

LINGO Output

Model:
min = 80*x1 + 60*x2;
0.2*x1 + 0.32*x2 < 0.25;

x1 + x2 = 1;
x1 > 0;
x2 > 0;
end

Rows=
5
Nonzeros=
Smallest and
No. <

Vars=
2 No. integer vars=
0 ( all are linear)
10 Constraint nonz=
6(
4 are +- 1) Density=0.667
largest elements in absolute value=
0.200000
80.0000
:
1 No. =:
1 No. > :
2, Obj=MIN, GUBs <=
2
Single cols=
0
Optimal solution found at step:
0
Objective value:
71.66667
Variable
Value
Reduced Cost
X1
0.5833333
0.0000000E+00
X2
0.4166667
0.0000000E+00
Row
Slack or Surplus
Dual Price
1
71.66667
1.000000
2
0.0000000E+00
166.6667
3
0.0000000E+00
-113.3333
4
0.5833333
0.0000000E+00
5
0.4166667
0.0000000E+00

Value of objective function:

71.6667

Value of variable x1:

0.5833

Value of variable x2:

0.4167

More Optimisation Examples

Lab Experiment

Determine the kinetics of a certain reaction by mixing


two species, A and B. The cost of raw materials A and
B are 2 and 3 $/kg, respectively.

Let x1 and x2 be the weights of A and B (kg) to be


employed in the experiment

The operating cost of the experiment is given by:

OC = 4(x1)2 + 5(x2)2

The total cost of raw materials for the experiment


should be exactly $6. Minimise the operating cost!

More Optimisation Examples

Lab Experiment (Contd)


LINGO Input
Model:

min = 4*x1^2 + 5*x2^2;


2*x1 + 3*x2 = 6;

x1 > 0;
x2 > 0;
end

LINGO Output
Rows=
Nonlinear rows=
Nonzeros=

4 Vars=
2 No. integer vars=
0
1 Nonlinear vars=
2 Nonlinear constraints=
7 Constraint nonz=
4 Density=0.583

Optimal solution found at step:


Objective value:
Variable
X1
X2
Row
1
2
3
4

4
12.85714

Value
1.071429
1.285714
Slack or Surplus
12.85714
0.0000000E+00
1.071429
1.285714

Value of objective function:

Reduced Cost
0.0000000E+00
0.0000000E+00
Dual Price
1.000000
-4.285715
0.1939524E-07
0.0000000E+00

12.857

Value of variable x1:

1.071

Value of variable x2:

1.286

More Optimisation Examples

Coal Conversion Plant

What are the optimal production rates of gaseous and


liquid fuels that maximise the net profit of the plant?
2x1 kg coal/s for power
generation of gasification
plant (value of power breaks
Coal
even with the
gasification
air
cost of coal
(maximum
used in power
capacity
generation)
4 kg
x1 kg coal/s
coal/s)
Coal pretreatment
coal in
3x1 + 2x2 (maximum
Coal
capacity
kg coal/s
18 kg coal/s) 2x2 kg coal/s liquefaction
(maximum
capacity
12 kg
coal/s)

3x1 + 2x2 18

Gaseous Fuel
x1 kg gas. fuel/s
Net profit $3/kg
of gaseous fuel

x1 4
Byproducts
(negligible value)
Liquid Fuel
x2 kg liquid fuel/s
Net profit $5/kg
of liquid fuel

2x2 12
Byproducts
(negligible value)

More Optimisation Examples

Coal Conversion Plant (Contd)

Objective function max z = 3x1 + 5x2


Constraints

Pretreatment capacity
Gasification capacity
Liquefaction capacity
Non-negativity

3x1 + 2x2 18
x1 4
2x2 12
x1 0
x2 0

x2
10

x1 = 4
3x1 + 2x2 = 18

2x2 = 12

6
4
2

x1

0
0

More Optimisation Examples

Coal Conversion Plant (Contd)

Graphical solution
x2

x2
10

10

x1 = 4
3x1 + 2x2 = 18

Z = 36 = 3x1 + 5x2

2x2 = 12

Z = 20 = 3x1 + 5x2
4

Z = 10 = 3x1 + 5x2
2

x1

0
0

x1

0
0

Maximum profit Z = 36 for x1 = 2 and x2 = 6

More Optimisation Examples

Coal Conversion Plant (Contd)


LINGO Input

LINGO Output

Model:

Rows=
6 Vars=
2 No. integer vars=
0 ( all are linear)
Nonzeros=
11 Constraint nonz=
6(
3 are +- 1) Density=0.611
Smallest and largest elements in absolute value=
1.00000
18.0000
No. < :
3 No. =:
0 No. > :
2, Obj=MAX, GUBs <=
2
Single cols=
0

max = 3*x1 + 5*x2;


3*x1 + 2*x2 <= 18;
x1 <= 4;
2*x2 <= 12;
x1 > 0;
x2 > 0;

end

Optimal solution found at step:


Objective value:
Variable
X1
X2
Row
1
2
3
4
5
6

1
36.00000

Value
2.000000
6.000000
Slack or Surplus
36.00000
2.000000
0.0000000E+00
0.0000000E+00
2.000000
6.000000

Value of objective function:

Reduced Cost
0.0000000E+00
0.0000000E+00
Dual Price
1.000000
0.0000000E+00
1.500000
1.000000
0.0000000E+00
0.0000000E+00

36

Value of variable x1:

Value of variable x2:

More Optimisation Examples

Methanol Delivery

Supply methanol for three Methyl acetate plants


located in towns A, B, and C

Daily methanol requirements for each plant:


MeAc Plant location

Tons/day

A
B
C

6
1
10

Methanol production plants


MeOH plant

Capacity

More Optimisation Examples

Methanol Delivery (Contd)

Shipping cost (100 $/ton)


MeOH Plant

MeAc Plant A

MeAc Plant B

MeAc Plant C

11

15

Schedule the methanol delivery system to minimize


the transportation cost

More Optimisation Examples

Methanol Delivery (Contd)

We define the transportation loads (tons/day) going


from each MeOH plant to each MeAc plant as follows:
MeOH Plant

MeAc Plant A

MeAc Plant B

MeAc Plant C

X1A

X1B

X1C

X2A

X2B

X2C

X3A

X3B

X3C

X4A

X4B

X4C

Total transportation cost (Z)


Z =

2X1A + X1B + 5X1C + 3X2A + 0X2B + 8X2C + 11X3A


+ 6X3B + 15X3C + 7X4A + X4B + 9X4C

More Optimisation Examples

Methanol Delivery (Contd)

Objective function

Constraints

min Z =

2X1A + X1B + 5X1C


+ 3X2A + 0X2B
+ 8X2C + 11X3A
+ 6X3B + 15X3C
+ 7X4A + X4B + 9X4C

Availability/supply

X1A + X1B + X1C = 7


X2A + X2B + X2C = 5
X3A + X3B + X3C = 3
X4A + X4B + X4C = 2

Requirements/demand

X1A + X2A + X3A + X4A = 6


X1B + X2B + X3B + X4B = 1
X1C + X2C + X3C + X4C = 10

More Optimisation Examples

Methanol Delivery (Contd)

Constraints

Non-negativity

X1A 0
X1B 0
X1C 0
X2A 0
X2B 0
X2C 0
X3A 0
X3B 0
X3C 0
X4A 0
X4B 0
X4C 0

You might also like