Can spreadsheet solvers solve demanding optimization problems.pdf

download Can spreadsheet solvers solve demanding optimization problems.pdf

of 8

Transcript of Can spreadsheet solvers solve demanding optimization problems.pdf

  • 7/29/2019 Can spreadsheet solvers solve demanding optimization problems.pdf

    1/8

    Can Spreadsheet Solvers

    Solve DemandingOptimization Problems?EUGE NIO C. FERREIRA, 1 ROMUALDO SALCEDO 2

    1 Centro de Engenharia Biolo gicaIBQF, Universidade do Minho, Braga, Portugal

    2 Departamento de Engenharia Qu mica, Universidade do Porto, Porto, Portugal

    Received 21 July 2000; accepted 2 January 2001

    ABSTRACT: Practicing engineers resort to modular simulators or to algebraic tools suchas GAMS or AMPL for performing complex process optimizations. These tools, however, have asignicant learning curve unless they have been introduced at the undergraduate levelbeforehand. In this work we show how the Solver feature of the Excel spreadsheet can be usedfor the optimization of a fairly complex system, i.e., a classic solvent extraction/pollutionprevention with heat integration process. The specic goal was the design optimization forcontinuous recovery of organic solvents (VOCs) using a gas absorption tower with solventrecovery in a stripper. It is shown that the Solver feature of the Excel spreadsheet can be usedto converge on local optima for these complex systems, provided proper care is taken in the

    solution procedure. The complexities of optimization can also be demonstrated with this tool,as can several common pitfalls encountered during optimization. 2001 John Wiley & Sons, Inc.Comput Appl Eng Educ 9: 4956, 2001

    Keywords: optimization; process synthesis; spreadsheets

    INTRODUCTION

    With the advent of personal computers based onfriendly environments with graphical interfaces suchas Windows 95/98 or MacOS, and the widespreadavailability of powerful `what-if' spreadsheets with

    optimization capabilities such as the EXCEL Solverfrom Microsoft Co., most engineering students areattracted to using these tools, which require aminimum amount of effort in building a typicalsimulation/optimization problem, in comparison withstandard high level language coding. Since practicingengineers also use spreadsheets for many tasks, and

    since process optimization is steadily becoming acommon task, it is important to establish to whatextent these tools are capable of solving demandingoptimization problems.

    An interesting optimization problem dealing withthe concepts of process synthesis including heat

    integration and solvent recovery can be found inUmeda [1] and Umeda and Ichikawa [2]. The problemshown in this paper has been adapted from theseauthors, and Silverberg [3] shows that this process iswidely in use.

    The problem shown in this paper has been adaptedfor demonstration purposes in two courses, respec-tively, Strategy of Chemical Processes in the Chemi-cal Engineering Department at the Universidade doPorto, and Strategy of Process Engineering in the

    Correspondence to E. C. Ferreira ([email protected]) 2001 John Wiley & Sons, Inc.

    49

  • 7/29/2019 Can spreadsheet solvers solve demanding optimization problems.pdf

    2/8

    Biological Engineering Department at the Universi-dade do Minho, both in the north of Portugal.

    PROCESS

    The continuous and steady-state process under studyis shown in gure 1. It consists of an absorber column(packing tower) and a stripper (plate tower), with heatrecovery, with the objectives of solvent recovery and/ or recovery of organic solvent (VOC) abatement.

    Basically, the gaseous feeding F with a molefraction y1 of a gaseous solute to be recovered orremoved, is fed to an absorber, where an appropriatesolvent with owrate L is counter currently enrichedin the solute. For example, Silverberg [3] states thatproper solvents (polyethylene glycol ethers) mayremove up to 80 different VOCs. The extractionsolvent is recovered in a plate tower by stripping, andthe solute in the overhead vapors is condensed forrecovery or further disposal. The extraction solvent iscooled and returned to the absorber, where some fresh

    solvent needs to be added to account for losses in theoverhead vapors.The entire set of equality constraints is given in the

    Table 1. The absorber diameter [Eq. (f 9 in Table 1)]was computed so that the vapor velocity is 75% of the ooding velocity. The stripper diameter can beestimated from the Souders-Brown equation [4]

    V M K &l &g&gr Y

    where V M is the supercial vapor velocity and K anempirical constant, and from the vapor load,V v Q2a!&g . The Fenske-Underwood equations[Eqs. (f 24 ) and (f 25 )] were used to compute the mini-mum number of plates and the minimum reux ratio,and the number of plates [Eqs. (f 26 ) and (f 27 )] wascomputed from the Eduljee approximation to Gilli-land's graphical method [4].

    The objective function is to maximize the protand is given by the difference between sales from therecovered VOC and operating and annualized invest-ment costs,

    F obj P p DM l x3 C gFM g C l D 1 x3 M lC w w1 w4 C sw2 C e HP l HP 2InvF c Y

    where the investment costs are given by

    Inv C z ZD1X0a C n ND1X085s C a A

    0X556l A

    0X5562

    A0X556

    3 A0X5564

    C hp HP 0X3l HP

    0X32

    The problem is subject to the 40 equality constraintsgiven in Table 1 as well as to the following processinequality constraints:

    L ` 300 kg mol.hr 1 (maximum owrate),R ` 20 (maximum reux)

    Thus, this problem, as formulated, has 45 independent(unknown) variables and 40 equations with a total of ve degrees of freedom.

    Figure 1 Schematic representation of the process.

    50 FERREIRA AND SALCEDO

  • 7/29/2019 Can spreadsheet solvers solve demanding optimization problems.pdf

    3/8

    Table 1 Process Design Equation

    Absorber

    f 1 F G Dx3 0 f 2 Fy 1 Lx2 L D x1 Gy2 0 f 3 N og

    1

    1 HGPL

    ln 1

    HG

    PL y1 H P x2 y2

    H P x22 3

    HG

    PL 4 50

    f 4 H og H g HGH lPL

    0

    f 5 H g FM g Aa

    Scgp 0 L D M l

    Aa

    0

    f 6 H l L D M l

    Aa" l

    0 Sclp 0 f 7 Z N og H og 0 f 8 Aa %

    D2a4

    0

    f 9 Da

    4GM g

    0X75%G f 3600

    r 0

    f 10 log10 G2f

    ap43

    1g&g&l " l" g

    0X24 51X74 L M lGM g 0X25 &l

    &g 0X125

    0

    Pump no. 1 f 11 HP 1 K p1 L D N 0Pump no. 2 f 12 HP 2 K p2 LZ 0Heat Exchanger no. 4 f 13 Q4 Lcp T 5 T 1 0 f 14 Q4 W 4cpw T o T i 0 f 15 Q4 U 4 A4 T lm4 0 f 16 T lm4

    T 5 T o T 1 T i

    ln T 5T oT 1T i 0

    Heat Exchanger no. 3 f 17 Q3 L D cp T f T 1 0 f 18 Q3 Lcp T 4 T 5 0 f 19 Q3 U 3 A3 T lm3 0 f 20 T lm3

    T 1 T 5 T f T 4ln T 1T 5T f T 4

    0

    Stripper and heat exchangers f 21 L D x1 Lx2 Dx3 0 f 22 L D cpT f Q2 Dc pT 3 LcpT 4 Q l 0 f 23 %

    D2s

    4

    22X4Q2T 4

    273X2 3600 ! M lK &l &g a&gp

    0

    f 24 Rm 1

    a 1 x3 x1 a

    1 x31 x1 !0

    f 25 N m lnx3

    1 x31 x2

    x2 !0ln a 0 f 26 N N m X a 1 X 0 f 27 X 0X75 1

    R Rm R 1

    0X56684 50

    CAN SPREADSHEET SOLVERS SOLVE OPTIMIZATION PROBLEMS 51

  • 7/29/2019 Can spreadsheet solvers solve demanding optimization problems.pdf

    4/8

    SIMULATION

    To use the EXCEL application, it is necessary tospecify a sequence for the simulation step, i.e., whatvariables are to be computed from which equation,and on which order. A preprocessing step was appliedto this example, where the number of theoreticalstages ( N ) and the bubble points ( T 2, T 4) were a priorichosen as decision variables. This makes it possible todene this problem as a mixed integer nonlinearprogramming (MINLP) problem (although not strictlynecessary here) and to linearize two equations [Eqs.(f 35 ) and (f 38 )] to avoid the iterative calculation of twotemperatures. A serial solution could easily be obt-ained [5], and the corresponding solution procedure isgiven in Table 2.

    The remaining degrees of freedom correspond tothe variables {W 4 , A1}. The corresponding FOR-TRAN 77 code of this sequencing was interfaced withan adaptive random search MINLP optimizer [6,7] for

    comparison with the solver capabilities built withinthe EXCEL environment.

    SPREADSHEET SOFTWARE

    Spreadsheet programs are becoming nowadays aubiquitous tool in Chemical Engineering mathema-tical calculation [8,9,10] due to its popularity andavailability. The Microsoft Excel spreadsheet, aMicrosoft Ofce family member, was used as adevelopment framework, coupled with the Solvertool, a companion of Excel since 1991 (version 3.0).The Excel solver has two nonlinear optimizers, respe-ctively, a quasi-Newton method and a generalizedreduced gradient algorithm [11]. Linear and integerproblems use the linear simplex method with boundson the variables, and the branch-and-bound method,implemented by Fylstra et al. [12].

    The solver options allow one to specify theapproach used to obtain better initial estimates of

    Table 1. ( Continued )

    f 28 Q1 D! R 1 0 f 29 Q1 W 1cpw T o T i 0 f 30 Q1 U 1 A1 T lm1 0 f 31 T lm1

    T 3 T o T 3 T iln

    T 3

    T oT 3T i

    0

    f 32 Q2 W 2! w 0 f 33 Q2 U 2 A2 T lm2 0 f 34 T lm2 T s T 4 0 f 35 x2e A1 B1a T 4 T ref 1 x2 e A2 B2a T 4 T ref P 0 f 36

    Px 3e A1 B1 a T 3 T ref

    P 1 x3e A2 B2a T 3 T ref 1 0

    f 37 T f T 2 q 1 !a cp 0 f 38 x1e A1 B1a T 2 T ref 1 x1 e A2 B2a T 2 T ref P 0Make-up f 39 x2

    Lx2 L D 1

    x3

    0

    f 40 L D 1 x3 L 0

    Table 2 Serial Solution Procedure with {N,W 4 ,T4 ,T2 , and A 1 } as Decision Variables

    Equation (variable)

    f 36 T 3 Yf 14 Q4 Yf 34 T lm2 Yf 35 x2 Yf 25 N m Yf 26 X Yf 31 T lm1 Yf 30 Q1 Yf 29 W 1 Yf 38 x1 Y

    f 24 Rm Yf 27 R Yf 28 D Yf 1 G Yf 21 L Yf 2 y2 Yf 11 HP 1 Yf 13 T 5 Yf 16 T lm4 Yf 15 A4 Yf 18 Q3 Y

    f 17 T f Yf 20 T lm3 Yf 19 A3 Yf 22 Q2 Yf 23 Ds Yf 32 W 2 Yf 33 A2 Yf 37 q Yf 39 x2 Yf 40 L Y f 3 N og Yf 10 Gf Yf 9 Da Yf 8 Aa Yf 5 H g Yf 6 H l Yf 4 H og Yf 12 HP 2

    52 FERREIRA AND SALCEDO

  • 7/29/2019 Can spreadsheet solvers solve demanding optimization problems.pdf

    5/8

    the basic variables in each one-dimensional search,either using linear extrapolation from a tangent vectoror quadratic extrapolation, which may improve theresults on highly nonlinear problems. It is alsopossible to specify the differencing method used toestimate derivatives of the objective and constraint

    functions: forward in which the constraint valueschange relatively slowly, or central method used forproblems in which the constraints change rapidly,especially near the boundaries of the active con-straints. It is possible to control the solution processby limiting the time taken and the number of interimcalculations by the solution process; it is also possibleto control the precision within which constraints areconsidered binding and the convergence criteria forthe solutions.

    Instead of manually invoking repeatedly the Solverdialog box in the Tools menu (a time-consuming,repetitive action), we have automated this task by

    creating and running a single macro. A macro is aseries of commands and instructions grouped togetheras a single command to accomplish a task automa-tically. The macro is created invoking the macrorecorder that saves the series of commands in theVisual Basic for Applications programming language

    [13,14]. A recorded macro can be opened in the Visual Basic Editor to modify the source code. Macros maybe assigned to a toolbar, a menu, shortcut keys, or abutton (see Fig. 2). Running the macro is as simple asclicking the button.

    Temperature T 3 was estimated using the Excel``Goal Seek'' feature to solve iteratively the nonlinearequation f 36 since this is the only unknown variablefrom this equation. Goal Seek permits one to nd aspecic result for a cell by adjusting the value of anyone other cell. Equation (f 36 ) was written in the goalcell and a starting (initial) value to T 3 was assigned inanother cell (see Fig. 3). This dialog box was also

    Figure 2 Snapshot of the Excel screen: results for case1 optimization.

    CAN SPREADSHEET SOLVERS SOLVE OPTIMIZATION PROBLEMS 53

  • 7/29/2019 Can spreadsheet solvers solve demanding optimization problems.pdf

    6/8

    automated by creating a macro assigned to the ``Com-pute T 3 '' button.

    The workspace architecture of Excel allows one tointegrate multisheets in the same le. In this example,we have put together the scheme (Fig. 1), the datasheet, the information matrix, the algorithm, and themacro module with source coding in the Visual Basiceditor. This Excel workbook le is available fordownload on the World Wide Web at http://www.de-b.uminho.pt/ecferreira/download/abs_str.zip

    RESULTS AND DISCUSSION

    We have studied two cases, one corresponding tosolvent recovery (Case 1) and the other to air pollutionabatement (Case 2). The differences rely on the addi-tion of a constraint for the absorption tower collectionefciency, i.e.,

    1 Gy2Fy 1

    b 0X99

    and in the pertinent physical and economical data. Theair pollution problem is much more difcult to solvesince it is much harder to nd an initial feasible point,due to the highly constrained search space. The perti-nent data for both the cases are given in Table 3.

    The search space for the decision variables {N, W 4 ,A1} was set quite wide, respectively, [0, 100], [0, 1000kg h 1], and [0, 200 m 2], to minimize the chance of

    missing the global optimum. As the number of theo-retical plates does not, in general, reect the numberof real plates, all decision variables were consideredcontinuous. This also avoids difculties in dening aMINLP solution strategy within the EXCEL spread-sheet since this environment does not have MINLPoptimization capabilities. The search intervals for T 2and T 4 were estimated from the boiling points of thepure components giving, respectively, [314.4, 350.6K] and [334.4, 370.6 K] for Cases 1 and 2.

    The MSGA algorithm [6,7] was applied to both thecases and, irrespective of the starting point, alwaysarrived at feasible points very close to the global opti-mum. The EXCEL spreadsheet was applied to boththe cases and, in general, the following conclusionscould be taken:

    (1) A feasible starting point should rst beobtained by trial and error to avoid trappingthe solver with mathematical inconsistencies,i.e., negative arguments of logarithmic func-tions from which it cannot recover. This canbe easily performed by simply changing thevalues of the decision variables and immedi-ately seeing the impact on the simulation/ optimization procedure.

    (2) Not all initial values that obey 1 will convergeto the global optimum, or will converge atall.

    So, what are the possible benets of using theEXCEL spreadsheet to solve optimization problems?For one, it is easier to build a typical simulation/ optimization problem in the EXCEL environmentrather than coding it in high level languages, orlearning a new algebraic environment. It is also veryconvenient to have an integrated workbook wherebythe process diagram, data, owsheets, occurrencematrices, and simulation procedure are all intercon-nected and easily visualized. This concept is notpossible with the other approaches and allows one toeasily add new constraints and process specications.The physical and economic data can be easily chang-ed and its effect can be immediately reected in thesimulation/optimization results.

    CONCLUSIONS

    The problem analyzed in this paper is of sufcientcomplexity to allow the observation of several conver-gence problems within the EXCEL solver. It is ouropinion that irrespective of the problem statement, aninitial feasible point is required for progress toward a

    local optimum. Since the optimizers within theEXCEL environment are local search algorithms[12], convergence to the global optimum is onlyguaranteed with convex problems.

    Although the EXCEL solver is not comparablewith robust optimizers such as the MSGA [6,7] orother global search algorithms [15], it has, from thepoint of view of practicing engineers, the distinctadvantage of providing an integrated framework forproblem setting, visualization, inspection, and solving.

    Figure 3 Solving a nonlinear equation by using ``GoalSeek''.

    54 FERREIRA AND SALCEDO

  • 7/29/2019 Can spreadsheet solvers solve demanding optimization problems.pdf

    7/8

    Table 3 Data

    Case 1 Case 2 Units

    Operating VariablesFeed owrate F 60 200 kmol h 1

    Pressure P 760 760 mm Hg

    Composition y 1 0.4 0.1Composition X 3 0.99 0.95Temperature T 1 303 283 K Temperature T i 293 278 K Temperature T o 298 298 K Temperature T s 393 393 K Reference temperature T ref 230 210 K

    Physical propertiesLiquid density r 1 1500 900 kg m

    3

    Gas density r g 5 2 kg m 3

    Molar weight M 1 154 100 kg mol 1

    Molar weight M g 58 20 kg mol 1

    Specic heat (streams W 1 and W 4 cpw 1 1 kcal kg 1 K 1

    Specic heat (heat exchangers 3 and 4) c p 0.2 0.2 kcal kg 1 K 1

    Liquid latent heat (from stripper) l 50 60 kcal Kg 1Water latent heat (stream w2) l w 500 500 kcal Kg

    1

    Liquid viscosity m1 1.00 10 3 1.00 10

    3 kg m 1 s 1

    Gas viscosity mg 1.85 10 5 1.85 10

    5 kg m 1 s 1

    Liquid diffusivity D 1 2.0 10 9 2.0 10

    9 m2 s 1

    Gas diffusivity D g 2.2 10 5 2.2 10

    1 m2 s 1

    Antoine parameter A 1 32.9 32.9Antoine parameter B 1 14300 14300 K Antoine parameter A 2 30.4 30.4Antoine parameter B 2 13800 13800 K H g parameter a 0.557 0.557 H g parameter b 0.32 0.32 H g parameter g 0.51 0.51 H g parameter d 0.22 0.22 H g parameter f 0.00235 0.00235 m 1 d

    Empiral constant (Souders-Brown equation) K 0.10 0.10 m s 1

    Specic area of llings ap / e3 490 490 m 2 m 3

    Relative volatility a 2 2Global heat transfer coefcient U 1 300 200 kcal m

    2 h 1 K 1

    Global heat transfer coefcient U 2 500 100 kcal m 2 h 1 K 1

    Global heat transfer coefcient U 3 100 200 kcal m 2 h 1 K 1

    Global heat transfer coefcient U 4 200 100 kcal m 2 h 1 K 1

    Henry's constant H 608 208 mm Hg

    Cost factorsFeed F C g 50 10 $ h year

    1 kg 1

    Product Dx 3 Pp 20 65 $ h year 1 kg 1

    Water C w 0.0635 0.0635 $ h year 1 kg 1

    Vapor (reboiler) C s 35.2 35.2 $ h year 1

    kg 1

    Solvent C 1 5 100 $ h year 1 kg 1

    Electricity C e 89.7 89.7 $ h year 1 kg 1

    Heat exchangers C a 350 350 $ (m 2)0.556

    Pumps C hp 1000 1000 $ hp 0.30

    Absorver C z 600 600 $ m 2

    Stripper C n 363 363 $ N 1 (m width) 1.085

    Return of investment F c 0.14286 0.08 $ $ 1 year 1

    Pump CharacteristicsPump 1 kp 1 0.10 0.10 hp h N

    1 kmol 1

    Pump 2 kp 2 0.05 0.05 hp h (m high) 1 kmol 1

    CAN SPREADSHEET SOLVERS SOLVE OPTIMIZATION PROBLEMS 55

  • 7/29/2019 Can spreadsheet solvers solve demanding optimization problems.pdf

    8/8

    REFERENCES

    [1] T. Umeda, Optimal design of an absorber-strippersystem, I&EC Process Design and Dev 8(3) (1969),308317.

    [2] T. Umeda and A. Ichikawa, A modied complexmethod for optimization, I&EC Process Design Dev10(2) (1971), 229236.

    [3] P. Silverberg, A scrubber system tackles 15 differentVOCs, Chem Eng 103(10), (1996), 159.

    [4] J. M. Douglas, Conceptual design of chemical pro-cesses, McGraw-Hill, New York, 1988.

    [5] R. Salcedo and R. Lima, On the optimum choice of decision variables for equation-oriented global opti-mization, Ind Eng Chem Res 38(12), (1999), 47424758.

    [6] R. Salcedo, M. J. Goncalves, and S. Feyo de Azevedo,An improved random search algorithm for non-linearoptimization, Comput Chem Eng 14(19), (1990),

    11111126.[7] R. Salcedo, Solving nonconvex nonlinear program-ming and mixed-integer nonlinear programming pro-blems with adaptive random search Ind Eng ChemRes 31(1), (1992), 262273.

    [8] F. M. Julian, Using spreadsheets in ChemicalEngineering problems. In G. Filby (Editor), Spread-sheets in Science and Engineering, Springer, Berlin,1998, Chap. 6, pp. 171202.

    [9] M. A. Burns and J. C. Sung, Design of separation unitsusing spreadsheets Chem Eng Educ (Winter 1996),6269.

    [10] B. S. Mitchell, Use of spreadsheets in introductorystatistics and probability, Chem Eng Educ (Summer1997), 194200.

    [11] L. S. Lasdon, A. D. Waren, A. Jain, and M. Ratner,Design and testing of a generalized reduced gradientcode for nonlinear programming, ACM Trans MathSoftware 1(4), (1978), 3450.

    [12] D. Fylstra, L. S. Lasdon, A. D. Waren and J. Watson,Design and use of the Microsoft Excel solver Inter-faces 28(5) (1998), 2955.

    [13] Microsoft EXCELVisual Basic for Applications,Microsoft Press, Washington, 1995.

    [14] E. M. Rosen, Visual Basic for Applications, Add-Ins

    and Excel 7.0, CACHE News (45), (Fall 1997), 13.[15] M. F. Cardoso, R. L. Salcedo, S. Feyo de Azevedo,and D. Barbosa, A simulated annealing approach tothe solution of MINLP problems, Comput Chem Eng21(12) (1997), 13491364.

    BIOGRAPHIES

    Eugenio C. Ferreira is an assistant pro-fessor of biological engineering at theUniversity of Minho in Braga, Portugal.He received a BCheE degree and PhDdegree from the University of Porto in 1986and 1995, respectively. His current researchinterests include modeling and control inbio(chemical) and wastewater treatmentprocesses. E. C. Ferreira is currently

    teaching strategy of process engineering, process control, waste-water treatment, and air pollution. More details at author'shomepage: http://www.deb.uminho.pt/ecferreira

    Romualdo Salcedo is an associate profes-sor of chemical engineering at the Uni-versity of Porto, Portugal. He received aBCheE degree from the University of Portoin 1975, a MEng and a PhD degree fromMcGill University, Montreal, Canada,respectively, in 1977 and 1981. His currentresearch interests include simulation andoptimization of nonlinear processes, air

    pollution control, and statistical analysis of time series. R. Salcedois currently teaching process optimization, air pollution, andnumerical methods. More details at author's homepage: http:// www.fe.up.pt/deqwww/staff/RSalcedo.html

    56 FERREIRA AND SALCEDO