Sunteți pe pagina 1din 19

Monte Carlo Marching (MCM) Applied to Engineering Optimization

by

Jacob H. Lashover
Baton Rouge, Louisiana, USA
June 17, 2017

Abstract: Previously, Monte Carlo Marching (MCM), developed by the author, has been
shown to successfully solve the simultaneous nonlinear equations which occur in distillation, flash
vaporization, Sudoku, and optimal horse race wagering [1, 2, 3, 4]. Avriel and Williams [5] have
significantly extended an engineering design method called Complementary Convex Programming
(CCP) to one they call Complementary Geometric Programming (CGP). They have demonstrated
it by finding the minimum total heat transfer area of a three-stage heat exchanger system in their
article titled An Extension of Geometric Programming with Applications in Engineering
Design.
This paper will show how the multistage heat exchanger design example shown in Avriel
and Williams' article can be easily solved using Monte Carlo Marching. A deeper analysis of
their example will also show the optimal area can be further reduced by over 50% by reversing
the order of the exchangers which are in series.

Key Words: Optimization, nonlinear, geometric programming, computer algorithm,


engineering design, minimum, convex constraints, objective function, global optimum,
polynomial, posynomial, MCM, horse race wagering, Sudoku, distillation, flash vaporization,
and chemical engineering.

Introduction: Geometric programming is a type of nonlinear programming that deals with


minimizing posynomials (polynomials with positive coefficients) that are subject to certain
posynomial inequality constraints. This type of problem often occurs in engineering designs
which require multi-objective optimization. Avriel and Williams have extended the theory of
geometric programming to include generalized polynomials with unrestricted coefficients and
call their method Complementary Geometric Programming (CGP). They claim that their method
permits handling a much larger family of engineering optimization problems than ordinary
geometric programming, but point out that with CGP there can result local minima which are not
global minima and there is no single transformation to convex programming, and no dual
program can be written. These details of geometric programming will be left to the reader to
understand from the following references [6, 7, 8, 9].
The CGP method was demonstrated by Avriel and Williams using the following example of
a multistage heat exchanger system optimization where we will show their development of the
CGP to be solved. The final results will be given but due to the length of the solution, the reader
is referred to the Parchami-Ghaferokhi thesis which provides the details [10]. The MCM solution
including the computer algorithm will be shown here in its entirety.

Page 1
Figure 1. Three stage heat exchanger system

Problem Description: A fluid having a given flow rate W and specific heat Cp is heated from
temperature TI to TF by flowing through three heat exchangers in series. In each heat exchanger
(stage) the cold stream is heated by hot fluids having the same flow rate W and specific heat Cp
as the cold stream. The temperatures of the hot fluids entering the exchangers, TH(1, 1), TH(2,
1), and TH(3, 1), and the overall heat transfer coefficients, U1, U2, and U3 of the exchangers are
known constants. Optimal design involves minimizing the sum of the heat transfer areas of the
three exchangers AT= A1 + A2 + A3.
As can be seen above, the temperatures of the hot fluids leaving the exchangers are called
TH(1, 2), TH(2, 2), and TH(3, 2). The cold streams leaving the exchangers are called TC(1) and
TC(2). Thus we have eight unknowns: five temperatures and three exchanger areas. As
chemical engineers, we note that since all flows are equal, the approach temperature differences
will be the same for both sides of each exchanger and thus there is no need to use a log mean
temperature difference in the equations for overall heat transfer. Equal flows will also be of help
in other model equations.

Page 2
Development of the complementary geometric program: For CGP all design relations
are written as inequalities rather than equations. There are three heat balances expressing the
fact that the rate of heat transferred to the cold fluids is less than or equal to the rate of heat loss
by the hot streams:

WCp(TC(1) TI) <= WCp(TH(1, 1) -TH(1, 2)) (1)

WCp(TC(2) TC(1)) <= WCp(TH(2, 1) TH(2, 2)) (2)

WCp(TF TC(2)) <= WCp(TH(3, 1) TH(3, 2)) (3)

Dividing both sides by WCp and rearranging to give positive coefficients yields:

TC(1) + TH(1, 2) <= TH(1, 1) + TI (4)

TC(2) + TH(2, 2) <= TH(2, 1) + TC(1) (5)

TF + TH(3, 2) <= TH(3, 1) + TC(2) (6)

Similarly, we can write three overall heat transfer inequalities:

WCp(TC(1) TI) <= U(1)A(1)(TH(1, 2) TI) (7)

WCp(TC(2) TC(1)) <= U(2)A(2)(TH(2, 2) TC(1)) (8)

WCp(TF TC(2)) <= U(3)A(3)(TH(3, 2) TC(2)) (9)

Defining new terms: U(i) = U(i)/WCp where i = 1, 2, and 3 and rearranging equations 4
through 10 yields the following complementary geometric program:

min AT
subject to

(A(1) + A(2) + A(3)) / AT <= 1 (10)

(TC(1) + TH(1, 2)) / (TH(1, 1) + TI) <= 1 (11)

(TC(2) + TH(2, 2)) / (TH(2, 1) + TC(1)) <= 1 (12)

(TF + TH(3, 2)) / (TH(3, 1) + TC(2)) <= 1 (13)

(TC(1) + U(1)A(1)TI) / (TI + U(1)A(1)TH(1, 2)) <= 1 (14)

(TC(2) + U(2)A(2)TC(1)) / (TC(1) + U(2)A(2)TH(2, 2)) <= 1 (15)

(TF + U(3)A(3)(TC(2)) / (TC(2) + U(3)A(3)TH(3, 2)) <= 1 (16)

Page 3
All variables are > 0 (17)
Per Avriel and Williams the CGP has 15 9 = 6 degrees of difficulty which is a
complementary geometric programming definition as the total number of posynomial terms in
the numerators less (m + 1) where m is the number of primal variables. This degree of difficulty
is independent of the number of terms in the denominators of the constraints. This can be
further reviewed in the references provided above.

Avriel and Williams CGP Solution: For their numerical solution to the above program the
data shown in Figure 1 are reiterated below.

TI = 100 deg. F, TF = 500 deg. F, WCp = 10^5 (B.t.u./hr. - deg. F)


TH(1, 1) = 300 F, TH(2, 1) = 400 F, and TH(3, 1) = 600 F
U(1) = 120, U(2) = 80, and U(3) = 40 (B.t.u./ hr.-sq.ft.-deg. F)

Initial or starting values of the variables were necessary and are listed below:
AT = 15,000 A(1) = 5,000 A(2) = 5,000 A(3) = 5,000 sq. ft.
TC(1) = 200 F TC(2) = 350 F TH(1, 2) = 150 F TH(2, 2) = 225 F TH(3, 2) = 425 F

The final solution after 4 iterations was as follows:

min AT = 7049 A(1) = 567 A(2) = 1357 A(3) = 5125 sq. ft.
TC(1) = 181 TC(2) = 295 F
TH(1, 2) = 219 TH(2, 2) = 286 TH(3, 2) = 395 F

Monte Carlo Marching Background: The MCM method presented herein was based on
ideas first proposed by the modern Monte Carlo discoverer, mathematician Stanislaw Ulam, who
in 1946 used his Monte Carlo method in the design of atomic weapons at Los Alamos[11]. His
technique replaced differential equations by a succession of random operations. The method was
made possible by the beginning of a new era of fast computers. Optimization by calculus with its
derivatives and Jacobian procedures is difficult, tedious, and time consuming.
In 1984, William C. Conley, a mathematician on the faculty of the University of Wisconsin
at Green Bay, published Computer Optimization Techniques [12]. Conley called his method
multi-stage Monte Carlo optimization or MSMCO and demonstrated the technique on the
classical, simplex profit optimization problems of Operations Research. After using the Newton-
Rhapson technique to solve the isothermal flash vaporization problem in his Master's thesis, the
author decided years later in 2012 to attempt to solve this classic chemical engineering problem
using a method he developed and named Monte Carlo Marching. The method is described in
Monte Carlo Marching-a convergence procedure that does not require derivatives [1].
MCM makes use of constraints which insure that the solutions will satisfy the laws of
thermodynamics and physics. These constraints are basically simultaneous linear and nonlinear
equations which model the system being studied. The MCM linear objective function is formed
by designing the constraints to be convex and adding them. The justification for adding these
constraints is similar to that used inMaximum Likelihood methods by M. Banbura[13]. The
objective function becomes convex by being built of convex functions and can thus be minimized.
Further proof of the linearity (ability to add constraints) can be found in Analysis of the n-
dimensional quadtree decomposition for arbitrary hyper-rectangles by Christos Faloutsos et. al.
[14].

Page 4
Orthotopes, also called hyper-rectamgles, are the generalization of rectangles for higher
dimensions than three. Feasible solutions of the objective function are found using randomly
perturbed variable values between the lower and upper limits of the variables. These
perturbations are calculated by multiplying the current ranges by random numbers, and adding
the products to the lower limits. Variable values for local optimums of the objective function
(minimums in these cases) are saved for each range and become the new lower limits of the
range. The new range of feasible solutions to be searched is formed by using these new lower
limits with the same upper limits. This new range is halved and another 2000 or more feasible
solutions are randomly calculated as before. This procedure is repeated 5 times or more until
variable values are forced by the convex objective function to a global minimum which satisfies
the constraints (model equations). Note that the ranges can be reduced by fractions other than
one-half and the number of feasible solutions checked can be increased to form a finer grid of
solutions, if necessary. The global optimum is assured when the value of the objective function
becomes constant.
Summarizing, the MCM strategy is to create a large W-dimensional hyper-rectangle inside
the limits of feasible solutions, always storing the best answers so far, and re-centering the
rectangle about those best answers; then reducing the W-dimensional rectangle in width in each
dimension and repeating the process. This is done until the W-dimensional rectangle moves
around and surrounds the solution, and then narrows and finds it when the minimum value no
longer changes.
Further details and background for the method can be found in references 1, 2, 3. and 4.
There have been no convergence failures to date even when the solution is very close to an upper
or lower limit. These failures to converge, and the inability to tell whether convergence has been
achieved, are frequently seen in other methods used to solve simultaneous nonlinear equations
such as those in flash vaporization calculations.

Application of MCM to determine optimal heat transfer area: Define the quantities of
heat transferred across each heater on the hot sides as follows:

QH(1) = WCp(TH(1, 1) TH(1, 2)) (18)

QH(2) = WCp(TH(2, 1) TH(2, 2)) (19)

QH(3) = WCp(TH(3, 1) TH(3, 2)) (20)

and TOTQH = QH(1) + QH(2) + QH(3) (21)

Define the quantities of heat transferred on the cold sides as follows:

QC(1) = WCp(TC(1) TI) (22)

QC(2) = WCp(TC(2) TC(1)) (23)

QC(3) = WCp(TF TC(2)) (24)

and TOTQC = QC(1) + QC(2) + QC(3) (25)

Page 5
and, of course, QH(1) = QC(1) (26)

QH(2) = QC(2) (27)

QH(3) = QC(3) (28)

TOTQH = TOTQC = WCp(TF - TI) (29)

Dividing by WCp and remembering that for equal flows the temperature differences are
equal we get the following:

TC(1) TI = TH(1, 1) TH(1, 2) (30)

TC(2) TC(1) = TH(2, 1) TH(2, 2) (31)

TF TC(2) = TH(3, 1) TH(3, 2) (32)

Inserting the known values into the above equations and rearranging yields the following:

TH(1, 2) = 400 TC(1) (33)

TH(2, 2) = 400 + TC(1) TC(2) (34)

TH(3, 2) = 100 + TC(2) (35)

Thus, we can express all three heater outlet temperatures in terms of TC(1) and TC(2).
To calculate the heater areas, we will need the approach temperatures for each heater. Either
side of the following equations can be used.

HEX(1) TH(1, 1) TC(1) = TH(1, 2) TI (36)

HEX(2) TH(2, 1) TC(2) = TH(2, 2) TC(1) (37)

HEX(3) TH(3, 1) TF = TH(3, 2) TC(2) (38)

The general equations for overall heat transfer using the areas, heat transfer coefficients,
and approach temperatures follows:

QH(1) = QC(1) = W*Cp*U(1)*A(1)*(TH(1, 1) TC(1)) (39)

QH(2) = QC(2) = W*Cp*U(2)*A(2)*(TH(2, 1) TC(2)) (40)

QH(3) = QC(3) = W*Cp*U(3)*A(3)*(TH(3, 1) TF) (41)

Page 6
And now, inserting the values of the given U's, and the given temperatures, we can
rearrange to solve for the areas:

A(1) = 833.333333*(TC(1) 100)/(300 TC(1)) (42)

A(2) = 1250*(TC(2) TC(1))/(400 TC(2)) (43)

A(3) = 25*(500 TC(2)) (44)

We still have 5 unknown temperatures and 3 unknown areas but we can express all of
them in terms of TC(1) and TC(2) leaving us just two independent variables to perturb for a
solution. We can now subtract the right hand sides of the equalities listed above from the left
hand sides setting the results equal to zero. We can then take the absolute values of the
differences to make them convex constraints. These linearized constraints can now be added to
form a linear, convex objective function to be minimized. Calculation of the 16 constraints
(called X1, X2, ... X16) are shown in the MCM algorithm below. Some of these may be
redundant but as long as they are correct they will not affect the solution.

MCM solution algorithm presented in the form of QB64 BASIC computer code:

REM MCMHX006.BAS BY J. H. LASHOVER MAY 31, 2017

CLEAR , , 32000: ON ERROR GOTO 13000


DIM A(3), AREA(3), UL(3), B(3), TC(3), TH(3, 3), QC(3), U(3), DELTC(3), DELTH(3), CL(3),
RNG(3), T(3)
DIM FAREA(3), FTC(3), FTH(3, 3), MAREA(3)

DEFDBL A-Z
DEFINT I-K
TS# = TIMER: PRINT: PRINT " TIMER= "; TIMER

REM SET SCREEN SIZE, COLORS, AND FONT


SCREEN 0: WIDTH 100, 60: COLOR 0, 10: CLS
PRINT
WMODE$ = "1"
PRINT
ENLARGE% = 2

SELECT CASE ENLARGE%


CASE 1, 2, 3, 4, 5: STYLE$ = "MONOSPACE, BOLD"
CASE 6, 7, 8, 9: STYLE$ = "MONOSPACE"
CASE ELSE: STYLE$ = "MONOSPACE"
END SELECT

Page 7
SELECT CASE WMODE$

CASE "1"
FULL = _FULLSCREEN
IF FULL > 0 THEN _FULLSCREEN _OFF
f& = _LOADFONT("c:\windows\fonts\lucon.ttf", 13 + ENLARGE%, STYLE$)
_FONT f&
CASE "2"
_FULLSCREEN _SQUAREPIXELS
FULL = _FULLSCREEN
IF FULL = 0 THEN GOSUB FCHECK
CASE "3"
_FULLSCREEN _STRETCH
FULL = _FULLSCREEN
IF FULL = 0 THEN GOSUB FCHECK
END SELECT
mode = _FULLSCREEN
GOSUB ClearFont

PRINT: PRINT " WELCOME TO MCMHX006 BY J. H. LASHOVER"


PRINT: PRINT " WRITTEN IN QB64 DURING MAY, 2017"
PRINT

1 REM BEGIN MONTE CARLO SOLUTION


CLS
REM GIVEN PROBLEM DATA
W = 100000: U(1) = 120: U(2) = 80: U(3) = 40: TI = 100: TF = 500: CP = 1
TOTHEAT = W * CP * (TF - TI)
CM = 1000000: AMIN = 1000000
TH(1, 1) = 300: TH(2, 1) = 400: TH(3, 1) = 600

REM THERE ARE FIVE (5) UNKNOWN TEMPERATURES AND THREE (3) UNKNOWN
AREAS
REM UNKNOWN TEMPERATURES ARE TC(1), TC(2), TH(1, 2), TH(2, 2), TH(3, 2)
REM UNKNOWN ARE: AREA(1), AREA(2), AREA(3), TOTAREA

REM COLD FLOW T #1 LIMITS


A(1) = 0 'current value of TC(1)
B(1) = 150 'likely lowest value of TC(1)
UL(1) = 500 'upper limit of value of TC(1)
CL(1) = 0 'current lower limit of value of TC(1)
RNG(1)= 0 'current range of values of TC(1)

Page 8
REM COLD FLOW T #2 LIMITS
A(2) = 0 'current value of TC(2)
B(2) = 250 'likely lowest value of TC(2)
UL(2) = 500 'upper limit of value of TC(2)
CL(2) = 0 'curretn lower limit of value of TC(2)
RNG(2) = 0 'current range of values of TC(2)

COUNTI& = 0
FOR J = 1 TO 5
Z% = 2000
FOR I = 1 TO Z%
COUNTI& = COUNTI& + 1

REM TC Perturbations
FOR K = 1 TO 2
IF (A(K) - UL(K) / 2 ^ J) < B(K) THEN GOTO 315
GOTO 317
315 CL(K) = B(K)
GOTO 316
317 CL(K) = A(K) - UL(K) / 2 ^ J
316 IF (A(K) + UL(K) / 2 ^ J) > UL(K) THEN GOTO 318
GOTO 319
318 RNG(K) = UL(K) - CL(K)
GOTO 501
319 RNG(K) = A(K) + UL(K) / 2 ^ J - CL(K)
501 T(K) = CL(K) + INT(RND * RNG(K) + .5)
NEXT K

TC(1) = T(1): PRINT: PRINT " TC(1)= "; TC(1)


TC(2) = T(2): PRINT " TC(2)= "; TC(2)

REM CALCULATE TH'S


TH(1, 2) = 400 - TC(1): PRINT: PRINT " TH(1,2)= "; TH(1, 2)
TH(2, 2) = 400 + TC(1) - TC(2): PRINT " TH(2,2)= "; TH(2, 2)
TH(3, 2) = TC(2) + 100: PRINT " TH(3,2)= "; TH(3, 2)

IF TH(1, 2) <= 0 THEN GOTO 4


IF TH(2, 2) <= 0 THEN GOTO 4
IF TH(3, 2) <= 0 THEN GOTO 4

REM APPROACH TEMPERATURES


DELT1 = TH(1, 1) - TC(1): DELTT1 = TH(1, 2) - TI
DELT2 = TH(2, 1) - TC(2): DELTT2 = TH(2, 2) - TC(1)
DELT3 = TH(3, 1) - TF: DELTT3 = TH(3, 2) - TC(2)

Page 9
IF DELT1 <= 0 THEN GOTO 4
IF DELT2 <= 0 THEN GOTO 4
IF DELT3 <= 0 THEN GOTO 4
IF DELTT1 <= 0 THEN GOTO 4
IF DELTT2 <= 0 THEN GOTO 4
IF DELTT3 <= 0 THEN GOTO 4

DELTC(1) = TC(1) - TI
DELTC(2) = TC(2) - TC(1)
DELTC(3) = TF - TC(2)
TOTDELTC = DELTC(1) + DELTC(2) + DELTC(3)

REM CALCULATE CONSTRAINTS IN CONVEX FORM


X1 = ABS(TOTDELTC - (TF - TI))
X2 = ABS((TC(1) + TH(1, 2)) - (TH(1, 1) + TI))
X3 = ABS((TC(2) + TH(2, 2)) - (TH(2, 1) + TC(1)))
X4 = ABS((TF + TH(3, 2)) - (TH(3, 1) + TC(2)))
X5 = ABS(DELT1 - DELTT1)
X6 = ABS(DELT2 - DELTT2)
X7 = ABS(DELT3 - DELTT3)

PRINT " DELTC(1)= "; DELTC(1)


PRINT " DELTC(2)= "; DELTC(2)
PRINT " DELTC(3)= "; DELTC(3)
PRINT " TOTAL DELTC= "; TOTDELTC

REM STATEMENT TO STOP PROGRAM WHEN DEBUGGING


REM REMOVAL OF ' WILL ACTIVATE STATEMENT
'INPUT " PRESS ENTER TO CONTINUE", YES

QC(1) = W * CP * DELTC(1): PRINT: PRINT " QC(1)= "; QC(1)


QC(2) = W * CP * DELTC(2): PRINT " QC(2)= "; QC(2)
QC(3) = W * CP * DELTC(3): PRINT " QC(3)= "; QC(3)
QCT = QC(1) + QC(2) + QC(3): PRINT " QCT= "; QCT
X8 = ABS((W * (TF - TI) * CP) - QCT)

AREA(1) = QC(1) / (U(1) * DELT1): PRINT " AREA(1)= "; AREA(1)


AREA(2) = QC(2) / (U(2) * DELT2): PRINT " AREA(2)= "; AREA(2)
AREA(3) = QC(3) / (U(3) * DELT3): PRINT " AREA(3)= "; AREA(3)
TOTAREA = AREA(1) + AREA(2) + AREA(3): PRINT " TOTALAREA= "; TOTAREA

IF AREA(1) <= 0 THEN GOTO 4


IF AREA(2) <= 0 THEN GOTO 4
IF AREA(3) <= 0 THEN GOTO 4

Page 10
DELTH(1) = TH(1, 1) - TH(1, 2): PRINT: PRINT " DELTH(1)= "; DELTH(1)
DELTH(2) = TH(2, 1) - TH(2, 2): PRINT " DELTH(2)= "; DELTH(2)
DELTH(3) = TH(3, 1) - TH(3, 2): PRINT " DELTH(3)= "; DELTH(3)
TOTDELH = DELTH(1) + DELTH(2) + DELTH(3): PRINT " TOTDELH= "; TOTDELH

QH(1) = W * CP * (DELTH(1)): PRINT: PRINT " QH(1)= "; QH(1)


QH(2) = W * CP * (DELTH(2)): PRINT " QH(2)= "; QH(2)
QH(3) = W * CP * (DELTH(3)): PRINT " QH(3)= "; QH(3)
QHT = QH(1) + QH(2) + QH(3): PRINT " QHT= "; QHT

X9 = ABS(QCT - QHT)
X10 = ABS(QC(1) - QH(1))
X11 = ABS(QC(2) - QH(2))
X12 = ABS(QC(3) - QH(3))

MAREA(1) = 833.3333 * (TC(1) - 100) / (300 - TC(1)): PRINT " MAREA(1)= "; MAREA(1)
MAREA(2) = 1250 * (TC(2) - TC(1)) / (400 - TC(2)): PRINT " MAREA(2)= "; MAREA(2)
MAREA(3) = 25 * (500 - TC(2)): PRINT " MAREA(3)= "; MAREA(3)
MTOTAREA = MAREA(1) + MAREA(2) + MAREA(3): PRINT " MTOTALAREA= ";
MTOTAREA

X13 = ABS(MAREA(1) AREA(1)) 'compare areas calculated by two different equations


X14 = ABS(MAREA(2) - AREA(2))
X15 = ABS(MAREA(3) - AREA(3))
X16 = ABS(MTOTAREA TOTAREA)

REM PRINT CURRENT VALUE OF CONSTRAINTS


PRINT: PRINT " X1= "; X1; " X2= "; X2; " X3= "; X3; " X4= "; X4; " X5= "; X5
PRINT " X6= "; X6; " X7= "; X7; " X8= "; X8; " X9= "; X9; " X10= "; X10; " X11= ";
X11; " X12= "; X12
PRINT " X13= "; X13; " X14= "; X14; " X15= "; X15; " X16= "; X16

REM OBJECTIVE FUNCTION


XMIN = X1 + X2 + X3 + X4 + X5 + X6 + X7 + X8 + X9 + X10 + X11 + X12 + X13 + X14 +
X15 + X16
PRINT: PRINT " XMIN= "; XMIN; " CM= "; CM; " AMIN= "; AMIN
'INPUT " PRESS ENTER TO CONTINUE", YES

IF TOTAREA > AMIN THEN GOTO 4 'IS NEW AREA LARGER THAN PREVIOUS

FOR II = 1 TO 2 'NO, NEW AREA IS LOWER THAN PREVIOUS BEST


A(II) = T(II) 'SET PREVIOUS BEST TC'S TO NEW OPTIMUM VALUES
NEXT II
CM = XMIN: AMIN = TOTAREA 'SAVE NEW MINIMUMS

Page 11
REM REMEMBER BEST SOLUTION TO DATE
FAREA(1) = AREA(1): FAREA(2) = AREA(2): FAREA(3) = AREA(3)
FTOTAREA = TOTAREA
FTC(1) = TC(1): FTC(2) = TC(2)
FTH(1, 2) = TH(1, 2): FTH(2, 2) = TH(2, 2): FTH(3, 2) = TH(3, 2)
FXMIN = XMIN
INPUT " PRESS ENTER TO CONTINUE", YES

4 NEXT I

5 PRINT: PRINT " COUNTJ= "; J; " COUNTI= "; COUNTI&; " CM= "; CM; " XMIN= ";
FXMIN; " AMIN= "; AMIN
PRINT " AREA(1)= "; FAREA(1); " AREA(2)= "; FAREA(2); " AREA(3)= "; FAREA(3)
PRINT " TOTAL AREA= "; FTOTAREA
INPUT " PRESS ENTER TO CONTINUE", YES

6 NEXT J

REM PRINT FINAL SOLUTION


7 PRINT: PRINT " COUNTJ= "; J - 1; " COUNTI= "; COUNTI&; " CM= "; CM; " XMIN= ";
FXMIN; " AMIN= "; AMIN
PRINT " TC(1)= "; FTC(1); " TC(2)= "; FTC(2)
PRINT " TH(1, 2)= "; FTH(1, 2); " TH(2, 2)= "; FTH(2, 2); " TH(3, 2)= "; FTH(3, 2)
PRINT " AREA(1)= "; FAREA(1); " AREA(2)= "; FAREA(2); " AREA(3)= "; FAREA(3)
PRINT " TOTAL AREA= "; FTOTAREA
PRINT: PRINT " TOTAL POINTS EXAMINED= "; COUNTI&
INPUT " PRESS ENTER TO CONTINUE", YES
END 'END OF MAIN PROGRAM

13000 REM ERROR TRAPPING ROUTINE


13001 PRINT
13002 PRINT " ERROR NUMBER"; ERR, " LINE WITH ERROR"; ERL; " FILE#= "; FIL%
INPUT " PRESS ENTER TO CONTINUE", YES
IF ERR = 53 THEN PRINT " FILE NOT FOUND= "; FIL%
IF ERR = 9 THEN PRINT " DIM EXCEEDED"
INPUT " PRESS ENTER TO CONTINUE", YES
13003 RESUME NEXT

REM SUBROUTINE USED IN OPENING STATEMENTS TO SET OUTPUT PROPERTIES


FCHECK:
Z3 = TIMER
DO
IF TIMER < Z3 THEN Z3 = Z3 - TIMER
IF TIMER - Z3 > 4 THEN EXIT DO
LOOP
FULL = _FULLSCREEN
Page 12
IF FULL = 0 THEN _FULLSCREEN _OFF: SOUND 100, .75
RETURN
ClearFont:
IF f& > 0 THEN
_FONT 16 'select inbuilt 8x16 default font
_FREEFONT f&
END IF
RETURN

Page 13
COMPUTER RESULTS:

The table below shows the values of each variable after each local optimum is found. As
can be seen, the global optimum is found after the value for total area, 7049.3 sq. ft., becomes
constant. Area(1) = 576, Area(2) = 1367, and Area(3) = 5106. TC(1) = 182, TC(2) = 296,
TH(1, 2) = 218, TH(2, 2) = 286, and TH(3, 2) = 396.

1.

Table 1. Tracking of variables during MCM solution

As can be seen above the solution was reached after 5094 trials with a total constraint
minimum of 0.0000461. The orthotope was reduced 4 times until J equaled 5. The minimum
area of 7049 was identical to the 7049 determined by Avriel and Williams' CGP method. Note
that the MCM method did not require starting values close to the solution; instead it searched for
a solution between zero and 500 F for each temperature, TC(1) and TC(2). As noted previously,
all other temperatures and the exchanger areas could then be calculated from these two
variables.
Figures 2, 3, 4, and 5 below plot the parameters in Table 1. The colors in the Table match
the colors in the graphs. In Figures 2 and 3 note how the ranges (in green) of the variables, TC(1)
and TC(2) become smaller and smaller as the optimum is approached. See how the values, A(1)
and A(2), of temperature in blue become constant as the optimum is approached. The lower
limits, CL(1) and CL(2) increase from zero up to the final values of TC(1) and TC(2).
In Figures 4 and 5 the unknown heater outlet temperatures and areas become constant as
the optimum is approached. The B(1) and B(2) values form most likely lower values of TC(1)
and TC(2) and could be set to zero to insure that the final values are not below them.

Page 14
Page 15
Further analysis of solution: Since we were charged with seeking the optimal design which
minimizes the total heat transfer area required, we must ask if the exchangers could be arranged
in a different order with each one keeping its same heat transfer coefficient. There are six ways
the three exchangers can be arranged in series:
1, 2, 3
1, 3, 2
2, 1, 3
2, 3, 1
3, 1, 2
3, 2, 1
These comparison calculations were made with the Solver [15] tool of Google Sheets, a
free program from Google, which uses the same Solver by Frontline Systems as does Microsoft
EXCEL. Results of the calculations are tabulated below with the last two entries being the
results of the Avriel and Williams and MCM methods, respectively.

Table 2. Comparison of total area required when the exchangers are reordered.

It can be seen that there is a greater than 50% reduction in the total area required when
the order of the exchangers is totally reversed with the exchanger having a U = 40 placed first,
that with a U = 80 placed second, and that with a U = 120 in the last position. The total area is
reduced from 7049 to 3248 sq. ft. Note that HEX 1 is deleted, not used, in this arrangement.
It is recognized that Avriel and Williams stated that their purpose was to demonstrate their
CGP method without comparing it to other optimization techniques. It was also noted that this
problem was previously solved by Boas by dynamic programming [16] and by Fan and Wang via
the maximum principle [17]. The author also found this problem solved by Housam Binous et.
al. in Wolfram Alpha Demonstrations using Mathematica to solve the CGP constraints [18].
The main purpose of this paper was to show the robustness of the MCM method by adding
an engineering optimization solution to its credentials. Further, all of the work in this paper can
be done at no cost to the user as Apache's OpenOffice Writer was used for the report and Google
Sheets was shown to offer a free spread sheet equipped with a Solver add-on similar to
Microsoft's EXCEL. Programming was done using open source VBA compatible QB64 as in the
previous MCM articles. Comments, suggestions for improvement and questions should be
addressed to the author via his email, jacklash1@gmail.com.
The problem of integrating heat between hot and cold streams, and finding the optimal
network, particularly in terms of cost, can be further investigated using the THEN program
developed by Professor F. Carl Knopf at Louisiana State University in 1989 [19] and Simulis
Pinch by ProSim SA that can be used directly in EXCEL or Google Sheets to diagnose and
integrate energy use in industrial processes [20].

Page 16
CONCLUSIONS:

The Avriel and Williams solution follows:


min AT = 7049 A(1) = 567 A(2) = 1357 A(3) = 5125 sq. ft.
TC(1) = 181 TC(2) = 295 F
TH(1, 2) = 219 TH(2, 2) = 286 TH(3, 2) = 395 F

The MCM solution was as follows:


min AT = 7049 A(1) = 576 A(2) = 1367 A(3) = 5106 sq. ft
TC(1) = 182 TC(2) = 296 XMIN = 0.0000461
TH(1, 2) = 218 TH(2, 2) = 286 TH(3, 2) = 396 F

Both solutions are similar to each other and to the values reported by A. H. Boas, L. T.
Fan and C. S. Wang, H. Binous, and Google Sheets Solver in references 15, 16, 17, and 18. All
methods other than MCM required starting values of the variables which were relatively close to
the final solution. Starting values for MCM variables were zeroes. With high speed computers
all solutions could be found in less than one (1) second.

Lastly, note that one MCM solution found while experimenting with different range limits
was as follows:
min AT = 7083 A(1) = 833 A(2) = 1250 A(3) = 5000 sq. ft. XMIN = 0.00006666
TC(1) = 200 TC(2) = 300 TH(1, 2) = 200 TH(2, 2) = 300 TH(3, 2) = 400 F

Also recall that TH(1, 1)= 300, TH(2,1) =400, and TH(3,1)= 600. Since the given problem
was synthetic or man made, the cryptographer in the author concluded that all of the round
numbers are what the problem author would have used to simplify his job. The area 7083 is only
34 sq. ft. or 0.5 % different from 7049.

Page 17
REFERENCES:

[1] J. H. Lashover, Monte Carlo Marching Distillation: Simultaneous solution of the MESH
equations with no derivatives, no initial values, and no doubt about completion, in
Academia.edu, ResearchGate.com, and SCRIBD.com, Feb. 29, 2016.

[2] J. H. Lashover, Monte Carlo Marching-a convergence procedure that does not require
derivatives, in Academia.edu, ResearchGate.com, and SCRIBD.com, October 14, 2012.

[3] J. H. Lashover, Mathematical Solution to Sudoku using Monte Carlo Marching, in


Academia.edu, ResearchGate.com, and SCRIBD.com, September 14, 2015.

[4] J. H. Lashover, A Chemical Engineer Goes to the Horse Races, in Academia.edu,


ResearchGate.com, and SCRIBD.com, August 28, 2014.

[5] M. Avriel and A. C. Williams, An Extension of Geometric Programming with Applications


in Engineering Optimization, Journal of Engineering Mathematics, Vol. 5, No. 3, July, 1971.

[6] S. G. Beveridge and R. S. Schechter, Optimization: Theory and Practice, McGraw-Hill, New
York, 1970.

[7] R. J. Duffin et. al., Geometric Programming, Wiley, New York, 1967.

[8] D. J. Wilde and C. S. Beightler, Foundations of Optimization, Prentice-Hall, Englewood Cliffs,


1967.

[9] W. I. Zangwill, Nonlinear Programming: A Unified Approach, Prentice-Hall, Englewood


Cliffs, 1969.

[10] Parviz Parchami-Ghaferokhi, Geometric Programming: Methods for Dealing with Degree
of Difficulty, M.S. Thesis, Dept. of Industrial Engineering, Kansas State University, 1973.

[11] R. Eckhardt, Stan Ulam, John von Neumann, and the Monte Carlo method, Los Alamos
Science, Special Issue (15), pp. 131-137.

[12] W. C. Conley, Computer Optimization Techniques (Revised Edition), Petrocelli Books, New
York, 1985.

[13] M. A. Banbura, Maximum Likelihood Estimation of Factor Models on Data Sets with
Arbitrary, Pattern of Missing Data, Social Science Research Network. Retrieved September 1,
2012 from SSRN Electronic Library (Working Paper Series No. 1189/May 2010,:
http://ssrn.com/abstract_id=1598302).

Page 18
[14] C. Faloutsos, Analysis of the n-dimensional quadtree decomposition for arbitrary hyper-
rectangles, 1903. Retrieved September 15, 2012 from
http://drum.lib.umd.edu/bitstream/1903/678/2/CS-TR-3381.pdf.

[15] Frontline Systems, Inc., Incline Village, NV 89450, info@solver.com.

[16] A. H. Boas, Optimization via Linear and Dynamic Programming, Chem. Eng., 70 April 1,
1963, 85-88.

[17] L. T. Fan and C. S. Wang, The Discrete Maximum Principle, Wiley, New York, 1964.

[18] H. Binous and A. Bellagi, Design of Optimal Multistage Heat Exchanger, Wolfram
Demonstrations Project using Wolfram CDF Player, January 25, 2016. Retrieved from
http://demonstrations.wolfram.com/DesignOfOptimalMultistageHeatExchanger/.

[19] Kedar Telang, F. Carl Knopf, and Ralph W. Pike, computer program for diagnosing and
optimizing a heat exchange network (HEN) called the HEN (THEN) using pinch technology at
Louisiana State University, www.mpri.lsu.edu/THENManual.PDF, March 1, 2001.

[20] ProSim SA, Simulis Pinch, a program that permits diagnosing and optimizing a heat
exchanger network in EXCEL, www.prosim.net, 2017.

Page 19

S-ar putea să vă placă și