10.1.1.121.8277

Upload: aatyf-faxal

Post on 04-Apr-2018

213 views

Category:

Documents


0 download

TRANSCRIPT

  • 7/29/2019 10.1.1.121.8277

    1/11

    2nd Mercosur Congress on Chemical Engineering

    4th Mercosur Congress on Process Systems Engineering

    FREE SOFTWARE FOR CHEMICAL ENGINEER'S

    EDUCATIONAL NEEDS

    Adilson Jos de Assis, Lus C. Oliveira-Lopes*

    School of Chemical Engineering - Federal University of Uberlndia

    Abstract. Free (as in freedom) and open source software have attracted more and more the society attention,specially in academia. The free software idea encourages the cooperative work and it is a strategic factor forscientific development. Under this philosophy, the users have the right to use, study, copy, modify, andredistribute computer programs. This foundation (based on freedom) gives a great deal of motivation forusing free software in educational institutions. There are many available software applications for most areasof knowledge, including the Chemical Engineering area. As a result, there are many software tools built onthis philosophy with the capability of enhancing the engineering learning process. This paper addresses theuse of such tools in many educational Chemical Engineering activities where computer aided tools are agrowing trend towards integrating computing and process simulators throughout the curriculum. This paperdiscusses the implications of the free software ideas in the engineering field, mainly in Chemical Engineeringeducational and professional career; it also reviews the main free packages available for the chemicalengineer's needs with emphasis on numerical and symbolical math processing tools, and on chemical processflowsheet simulators. Discussions on their weaknesses and strengths characteristics as well as opportunitiesfor contributions are presented with examples of their potential use for teaching plantwide processsimulation.

    Keywords: Free software, Chemical Engineering and Education.

    1. Introduction

    Free software is a concept related to the users' freedom to run for any purpose, copy, distribute, study, change

    and improve the software. Access to the source code is a precondition for free software. Free software is,therefore, a matter of freedom, it does not refer to zero-cost software (FSF, 2005). While free software refers to

    software distributed in source form which can be freely modified and redistributed, the concept of Open Source,

    instead, refers to the fact that the source code is open to and for the world to take, to modify and to reuse. An

    open source software and Free softwares, however, have different rationals, views and goals. The question can

    be summarized in the following sentence: For the Open Source movement, the issue of whether software should

    be open source is a practical question, for the Free Software movement it is an ethical and social matter (FSF,

    2005).

    A recent paper by Wheeler (2005) presents a statistical analysis showing the overall acceptance of free

    softwares. SourceForge.net1 and Freshmeat.net2, currently with around 140 thousand registered projects and over

    1.5 million registered users, are the world's largest Free Software/Open Source software repositories and

    development websites. One can think as if those numbers might represent the rapid growth of the free software

    use in todays computers applications.

    Chemical engineers have been proving to be quite able to take advantages of new opportunities presented by

    rapid changes in its professional world. The last few decades has witnessed the Chemical Engineering activity

    built on the basic science structure and incorporating a wider approach to process design and problem solving.

    *To whom all correspondence should be addressed.

    Address: Federal University of Uberlndia, School of Chemical Engineering - Av. Joo Naves de vila, 2160

    38408-100 - Uberlndia-MG Brazil. E-mail: [email protected] http://sourceforge.net

    2 http://freshmeat.net/

    1

  • 7/29/2019 10.1.1.121.8277

    2/11

    2nd Mercosur Congress on Chemical Engineering

    4th Mercosur Congress on Process Systems Engineering

    By doing so, chemical engineers have contributed significantly to the productivity improvements of the heavy

    chemical industries and also in industries such as: food, utilities, pharmaceuticals, biotechnology, electronics, and

    software. Chemical engineers have also succeeded in the service industries, management consultancy,

    information technology, commerce and banking (Wheeler, 2005). The professional spectrum of action for

    chemical engineers and the prospects for the future seemed to be endless, provided that new chemical engineers

    is educated continuously to meet those challenges. For the purposes of this paper, chemical engineering is the

    conception, development, design, improvement and application of processes and their products. This includes the

    economic development, design, construction, operation, control and management of plant for these processes

    together with research and education in these fields.(Gillett, 2000). Addressing the overall area of the chemical

    engineer activity, therefore, is out of the scope of this paper and will not be discussed herein. This paper aims to

    offer a contribution on demystifying the use of free/open source softwares in the basic chemical engineer

    professional/educational activities.

    1.1. Taking Free Software to the Portals of Chemical Engineers Education the big picture

    One can categorize the chemical engineer main software needs into the categories shown in Table 1.

    Table 1 Software Categories

    Connectivity Web browsers, e-mail client, FTP, etc

    Professional text editing Word processor, presentation softwares

    Multimedia/Graphics editions Images viewer/editor, graphing softwares

    Programming and development Compilers, spreadsheet, process simulator

    With so many free/open source softwares available, one of the largest difficulties in migrating away from

    proprietaries systems to a free platform is the lack of comparable softwares. Newbies usually search for software

    they are accustomed to, and advanced free software-users cannot answer their questions since they often do not

    know too much about personal user needs. The list of equivalents/replacements/analogs of proprietaries

    softwares presented in Table 2 is based on our own experience and it might not agree with the readers experience

    neither it has the ambition to be a complete picture, since this a target moving in great speed. The Table 2 aims to

    show that there are free/open source available in most of chemical engineers software demand. The lack offree/open source software may be isolated into very specific applications. In all cases, it is likely that the

    softwares distributors have their software available in several operational system framework.

    From our experience, if one takes out the list of very specific softwares, such as the one for heat exchange

    networks design, model predictive control analysis and so forth, the remaining softwares are likely to be

    equivalent to the one shown in Table 2. Herein, the comparison is made with Windows and Linux based

    softwares for the most used text/graphics editing, programming and development tools for a chemical engineer.

    The goals in presenting Table 2 are twofolds: (i) It shows that there are equivalent, and same quality level

    softwares in most operating system platforms. Therefore, Table 2 shows that even if one is driven to use a

    proprietary operating system such as the Windows operating system, it is still possible to use free/open source

    2

  • 7/29/2019 10.1.1.121.8277

    3/11

    2nd Mercosur Congress on Chemical Engineering

    4th Mercosur Congress on Process Systems Engineering

    softwares based on Windows, and (ii) Table 2 can work as a strategic way of migrating from proprietary systems

    to free/open source ones.

    Table 2 Basic Software Tools for Chemical Engineers

    Softwares Windows Type Linux Type

    Text and Graphics Edition

    Office Suite MS Office PS

    OpenOffice FS

    OpenOffice;KOffice Suite;AbiWord ; Emacs

    FS

    LaTeX Scientific WorkPlace/Word PS teTeX FS

    Miktex FS FS

    LaTeX editor/shell WinEdt PS

    TeXnicCenter FS

    GNU TeXmacs FS

    Kile;Texmaker;GNU TeXmacs

    FS

    Texmaker NC

    PDF Adobe Acrobat PS PDFLatex FS

    Images IrfanView FW Skencil; Sodipodi FS

    Photoshop; CorelDraw PS gnuplot FW

    wgnuplot FW Xfig FS

    Origin PS KmPlot FS

    Gimp; Blender; Dia FS Gimp; Blender; Dia FS

    Programming and development

    Symbolic Maple; Mathematica; MuPAD PS Maple; Mathematica; MuPAD PS

    Xmaxima; JACAL; Yacas FS (X)maxima; JACAL; Yacas; Calc FS

    CAD AutoCad PS SagCad;Varkon Cad; QCad* FS

    Simulation Sim42 FS Sim42# FS

    Statistical R FS R FS

    Statistica; Statgraphics PS

    Development Matlab PS Matlab PS

    Scilab FS Scilab FS

    Octave FS Octave FS

    Python FS Python FS

    Compaq Visual Fortran; C PS GNU Pascal; Free Pascal FS

    OpenWatcom FS Gcc (C, C++, Fortran,etc) FS

    *Commercial; #Accessible using Simba over the net.

    FS: Free/Open Source Software; PS: Proprietary Software; NC: Non-commercial; FW: Freeware.

    For sake of brevity, in this text, only the softwares Maxima, Scilab, and Sim42 will be discussed with

    illustrative potential applications. Maxima is a symbolic calculation environment, Scilab is a numeric evaluating

    platform, and Sim42 is a plantwide simulation tool for steady-state process simulation. This text was prepared

    3

  • 7/29/2019 10.1.1.121.8277

    4/11

    2nd Mercosur Congress on Chemical Engineering

    4th Mercosur Congress on Process Systems Engineering

    using the word processor available in OpenOffice. Half of it was written in a Windows based computer, and the

    other half was written in a Linux based personal computer.

    2. Using Free/Open Source Softwares

    In Chemical Engineering, the softwares for numerical computation are mostly written in Fortran 77, Fortran

    95, and C, although C++, Java and Python are becoming more common. There are important libraries available,

    such as the LAPACK library for numerical linear algebra and LINPACK, EISPACK, and BLAS. In the

    interactive framework, the most common interactive systems are: (i) Matlab (a commercial product), (ii) Octave,

    and (iii) Scilab. Those three packages are quite similar, differing mainly in the degree of graphics availability

    and toolboxes. Octave and Scilab are free softwares with same level of numerical capabilities, it is fair to say,

    however, that while Octave has a much closed language structure compared to one of Matlab, Scilab is in a much

    more advanced developed stage with many toolboxes available to the user. Programs written for Matlab, Scilabor Octave typically require very little change when migrated from one system to another.

    It is important to highlight that systems for symbolic computation, also called computer algebra, are quite

    different from those for numerical computation, not only because of the task they are designed for, but also in

    their structure. There are no standard libraries for symbolic computation and the major computer algebra systems

    have been developed from scratch as interactive systems. The most common systems are: (i) Mathematica

    (commercial), (ii) Maple (commercial), (iii) Maxima. Even though there exist other systems exist such as:

    Reduce, Derive, Calc, Yacas, JACAL and so forth, they do not have however, the same broad range of

    capabilities as the major systems. While numerical systems are notable for their similarities, symbolic systems are

    notable for their differences, translating something from one system to another is often difficult. If one keeps in

    mind that the goals for a computer algebra system is symbolic calculation, the capabilities of the three systems

    are quite similar. As the internal representation of symbolic expressions are markedly different, quite often one

    system can be much better or worse than the others for specific problems.

    In this paper, the tool for plantwide simulation is Sim42, an open source chemical process simulator. From

    Sim42 Manual, "was designed to provide a state of the art interactive process simulation environment containing

    advanced unit operations such as distillation towers, compressors and balances coupled with an advanced solver

    capable of supporting bidirectional information flow, multiple flow sheets and automatic convergence of recycle

    streams.". Details on the softwares presented in this paper can be found in Table 3.

    Table 3 Maxima, Scilab and Sim42 Software detailed information

    Software Download license Version

    Maxima http://maxima.sourceforge.net GNU Public License V.5.9.1

    Scilab http://scilabsoft.inria.fr/ Scilab License V.3.0

    Sim42 http://www.SIM42.org/ BSD Open Source License V.1.0

    4

  • 7/29/2019 10.1.1.121.8277

    5/11

    2nd Mercosur Congress on Chemical Engineering

    4th Mercosur Congress on Process Systems Engineering

    2.1. Using Maxima

    Maxima is a computer algebra program designed for the manipulation of algebraic expressions (Souza et. al.,

    2004). You can use Maxima for manipulation of algebraic expressions involving constants, variables, and

    functions. It can differentiate, integrate, take limits, solve equations, factor polynomials, expand functions in

    power series, solve differential equations in closed form, and perform many other operations. It also has a

    programming language that you can use to extend Maximas capabilities. Maxima began as part of Project Mac

    at MIT, an investigation into artificial intelligence, in the late 1960's. The original name was MACSYMA, which

    stands for project MACs SYmbolic MAnipulator. It is written in Lisp, and much of the syntax for other

    languages such as Maple was originated from Maxima, which has capabilities such as:

    Arithmetic: Arbitrary size integers, arbitrary precision rational numbers, complex numbers, surds.

    Algebra: Manipulation of algebraic, trigonometric and exponential expressions, polynomial algebra, solution

    of equations and systems of equations. Linear Algebra: Matrix algebra, solution of linear equations, eigenvalues and eigenvectors.

    Calculus: Differentiation, integration, limits, Taylor series, solving differential equations.

    Maxima is an interactive system, in other words, one types commands into Maxima instructing it to perform

    certain calculations and Maxima responds with the results. There are three user interfaces: (i) maxima - this is a

    plain terminal interface, (ii) xmaxima - this is an X-windows based interface, and (iii) one can run Maxima under

    emacs or Texmacs. Besides offering the usual editing facilities, those packages allow Maxima to print results

    using LaTeX. Maxima only solves linear system of Ordinary Differential Equations (ODEs). Since nonlinear

    system of ODE is very common in Chemical Engineering field, the user has two options to solve mathematical

    models resulting in coupled nonlinear ODEs: (1) linearization around an arbitrary point, thus transforming the

    nonlinear system of ODEs into a linear system; (2) use of implemented numerical methods.

    Figure 1 shows examples of Maxima utilization. Figure 1a illustrates an application of the symbolic analysis

    using Maxima working as a session of TexMacs. Maxima is not intended to perform numerical calculations.

    Nevertheless, whenever necessary, its programming capabilities can be used to extend its power to include

    advanced numerical calculations. To illustrate this fact, Figures 1b illustrates a surface response analysis and in

    Figure 1c an example of a Continuous Stirred Tank Reactor (CSTR) is investigated. All parameters and

    formulation are described in Shacham et. al. (1994). Figure 1c presents a steady state multiplicity analysis

    indicating the heat removed and heat generated as functions of temperature. The used software codes are

    available upon request.

    2.2. Using Scilab

    The Scilab is a scientific software package for numerical computations under development since 1990 by

    researchers from INRIA and ENPC, and since May 2003 maintained and developed by Scilab Consortium.

    Scilab provides a powerful open computing environment for engineering and scientific applications including

    hundreds of mathematical functions with the possibility to add interactively programs from languages such as C,

    and Fortran. It has a sophisticated data structures (including lists, polynomials, rational functions, linear systems,

    to name a few), an interpreter and a high level programming language (Oliveira-Lopes, 2004). Amongst the mostimportant available toolboxes are: (a) 2-D and 3-D graphics, (b) linear algebra, (c) polynomials and rational

    5

  • 7/29/2019 10.1.1.121.8277

    6/11

    2nd Mercosur Congress on Chemical Engineering

    4th Mercosur Congress on Process Systems Engineering

    functions, (d) ordinary and algebraic differential Equations solvers (ODE and DAE), (e) control, (f) optimization,

    (g) System modeler/Simulator (Scicos), (h) Graphs and Networks, (i) signal processing, (j) Parallel calculations,

    (k) Statistics, (l) interface to several important softwares, (m) Neural networks, and (n) fuzzy logic inference

    toolbox.

    (b)

    (a) (c)

    Figure 1 (a) Working with the continuity equation performed in a TexMacs session of Maxima; (b) Surface

    analysis in Xmaxima; (c) Heat removed (Qr) and heat generated (Qg) as functions of temperatures. To=530oR.

    To illustrate the application of Scilab to the CSTR described in the previous section, a few analysis will be

    carried on. Figure 2 presents the Heat generated/removed versus Temperature for the reactor. Figure 3 presents

    the phase portrait analysis for a CSTR. The eigenvalues are shown to illustrate the performed stability analysis:

    1={-0.5321479, 3.0502801, -188.07269}(Unstable), 2={0.0775624 2.753409i, -187.72056} (Unstable

    oscillatory), 3={- 1.2669761,- 0.9756084,- 188.70011} (Stable).

    From LMI optimization to robust control, Scilab has a great deal of toolboxes available, with special

    significance to process control tools. With Scilab, one can easily implement linear algebra, DAE solution and

    classical control analysis. As an illustration, Figure 4 shows a Bode plot for a second-order system.

    6

  • 7/29/2019 10.1.1.121.8277

    7/11

    2nd Mercosur Congress on Chemical Engineering

    4th Mercosur Congress on Process Systems Engineering

    Figure 2 Heat removed/generated as function of temperature. To=530 oR.

    Figure 3 Phase portrait for CSTR. Arrows indicate steady state conditions: P={Ca, T, Tj}; P1={0.2451;599.99;594.63}; P2={0.0591;651.06;641.79};P3={0.4379;537.16;536.62}. To=530 oR. .

    7

  • 7/29/2019 10.1.1.121.8277

    8/11

    2nd Mercosur Congress on Chemical Engineering

    4th Mercosur Congress on Process Systems Engineering

    2.3. Using Sim42

    Simulator42 or Sim42 is an open source process simulator that aims to provide an accessible simulator to the

    Chemical Engineering community. Some features: (i) it has being written in the Python language, (ii) the

    simulator core was designed to be independent of both user interfaces and thermodynamic methods provider, (iii)

    a graphical interface has been developed for the project and an independent command/scripting interface is also

    available, (iv) the flowsheet solver can propagate partial information both backwards and forward, this feature

    allows many complex problems to be solved without iterative calculation of recycle loops. Consistency checks

    are used to avoid unintended over specification of problems, (v) the simulator does not require recycle unit

    operations, but rather the use of estimate values allows the solver to recognize the existence of recycles and

    converge them simultaneously.

    Figure 4 Bode diagram for a second-order process. G(s)=2/(25s2+12.5s +1)

    Sim42 has several unit operation available:

    1. BalanceOp - performs material and energy stream balances;

    2. Component Splitter - adiabatic stream splitter;

    3. Compressor/Expander - adiabatic compressor or expander;

    4. Controller - allows you to modify the value of a parameter (monitored variable) in order to match a

    specification (controlled variable);

    5. ConvReactor - material and energy balances around a conversion reactor. A conversion reactor is a reactor

    where the user specifies the conversion of each reaction with respect to a key component;6. Cooler - energy balance that simulates the behavior of a single side of a heat exchanger;

    8

  • 7/29/2019 10.1.1.121.8277

    9/11

    2nd Mercosur Congress on Chemical Engineering

    4th Mercosur Congress on Process Systems Engineering

    7. CrossConnector - transports intensive variables and flows across a property package boundary, honoring the

    flows, compositions and two intensive variables that you specify;

    8. EnergySensor - Stream_Energy with a SignalPort having the energy flow as its value;

    9. Equation - allows you to add equations to your flowsheet to model special unit operations that are not

    available in Sim42;

    10. EquiliReactor material and energy balances for a gas-phase equilibrium or Gibbs reactor;

    11. Heater - energy balance that simulate the behavior of a single side of a heat exchanger;

    12. HeatExchanger - two-sided heat exchanger;

    13. LiqLiqExt - liquid-liquid counter-current extractor;

    14. Mixer - adiabatic mixing process;

    15. PropertySensor - detects a physical property from a port and sends a signal with the value of the physical

    property selected;16. Pump - performs the mechanical energy balance necessary to determine the power necessary to move a liquid

    fluid for a given pressure increase;

    17. PumpWithCurve - performs the mechanical energy balance necessary to determine the power necessary to

    move a liquid fluid for a given pressure increase taking into account the pump characteristics as represented

    by the pump curves;

    18. Script Unit Op - powerful calculator-like structures that can be read by flow sheets;

    19. SimpleFlash - separator is used to separate gas and liquid streams;

    20. Set - used to specify a value based on a value calculated by a different port;

    21. Splitter - adiabatic stream splitter;22. Stream_Energy - acts like a holder for energy flows;

    23. Stream_Material - acts like a holder for flash results and physical property values;

    24. Stream_Signal - acts like a sensor for a single parameter value as well as a transmitter for the sensed

    parameter;

    25. Tower - rigorous distillation tower using the inside-out algorithm for the solution of the material and energy

    balances that arise from the tray to tray connections. The tower uses RedTrees implementation of Russells

    algorithm (Russell, 1983);

    26. Valve - isenthalpic valve .

    Perhaps the main drawback of using Sim42 is the fact that is does not contain a open source property package

    system. The one available is freeware (it is not open source) and contains only a simple equation of state based

    package (RK- Redlich Kwong) and an ideal solution property package. Both packages are from Virtual Materials

    Group. Nevertheless, as sim42 is an open source project one can develop their own property package.

    In the following, a distillation column employing a Russell inside/out algorithm will be considered. Let us

    consider an example given by a 13 stages distillation column presented by Henley and Seader (1981). The feed is

    made at stage 7 (from top to bottom) of a slightly superheated vapor (105F, 400psia), with composition: C1:

    160.0 lbmole/hr, C2: 370.0 lbmole/hr, C3: 240.0 lbmole/hr, C4: 25.0 lbmole/hr, C5: 5.0 lbmole/hr. The vapor

    destilate flow is given by 530.00 lbmole/hr. The column operates at a constant pressure of 400psia and with a

    1000 lbmole/hr reflux of saturated liquid.

    9

  • 7/29/2019 10.1.1.121.8277

    10/11

    2nd Mercosur Congress on Chemical Engineering

    4th Mercosur Congress on Process Systems Engineering

    The simulation of this column gives the results of Table 4. Figure 5 presents the SimBa interface for this

    example and Figure 6 shows typical composition profile from Sim42.

    Table 4 Simulation results for Henley & Seader distillation column.

    Bulk Vapour Liquid Units

    Fraction 1 1 0

    Temperature 105 105 105 F

    Pressure 400 400 400 psia

    Enthalpy 5009.7687 5009.7687 1394.0552 Btu/lbmol

    S 40.858974 40.858974 35.156396 Btu/lbmol-F

    molarV 11.61708 11.61708 1.7537613 ft3/lbmol

    ZFactor 0.76683601 0.76683601 0.11576466

    MolecularWeight 32.611358 32.611358 40.342986

    StdLiqMolarVol 1.4160625 1.4160625 1.4222271 ft3/lbmolMETHANE 0.2 0.2 0.05198674

    ETHANE 0.4625 0.4625 0.34038491

    PROPANE 0.3 0.3 0.46915354

    n-BUTANE 0.03125 0.03125 0.10012859

    n-PENTANE 0.00625 0.00625 0.038346223

    Figure 5 SimBa interface for Sim42. Distillation column simulation.

    10

  • 7/29/2019 10.1.1.121.8277

    11/11

    2nd Mercosur Congress on Chemical Engineering

    4th Mercosur Congress on Process Systems Engineering

    Figure 6 Propane liquid and Methane vapor composition profiles.

    3. Conclusions

    This paper presented an overview of important tools for chemical engineers. It showed basic free/open source

    softwares for regular activities of a professional in Chemical Engineering. To summarize, there is basic free/open

    source software for most necessary applications, with quality and affordable price (whenever is not for free).

    References

    FSF (2005). Philosophy of the GNU Project. Available: http://www.gnu.org/. Online: 03/20/2005.

    Gillett, J. E. (2000). The education of chemical engineers in the third millenium. Online: 03/20/2005. Available:

    http://www.efce.info/wpe_educationchemeng.html.

    Henley, E. J. and Seader, J. D. (1981). Equilibrium Stage Separation Operations in Chemical Engineering, Wiley, US.

    Oliveira-Lopes, L.C. (2004). Utilizando o Scilab na Resoluo de Problemas da Engenharia Qumica. Available:

    ftp://www.nucop.feq.ufu.br/pub/Scilab/

    Russel, R. A. (1983). A flexible and reliable method solves single-tower and crude-distillation-column problems. Chemical

    Engineering, v90(n21), 1983, 53-59.Shacham, M, Brauner, N, Cutlip, M. (1994). Exothermic CSTR - Just How Stable are the Multiple Steady States? Chem.Eng. Educ, 28(1), 30-35.

    Souza, P. N., Fateman, R. J., Moses, J., Yapp, C. (2004). The Maxima book. Available: http://maxima.sourceforge.net/.Online: 03/20/2005.

    Wheeler, D. A. (2005). Why Open Source Software / Free Software (OSS/FS, FLOSS, or FOSS)? Look at the Numbers!Online: 03/20/2005. Available: http://www.dwheeler.com/oss_fs_why.html

    Acknowledgments

    The authors acknowledge the free/open source software community for the great softwares they make

    available to the world.

    11