On the Necessary and Sufficient to Efficient Use of Software in the Teaching of Chemical Engineering

The development of computers brought an increase in the number of software programs with a great potential to assist in the task of teaching engineering, among them are: Mathcad, Mathematica, Matlab, MapleTM and Polymath. Several articles have been published with the aim of demonstrating the advantages of using these softwares, as well comparing their performance. The most recent books have clearly indicated the importance of these tools in engineering. Even so, however, the computer has not become a strong helper of the student in solving more complex engineering problems. The point of view presented in this article is a result of over twenty years of teaching in Chemical Engineering. In our opinion, the fact that students know to use a specific software program (syntax) is a necessary condition for solving engineering problems, but not sufficient if the student do not think in a systematic way. The methodology recommended in this article is applied for the resolution of the problem in modules and can be used in both simple and complex problems.


Introduction
More important than simplifying a problem to obtain a solution is to make assumptions, generate results and choose the most appropriate solution for the problem under consideration.Thus, the computer has transformed the practice of engineering at all levels, allowing the resolution of problems without need of simplifications and even being able to reveal different approaches of the problems, answering the question: what if...? Consequently, it is natural that the teaching of algorithms and programming language occupies a prominent place in the training of future engineers.
The inclusion of subjects on programming and numerical methods has been a reality for students of engineering since the early 1970s.Traditionally, FORTRAN was the language chosen, however the time spent to obtain success in an implementation of a numerical method and then use the developed code in the resolution of the problem in question, was the main difficulty observed.Nasri and Binous (2008) and Binous (2008) presented articles demonstrating the use of Mathematica ® and Matlab ® to solve problems involving Thermodynamics and Separation Processes, and the authors concluded that the Mathematica ® is more didactic than Matlab ® .Vasconcelos et al. (2008) used Mathcad ® to demonstrate the application of the McCabe-Thiele Method for problems with non-conventional specification.Shacham et al. (2009) recommended the use of different software for each phase of the Chemical Engineering curriculum.
Using Simulink© and Mathematica ® , Binous et al. (2011) presented an article showing how one can apply both mass and energy balance equations in order to understand the separation, the dynamic behavior and the control of a distillation column.
With respect to books that consider the use of computers in solving Chemical Engineering problems, some are devoted to specific topics (Skogestad, 2008), others have a variety of subjects and their focus is the description of how to use the software (Finlayson, 2006;Cutlipe, 2008).
In fact, the solutions proposed to solve the problematic of the little or non-use of computers in solving engineering problems can be summarized as: i) teaching programming language and algorithm; ii) use of a software; iii) publication of books; iv) publication of articles.
The point of view presented in this article is a result of over twenty years of teaching in Chemical Engineering, using a wide range of programming languages and software.In our opinion, the fact that students know to use a software program (syntax) is a necessary condition for solving engineering problems, but not sufficient if the students do not think in a systematic way; regardless of which software program is being used.

Problem Statement
With few exceptions, what the student learns in the disciplines of programming language and numerical methods is not used in the subsequent disciplines of the course of Chemical Engineering.In most cases, the students use the computer in the final courses of the curriculum through commercial software that operates as a black box, such as Aspen and Hysys.
It is also interesting to note that normally the student will find the teacher using the computer.However, according to Felder and Brent (2005), in the article "Death by PowerPoint", the teacher spends most of his time using the computer to prepare presentations for using it in the classroom.
The non-use of the computer as a tool in solving engineering problems has been evidenced in the past fifteen years (Kanto & Edgar, 1996;Jones, 1998) and, considering the number of articles concerning the subject, even with the commercial software mentioned previously, the computer has not become a strong helper of the student in solving more complex problems of engineering.
Fundamental disciplines (such as Thermodynamics, Transport Phenomena, Unit Operations and Chemical Reactor Design) offer many opportunities to use a computer, especially for realistic problems.Excellent examples of how the computer can be useful in solving problems, of these and other subjects, are found in the articles cited above; however, no comment is made about the necessity of students thinking in a systematic manner before using a software program.
Figures 1, 2 and 3, present the prompt command of Matlab ® , Mathcad ® and Polymath, respectively, which were used to find one of the roots of a polynomial function.At this point, it is important to emphasize that Polymath uses control programming based on a menu, while both Matlab ® and Mathcad ® use control programming based on command.
It is a typical situation where the student can demonstrate the use of the software program, but it does not necessarily mean that the student is able to solve problems of engineering, because, in general, these problems are not established explicitly as a polynomial equation.
In most cases the student must define a sequence of steps (programming) to reach a final equation.And this is the point of the question, because, for the first step in using the software, the students have to consider the equations of the problem and they must do it in a manner that the computer (software) can be used to obtain the solution (or solutions).In addition, the students should be aware of how the process of finding the solution works.That is, the students must be both sufficiently knowledgeable and sophisticated in terms of algorithm and programming.

Solving Problems in Chemical Engineering
The examples presented below are typical of Chemical Engineering problems, and despite the need to use the computer, they are relatively simple.It is also important to emphasize that the implementations were made to the teaching aspect.

Problems Involving Algebraic Equations
The equation of state (EOS) for ideal gases represents satisfactorily the relation between pressure, volume and temperature (PVT) only for cases where the pressure is low (near atmospheric pressure).For higher pressure more complex EOS should be used and, in such cases, the calculation of molar volume and compressibility factor demand the use of numerical techniques.
The equation of state of Redlich-Kwong relates PVT data by Equation (1): The constants a and b are expressed by Equations ( 2) and (3).
For a given value of temperature and pressure, an EOS can be used to determine the molar volume of the substance and the compressibility factor.Data of critical temperature (Tc) and critical pressure (Pc), in addition to the Universal Gas Constant (R), are necessary to the calculations.
Since values are given for P and T and the constants a and b are specific to each substance, the problem is to find a value of V which satisfies the Equation (1).
When we compare this problem with the example of polynomial equation, the students note that the equations (models) are different.In this case, the model is not explicitly defined, so that, it is essential, to show that Equation (1) must be modified, before proceeding with the resolution of the problem.
From Equation (1) it is clear that the variable V cannot be isolated.Nevertheless, moving P to the right of equality, we obtain the equation ( 4), which is a function only of V.
Thus, we have a model in a standard form, where the number of variables is equal to the number of equations and the software program can be used to determine the value of V for which the value of f is nearly zero; as in  The objective of this problem is to determine the flow rate of each component in each stream, and the first step is to give numbers to the chemical species: ethyl benzene (1), Water (2), styrene (3), Toluene (4), Methane ( 5) and Hydrogen (6).The next step is to perform an analysis of degrees of freedom (Table 1).The model of this problem has eighteen variables (species flow rates and reactions rates) and eighteen equations (Table 2).Mass balance in the mixer for the species 1 (5) , , Mass balance in the mixer for the species 2 (6) , , Mass balance in the reactor for the species 1 , , Mass balance in the reactor for the species 2 (8) , Mass balance in the reactor for the species 3 , Mass balance in the reactor for the species 4 (10) , Mass balance in the reactor for the species 5 (11) , Mass balance in the reactor for the species 6 (12) , , Mass balance in the separator for the species 1 (13) , , Mass balance in the separator for the species 2 (14) , , Mass balance in the separator for the species 3 (15) , , Mass balance in the separator for the species 4 (16) , , Mass balance in the separator for the species 5 (17) , , Mass balance in the separator for the species 6 For the students, this problem is completely different from that presented earlier in this article (polynomial equation of degree 2), when in fact it is not;it only needs to be written in standard form before solving it.
Turning the terms on the right side of the equations that constitute the model for the left, we have 18 functions in standard form, as shown in Table 3.In this case, the problem is to solve a system of nonlinear algebraic equations.Figure 11 shows the parts of the m-file used to solve this problem, and in this case we used the function fsolve (file fsolve.m) of Matlab ® .
In the case of a problem involving more than one equation, the initial estimate provided in the main program must be in a vector form (with eighteen elements).In the file containing the model (Model_II.m)the variables are contained in vector x, so, before calculating the value of functions (f1, f2, f3, ..., f18), it is recommended to didactically associate each variable written in modeling with an element of the vector x.
Communication between the files occurs as shown in Figure 7, only changing the embedded function (from fzero to fsolve).
vailable, the on rimental), the

Figure 7 .
Figure 7. Block diagram of communication between the files of Figure 6 Figure 8 s When the file Main.m needs the which requ Figure 9 1-2-3-4-5the file Ma

Figure
Figure 8. M-f

Figure 10 .
Figure 10.Block diagram of the production process of styrene Fig Figure 14 volumes ( concentrat differentia Figure 15.

Table 1 .
Degrees of freedom of the problem presented in Figure10

Table 2 .
Mathematical model to the problem of Figure10

Table 3 .
System of nonlinear algebraic equations for the problem of Figure9 Table4presents the data of pressure versus composition (liquid and vapor) for the system: methanol (1) -water (2).The objective is to determine the parameters of the Margules equation that best represents the data, considering that the mixture follows Raoult's law modified.