use of interactive graphics-based software for teaching chemical engineering principles

13
nicol Enginwing Vol. 5, No. 4. pp. 197-X9, 1981 Britain. olw-1354/81/@401%13w2.ca0 Pergamon Press Ltd. USE OF INTERACTIVE GRAPHICS-BASED SOFTWARE FOR TEACHING CHEMICAL ENGINEERING PRINCIPLES J.M. CALOt Division of Engineering, BrownUniversity,Providence, RI 02912, U.S.A. and R. P. ANDRESS School of Chemical Engineering, Purdue University, West Lafayette, IA 47907,U.S.A. (Receiued 29 May 1981) Abstract-Examples of interactive software and graphics are presented which have been used in teaching chemical engineering principles at Princeton University, both to emphasize and illustrate concepts covered in lectures and to augment problem sets. The interactive system consists of a central IBM 3033 computer and a number of Tektronix 4013 graphics terminals. All the current instructional software has been written in APL, and serve as either process simulators or computational aids. Three separate examples of such instructional software are presented and discussed in chemical reaction engineering (Wei-Prater kinetics: SLRP), process control (frequency response analysis: FREQSYN), and staged operations (McCabe-Thiele analysis of complex distillation columns: MCTH). Scope--Interactive computer software and graphics are enjoying increasing use in almost every academic discipline and endeavor, ranging from the humanities to science and engineering. During the past few years the authors have gradually developed and introduced this approach in chemical engineering courses at Princeton University. In the present paper are presented specific sets of APL functions and workspaces which fall under the generic label of “computer-assisted instruction”. These are intended to serve as examples of at least some ways in which chemical engineering material may be handled via interactive computing and graphics. The philosophy followed here is provide process simulators and computational aids which require the user to analyze the problem and use the available software only as a bona fide tool-much like a sophisticated calculator-rather than having the entire procedure completely automated in a “cookbook-like” fashion. Thus the specific manner in which the software is implemented is dictated by the nature of the problem and the approach decided upon by the user. Conclusions sod SIgnIIIcance- Three specific examples are presented that show some ways in which interactive computer software and graphics, written in APL, can be applied to teaching chemical engineering principles in chemical reaction engineering, process control, and staged operations. In formulating this software, the authors have followed a philosophy of minimizing programming by providing a flexible interactive command structure unique to the c!ass problem at hand which can be used in a variety of ways depending on the specific problem and the approach taken by the user. In this manner, the user learns the subject material by performing what amounts to computer experiments. Student and faculty reaction to this approach has been good, and it is felt that the use of such software in chemical engineering will continue to increase. INTRODUCTION present paper, specific sets of APL functions and work- During the past few years, the APL language, in con- spaces will be described which fall under the general junction with interactive computer graphics, has been label of “computer-assisted instruction”. The principal used to enrich and augment conventional lectures and motivation is to teach concepts which are best demon- problem sets in the undergraduate and graduate chemical strated using the data handling and “number-crunching” engineering curricula at Princeton University. In the capabilities of digital computers. The package of pro- grams for each application is so written as to require no tJ. M. Calo is currently AssociateProfessorof Engineering in the Division of Engineeringof Brown University where he is actual computer programming on the students’ part, participating in the establishment of a new chemical engineering Rather, an interactive environment with a command program. Prior to this position he was Assistant Professor of structure unique to the problem at hand is provided. The Chemical Engineering at Princeton University(19764981). students learn the subject material by performing what SR.P. Andres has recently becomeProfessorand Head of the amounts to computer experiments. Specific examples of Schoolof Chemical Engineering of Purdue University. Previous the application of this approach in chemical engineering to this appointment he was a member of the faculty of the are presented herein. But first, some introductory Department of Chemical Engineering of Princeton University remarks on APL are in order. since 1%2. APL is both an interactive programming language and CACE Vol. 5, No. 4-B 197

Upload: jm-calo

Post on 21-Jun-2016

212 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Use of interactive graphics-based software for teaching chemical engineering principles

nicol Enginwing Vol. 5, No. 4. pp. 197-X9, 1981 Britain.

olw-1354/81/@401%13w2.ca0 Pergamon Press Ltd.

USE OF INTERACTIVE GRAPHICS-BASED SOFTWARE FOR TEACHING CHEMICAL

ENGINEERING PRINCIPLES

J.M. CALOt Division of Engineering, Brown University, Providence, RI 02912, U.S.A.

and

R. P. ANDRESS School of Chemical Engineering, Purdue University, West Lafayette, IA 47907, U.S.A.

(Receiued 29 May 1981)

Abstract-Examples of interactive software and graphics are presented which have been used in teaching chemical engineering principles at Princeton University, both to emphasize and illustrate concepts covered in lectures and to augment problem sets. The interactive system consists of a central IBM 3033 computer and a number of Tektronix 4013 graphics terminals. All the current instructional software has been written in APL, and serve as either process simulators or computational aids. Three separate examples of such instructional software are presented and discussed in chemical reaction engineering (Wei-Prater kinetics: SLRP), process control (frequency response analysis: FREQSYN), and staged operations (McCabe-Thiele analysis of complex distillation columns: MCTH).

Scope--Interactive computer software and graphics are enjoying increasing use in almost every academic discipline and endeavor, ranging from the humanities to science and engineering. During the past few years the authors have gradually developed and introduced this approach in chemical engineering courses at Princeton University. In the present paper are presented specific sets of APL functions and workspaces which fall under the generic label of “computer-assisted instruction”. These are intended to serve as examples of at least some ways in which chemical engineering material may be handled via interactive computing and graphics. The philosophy followed here is provide process simulators and computational aids which require the user to analyze the problem and use the available software only as a bona fide tool-much like a sophisticated calculator-rather than having the entire procedure completely automated in a “cookbook-like” fashion. Thus the specific manner in which the software is implemented is dictated by the nature of the problem and the approach decided upon by the user.

Conclusions sod SIgnIIIcance- Three specific examples are presented that show some ways in which interactive computer software and graphics, written in APL, can be applied to teaching chemical engineering principles in chemical reaction engineering, process control, and staged operations. In formulating this software, the authors have followed a philosophy of minimizing programming by providing a flexible interactive command structure unique to the c!ass problem at hand which can be used in a variety of ways depending on the specific problem and the approach taken by the user. In this manner, the user learns the subject material by performing what amounts to computer experiments. Student and faculty reaction to this approach has been good, and it is felt that the use of such software in chemical engineering will continue to increase.

INTRODUCTION present paper, specific sets of APL functions and work- During the past few years, the APL language, in con- spaces will be described which fall under the general junction with interactive computer graphics, has been label of “computer-assisted instruction”. The principal used to enrich and augment conventional lectures and motivation is to teach concepts which are best demon- problem sets in the undergraduate and graduate chemical strated using the data handling and “number-crunching” engineering curricula at Princeton University. In the capabilities of digital computers. The package of pro-

grams for each application is so written as to require no tJ. M. Calo is currently Associate Professor of Engineering in

the Division of Engineering of Brown University where he is actual computer programming on the students’ part,

participating in the establishment of a new chemical engineering Rather, an interactive environment with a command

program. Prior to this position he was Assistant Professor of structure unique to the problem at hand is provided. The

Chemical Engineering at Princeton University (19764981). students learn the subject material by performing what

SR. P. Andres has recently become Professor and Head of the amounts to computer experiments. Specific examples of

School of Chemical Engineering of Purdue University. Previous the application of this approach in chemical engineering to this appointment he was a member of the faculty of the are presented herein. But first, some introductory Department of Chemical Engineering of Princeton University remarks on APL are in order. since 1%2. APL is both an interactive programming language and

CACE Vol. 5, No. 4-B 197

Page 2: Use of interactive graphics-based software for teaching chemical engineering principles

1% J. M. CALO and R. P. ANDES

an operating system developed by IBM. At Princeton, APL is available on a virtual machine timesharing sys- tem which provides every user with a simulated model of an entire computer, complete with console (Tektronix 4013 CRT terminal for plotting, or typewriter terminal for applications which do not require graphics) printers, readers, punches and disk storage.

APL has many primitive functions, each invoked by a symbol in the APL character set. With these supplied functions a user can evaluate expressions for immediate results, much as with a programmable calculator, or can define new functions. Function definition allows the user to tailor the language to specific needs, and can be used to rapidly build a hierarchy of specialized operators with an economy of programming effort. APL functions operate on vectors and arrays, as well as scalars. The resultant parallel calculation effect nearly eliminates the need for DO loops and greatly simplifies the program- ming of linear manipulations.

ability to extract kinetic information from experimental data with the aid of appropriate mechanistic kinetic models and methods of analysis. One classical technique for analyzing complex kinetic mechanisms in which all of the reactions are first order or pseudo-first order in the reactants is the Wei-Prater method[3]. Generation of the experimental data required for such an analysis is of course quite time consuming and practically impossible within the time constraints of most curricula. Therefore, a computer experiment was created which may be just as meaningful, at least insofar as furthering the students understanding of the analytical techniques involved.

The classical ternary reaction network (e.g. for butene isomerization) is used, i.e.

APL is organized around the concept of a workspace. A workspace is simply an area where a particular collec- tion of functions (program) and variables are stored. Loading a particular workspace gives the user access to all functions and variables in that workspace which can then be used for calculations, edited, or deleted, in practically any manner the user chooses. The sum of all these various characteristics is an extremely flexible interactive system, eminently suited to scientific and engineering problem solving. For further information on APL the reader is referred to books by Polivka & Pakin[l] and Gilman & Rose [2].

The objective of the exercise is to obtain “experimental” (numerical that is) isothermal batch reactor data which define reaction paths on the ternary diagram. Two of the reaction paths lie along orthogonal straight lines which, along with the equilibrium composition, define the eigenvectors and eigenvalues of the transformed, un- coupled system of equations which are related to the rate coefficient matrix, K, _

In what follows we present three separate specific examples of how chemical engineering principles may be handled via interactive graphics software. These exam- ples are in the areas of chemical reaction engineering (Wei-Prater kinetics: SUP), process control (frequency response analysis: FREQSYN), and staged operations (McCabe-Thiele analysis of complex distillation columns: MCTH). Since these three workspaces are simply col- lections of functions, there is little rigid architecture, but rather the nature of the problem and the approach decided upon by the user dictate the specific manner in which the software is implemented. However, in order to demonstrate the operation of these workspaces, hypo- thetical terminal sessions and typical problems are presented, interwoven with descriptions of the software, user interactions, and relevant chemical engineering principles, in the order in which they may evolve in practice.

In this manner, the rate constants for the complex reac- tion network can be simultaneously calculated from the data.

Coupled chemical kinetics-straight line reaction path analysis (SLRP)

The students are assigned the problem by being given a handout describing the APL workspace SLRP and directions on how to “LOG ON”. A typical terminal session might then proceed as follows. After logging on to the computer system and loading SLRP, the message in Fig. 1 is printed on the screen. Execution of GO causes the screen to be cleared, and the text and trian- gular grid shown in Fig. 2 to be printed. Any point on the triangular diagram, of course, represents the composition of the reaction mixture at any instant in time. The last line of the text in the upper left-hand corner of the screen is a request for the “experimental” time step. The composition of the reaction mixture is sampled a fixed number of times (this number is usually twenty) at time intervals corresponding to this time step.

Basic to the objectives of our chemical reactor engineering courses is the development of the students’

After the time step has been specified, a set of cross- hairs appears on the screen. These crosshairs are

Fig. 1. Initial message which appears on CRT screen after loading workspace SLRP for Wei-Prater analysis.

Page 3: Use of interactive graphics-based software for teaching chemical engineering principles

Interactive graphics-based software for teaching chemical engineering principles 199

x3 USE CROSSlfRIRS TO Locc)TE l#TDk COKENTRRTI~. TYPE t&W FOLLOUED BY R RETLIIpN>

X? EXECUTE S? STORE L&T R(H C? CLEhR SCREEN r: cbh?NGE TIti.5 STEP 83 TO STMf OVER h: END ENTER TIUE ST-Pa .02

Fig. 2. Ternary diagram and message which appear on CRT screen after executing GO in workspace SLRP. The experimental points appear after execution of X.

manipulated with two thumbwheels located on the ter- minal keyboard and are used to locate the initial concen- tration of the reaction mixture on the ternary diagram. Once the crosshairs are set, the student simply types an “X” for execution of the experiment and a set of points corresponding to the composition of the reaction mixture at each sample time is plotted on the ternary diagram. The appearance of the terminal screen immediately after such an experiment is shown in Fig. 2. The initial com- position set with the crosshairs was at the Xl apex in Fig. 2. The cluster of points towards the center of the diagram corresponds to the equilibrium composition which, for the system analyzed, is invariant of the initial composition. The reaction path is the string of points traced from the initial to the final equilibrium com- position.

An array named XSA VE is used to store the results of selected “experiments” for subsequent examination. A particular “experiment” is saved by simply typing “s” after completing a calculation. Repeated use of “9 permits the storage of many experiments each designated by the matrix label, DATA Z where Z is a number sequentially assigned by the program. The other single character commands listed in Fig. 2 perform the follow- ing: “B” restarts the entire calculation process and erases the contents of XSAVE; “C” is used to clear the screen of all “experimental” points, but does not erase XSAVE; “T” is used to change the value of the time step; and “E” is used to exit from GO and return to the APL environment to perform further data manipulation which may include statistical analysis and/or plotting data and results.

The interactive computer system at Princeton Uni- versity also has a number of general purpose graphics rou- tines accessible from the APL operating system. These routines are principally located in a public library in workspaces DRAWFNS and LZNPLOT Standard rou- tines from DZUWFNS are used to generate the ternary diagram in the SLRP workspace. LZNPLOT contains

extremely useful general purpose plotting functions which students are made aware of early in their engineering and mathematics courses. These workspaces are routinely used to analyze laboratory data, plot mathematical functions for assignments, etc. An example of the simple syntax involved in the use of these func- tions is the APL statement,

LZNPLOT Yl AND Y2 VSX

Yl, Y2 and X are vectors of the same dimension which define the curves Yl(X) and Y2(X). This simple one- line request automatically draws, scales, and labels the x and y axes and plots the two indicated functions (sets of points) on a single linear graph by connecting the desig- nated points by straight lines. Also included in this same workspace are other functions which can be used for logarithmic, and polar plotting, scaling and labeling of axes and curves, etc. In addition to the graphical work- spaces, other routines are available for statistical data analysis.

Demonstrations employing the graphical features of SLRP and subsequent “experimentation’ by the students as an exercise, teaches both the physiochemical and linear algebraic concepts of the Wei-Prater method in a manner which no other combination of lectures and conventional problem sets seems to do.

Frequency Response Analysis (FREQSYN) A number of general purpose, interactive routines are

also used in the process control courses. These programs permit dynamic simulation of process systems and con- trol schemes, enable synthesis of direct digital controls for process plants, etc. The simplest workspace to des- cribe and perhaps the most powerful, pedagogically, is named Z3EQSYN, for freqency response synthesis. This workspace is a collection of APL functions that can be used separately or in concert to generate, manipulate, and plot frequency response curves for simple chemical

Page 4: Use of interactive graphics-based software for teaching chemical engineering principles

200 J. M. CAU, and R. P. ANDRES

process plants and feedback control systems. The frequency response of a linear system can be expressed as the magnitude and angle of a complex vector found by substituting the imaginary argument, s = iw, into the sys- tem’s transfer function. Expressed in this manner, the frequency response is usually plotted on standard Nyquist and Bode diagrams. FREQSYN contains func- tions which automatically plot complex vectors in either of these standard forms.

One of the most powerful characteristics of the trans- fer function representation of a dynamic problem is that complex systems can be readily synthesized from sim- pler dynamic elements. This essential “building block” feature is emphasized in FREQSYN. A series of func- tions, FIRST, SECOND and DELAY are available for generating the frequency response of the simple dynamic elements of first order lag, second order lag and pure time delay, respectively. The frequency response characteristics of an element are calculated by a single short command upon specification of the characteristic parameter or parameters of the element and the frequency vector for which the response is to be cal- culated. For example, entering

INPUT FIRST T

generates and prints the elements of a complex vector which represents the frequency response of a Iirst order lag with time constant T, at the frequencies specified by INPUT.

A second set of functions, PROP, PROPINT, PROPDER and PROPINTDER, that generate the frequency responses of proportional, proportional- derivative, proportional-integral and proportional-in- tegral-derivative controllers, are also available. The syn- tax of these functions is similar to that of FIRST. Upon specification of the characteristic parameter or parameters of the dynamic element and the frequency vector for which the response is to be calculated, the function calculates and prints the desired frequency response.

The tediousness of the calculations involved in generating tables of frequency response data is reason enough for developing an interactive computer program for use in a process control course. A table, however, is not as useful as a graphical representation of these data. The graphics capability of the Princeton APL system is very important in this context.

Three types of plots can be executed from the FREQSYN workspace, namely: Nyquist, inverse Nyquist and Bode. The syntax for creating such plots is identical in all three cases:

input NYQUZST (function WITH input)

input INVNYQUIST (function WITH input)

input BODE (function WITH input).

Here, the first argument, input, is a complex vector of input frequencies. The same vector must be entered in both places in the statement to insure proper execution of the command. The second argument, function is a complex vector which represents the frequency response of the dynamic system at the frequencies specified by input. All these graphics functions include every data point generated by the computer, scale the axes with single numeral markings and appropriate scaling factors,

and place enough scale marks along the borders of the figure to facilitate reading the curves.

Before demonstrating the use of the plotting functions, two other features of FREQSYN will be described. The first of these features is the function FREQGEN, FREQGEN is used to generate a sequence of input frequencies. FREQGEN requires two arguments: the left represents the power of ten of the minimum frequency, and the right argument represents the power of ten of the maximum frequency. Both arguments must be integers, and the right argument must be greater than the left. For example, entering,

DECS+--2 FREQGEN 2

calculates a complex vector whose real parts are all zero and whose imaginary parts are 81 logarithmically spaced frequencies ranging from lo-’ to iv radians per unit time. This complex vector is assigned the variable name DECS. FREQGEN generates 20 frequencies per decade unless a different number is specified.

The second function, TRANS, is used to construct complex transfer functions from the simple building blocks defined earlier, i.e. FIRST, SECOND2 DELAY, PROP, PROPINT, PROPDER and PROPINTDER These simple dynamic elements can be combined in an infinite variety of ways to model complex linear systems. An example of how TRANS is used is given below. Entering,

TANKS+ TRANS

returns the message:

ENTER THE TRANSFER FUNCTIONS FOR THE BLOCKS

OF THE SYSTEM: EACH BLOCK WITHIN PARENTHESES:

If the following is entered:

(INPUT FIRST Tl) &f(ZNPUT FIRST T2) M (INPUT FlRST T3)

a new transfer function named TANKS is constructed and stored. TANKS is a series of three first order lags with time constants Tl, 22 and T3, respectively. The symbol M used in defining TANKS denotes complex multiplication. Complex division (D), addition (+), or subtraction (-) can also be used between blocks.

The transfer function TANKS is executed by entering,

TANKS WITH INPUT.

This statement calculates and prints the elements of a complex vector representing the frequency response of the third order system, TANKS, at the frequencies specified by INPUT.

TRANS can be used to construct open and closed loop transfer functions of almost any complexity. This facility is used in class demonstrations and in homework exer- cises to provide students with experience and insight concerning the behavior of combinations of simple sys- tems and how complex systems can be decomposed into simpler elements for analytical and modeling purposes.

TANKS and DECS can now be used to demonstrate

Page 5: Use of interactive graphics-based software for teaching chemical engineering principles

Interactive graphics-based software for teaching chemical engineering principles

OEC6 NYWZST T&WS HZTtf DECS

201

-1 110

Fig. 3. Results of executing NYQUIST from workspace F1pEQSYN.

plotting functions available in FREQSYN. Figure 3 shows a Nyquist plot of TANKS for the frequency range defined by DECS. Figure 4 shows a Bode plot of the same frequency response data. Here Tl, T2 and T3 are all set equal to one. In order to indicate the frequency variation along a Nyquist contour, tick marks are ‘in- cluded on the Nyquist plot. These tick marks occur at every tenth frequency unless a different spacing is specified.

The ability of the functions in the FREQSYN work- space to generate, manipulate, and plot frequency res- ponse curves is invaluable in the synthesis of feedback control systems using frequency response design methods. The stability of feedback loops in such designs can be tested by means of the function STABILITY. Entering:

input STABILITY (process with input)

where process is the open loop transfer function and input is a range of input frequencies which includes the critical frequency at which phase crossover OCCUTS,

returns the value of the critical frequency and the mag- nitude ratio of process at this critical frequency. For example, entering

DECS STABILITY TANKS WITH DECS

returns the message:

THE CRITICAL FREQ AND GAIN ARE:

1.74 and 0.125. The functions in l?REQSYN are used extensively in

both the introductory and advanced control courses at Princeton. These functions are useful both for generating illustrative plots for use in the classroom lectures and for

I- I I I I I I I I I I I 1 1 2 s 1 2 s 1 2 5 1 2 s 10

x10 -2 *10 -1 x100 x10’

Fig. 4. Results of executing BODE from workspace FREQSYN.

Page 6: Use of interactive graphics-based software for teaching chemical engineering principles

202 J.M. CALO and R. P. ANDRES

enabling the students to apply the lecture material to I), vapor (4 = 0), or two-phase (O< q < l), subcooled homework problems of realistic complexity. liquid (q > l), or superheated vapor (q < 0).

Solution of complex distillation columns by the McCabe- Thiele method (MCTH)

The undergraduate sophomore separations course stresses the application of the equilibrium stage concept to the understanding and design of separation processes. As such, many of the classical graphical techniques are used in order to underscore the fundamental interplay between material and energy balances (operating lines) and equilibrium curves in determining the number of stages required to perform a specified separation (i.e. the design of a unit). However, as most of us may recall, graphical techniques have a tendency to rapidly become involved, lengthy and unwieldy with increasing com- plexity. Therefore, in assigning the inevitable problems which students must grapple with in order to master the material, a balance must always be struck between the heuristic value of a particular problem and the tedious- ness of the solution procedure. However, the interactive APL system is eminently suited for performing tedious, involved, graphical staged calculations and presenting the results in convenient graphical form. We have recently begun to implement some software packages to perform these calculations in conjunction with student assignments, with an eye towards the possible develop- ment of a computer graphics laboratory segment for the course.

There are essentially five functions in MCZFZ- DESCRIBE, BDIST, GRAPH, COLUMN and BLOWUP. DESCRIBE is a function which provides a narrative description of how the workspace operates, and also the data for a sample numerical example in- cluded in the function BDIST. The text of DESCRIBE consists of an instructional guide to its own use and three pages of text. These are presented in Figs. S(a-d). At the end of each page, a page number query is used to direct the program to the desired page of DESCRIBE. Typing a O[zero] in response to this query at any time causes the execution of DESCRIBE to terminate. Since DES- CRIBE is stored in MCTH, it is available for reference at any time MCTH is in use.

BDIST is the principal function in MCTH. It queries the user for the required data in an interactive fashion, performs all the calculations, prints the results, and controls the graphics functions GRAPH and COLUMN. The interactive data input format is patterned after that of Hohman[4]. BDZST solves the column analytically using the Smoker method (e.g. see Smith[5]), which assumes constant relative volatility. Of course, the pro- gram could also be adapted to operate with specific equilibrium data, but no additional features would be demonstrated, except for azeotropes.

Here we present the operation of a workspace MCTH that performs and plots a McCabe-Thiele analysis of complex binary distillation columns with multiple feeds and sidestreams of any quality; i.e. saturated liquid (q =

GRAPH is the McCabe-Thiele diagram plotting func- tion, itself composed of functions from the public library workspace DRA WFNS which is included in LINPLOT. GRAPH draws the x-y composition diagram, the operating, feed, and sidestream lines, and steps off stages. COLUMN draws the distillation column sche-

Page 7: Use of interactive graphics-based software for teaching chemical engineering principles

203

7 NLcoElp DESIRED? CTWE 0 CEEROI. I -1 lo END DEscRIPTIwl

(4 Fig. 5(a)-(d). Descriptive narrative contained in function DESCRIBE from workspace MCTH.

matic, designates all the feed and sidestream flows with an arrow at the appropriate locations, and labels them with flow rate, composition and quality. COLUMN is also composed of functions from DRAWFNS. BLOWUP is also a plotting function which allows the user to enlarge any region of the McCabe-Thiele diagram for closer scrutiny.

In order to perform a calculation with MCTH, the user must have performed all the material balances required to completely specify the flow rate, composition, and qual- ity of all the streams into and out of the column. Obviously, the program could also have been designed to perform all the computations necessary to fully specify the problem from the given data. However, the heuristic philosophy followed here requires that the user in- dependently analyze the problem and then use the avail- able software only as a bona fide tool-much like a sophisticated calculator-rather than having the entire

procedure completely automated in a “cookbook” fashion. The latter approach has little instructional value and is avoided as much as possible in all the software discussed in this paper. Problem analysis and concepts are stressed as much as possible.

For the purpose of calculation, the column is divided into sections separated by each intermediate feed or sidestream. Each section ends at the point where mass is either introduced or removed from the column; i.e. whenever there is a change in operating lines. Thus the total number of sections is always one greater than the total number of feeds and sidestreams. The column sections are numbered from the top down. The tirst section is comprised of the plates between the distillate product and the fist feed or sidestream, and the last section is bounded by the bottoms stream.

Execution of BDZST causes the listing of program options bo be printed on the screen, as shown in Fig.

Page 8: Use of interactive graphics-based software for teaching chemical engineering principles

204 J. M. CALO and R. P. ANMW

6(a). At this point the user has the option of running the calculated and printed. At the end of the output, BDIST example problem presented in DESCRIBE, inputing all queries the user as to whether or not a McCabe-Thiele new data, or changing one or more elements of data in an diagram is desired. Typing NO at this point causes interactive fashion. Typing EXAMPLE at this point BDZST to terminate, while typing YES causes the func- causes the example problem to run and initializes values tions COLUMN and G&WI2 to be executed with the for all the data required to run BDZST. The output which results shown in Fii. 6(c). results for the example problem is presented in Fig. 6(b). For cases with many stages, the constructions will be As can be seen, the liquid and vapor flow rates, the very crowded and unclear in certain regions of the number of stages, the minimum number of stages at total diagram. In order to examine these regions more closely, reflux, and the minimum reflux for each section are any portion of the diagram can be enlarged as many

(a)

Fig. 6(a). Program options which appear on CRT screen upon execution of function BDIST from workspace MCTH, including command to execute the example problem contained in BDIST.

Fig. 6(b). Data input and output summaries obtained upon execution of the example problem contained in BDIST.

1

Fig. 6(c). Graphic output obtained upon responding YES to the McCabe-Thiele diagram query in Fig. 6(b).

Page 9: Use of interactive graphics-based software for teaching chemical engineering principles

Interactive graphics-based software for teaching chemical engineering principles 205

times as desired using BLOWUP. Executing BLOWUP causes a set of crosshairs to appear on the screen which is manipulated by the user to mark the point which is to become the lower left-hand corner of the region to be enlarged. Once this point is chosen, a second set of crosshairs will appear, which is used to designate the point which is to become the upper right-hand corner of the region to be enlarged. Once this point is chosen, the original x-y diagram will be erased, and a plot of the designated region will be drawn to a larger scale. BLOWUP can be executed as many times as desired, enlarging the figure each time. Execution of GRAPH at any time will yield the original diagram again. Com- position coordinates can be read directly off any diagram using VCURSOR. Execution of this function causes a set of crosshairs to appear which is set to the point of interest. Once the point is chosen, typing any character will cause the (x, y) coordinates to be printed directly on the screen. Any x - y diagram can be copied directly off the screen on appropriately equipped terminals, or can be drawn by CALCOMP using available software rou- tines available in the public library workspace DRA WFNS.

Re-execution of BDZST causes the same listing of program options presented in Fig. 6(a) to be printed again. Values of all the parameters required by BDZST have been initialized by running the example program. At this point, if it is desired to investigate the effect of single parameters on column design for the same basic data set, the user can change any parameter individually by typing the appropriate command chosen from those listed under PROGRAM OPTIONS. This feature can be used to perform graphical parametric studies on relatively com- plex distillation columns; e.g. the user can literally “see” the effect of varying reflux ratio, relative volatility, feed and sidestream qualities, flow rates, etc. on the operation and design of a complex column. The time required to perform such graphical studies manually is quite pro-

-OF c#l#N SECTIOM

(4

hibitive. As an example of this feature, suppose it is desired to

graphically and quantitatively assess the effect of decreasing the original reflux ratio in the example prob- lem. In order to accomplish this, all that need be done is to enter REFLUX and the appropriate query appears, as shown in Fig. 7(a). At this point, the new reihrx ratio desired is entered after the colon (e.g. in Fig. 7(a) the reflux ratio is changed from the initial value of 3 to the new value of 2). After entering this change, BDZST queries the user to ascertain whether all the data are now satisfactory, and offers all the available program options once again. At this point the user may continue to make any changes in parameter values in the same manner as previously, or may run the program with the current set of parameter values. The results of running the program at this stage are presented in Fig. 7(b,c). Of course, all the expected phenomena occur, i.e. the number of theoretical stages required increases from 14.% to 18.80, the liquid phase flow rates decrease in all the sections, the operating lines move closer to the equilibrium curve, etc.

In order to illustrate the application of BDZST to a completely new data set, consider the following problem taken from Brian[6]:

“Two saturated liquid benzene-toluene streams are to be distilled into three liquid product streams, as shown in the table on the following page. This separation is to be accomplished in a single frac- tional-distillation column with a side product stream, operating at atmospheric pressure, equipped with a total condenser and a partial reboiler.

“(a) If the vapor rate from the reboiler is 85 lb moles/hr, how many theoretical plates are required for this separa- tion? Specify the feedplate locations and the side product withdrawal point.

Fig. 7(a) Program options and data input upon re-execution of BDIST to change the example problem reflux ratio from 3 to 2.

./vlNZN>

:% -461

1:E!

Fig.‘l(b). Data input and output summaries obtained upon execution of Fig. 7(a).

Page 10: Use of interactive graphics-based software for teaching chemical engineering principles

J. M. CALO and R. P. ANDRES

X

(c)

Fig. 7(c). Graphic output corresponding to Fig. 7(h).

“(b) What is the minimum possible vapor rate required The somewhat unusual occurence of passing streams for the separation? located below the 45” line is also noted in this case.

“(c) Alternatively, it has been proposed that the inter- mediate product stream be obtained by simply blending appropriate portions of the two feed streams being sent to the column. For this proposal, repeat parts (a) and (b), and discuss the results.”

(Note. The original problem in Brian at this point states, “Use the McCabe-Thiele diagram, not a computer to solve the problem.” Of course, for the purpose at hand we will cavalierly ignore this dictum entirely.)

(b) The minimum possible vapor rate for this separa- tion is determined by examining the L/V(MIN) column in Fig. 8(b). In this case L/V(MIN) for section 1 is limiting; i.e. the column will first pinch at the rich feed plate as the reflux is reduced. Therefore, the minimum possible vapor rate is determined by L/V(MIN)=0.159 between the condenser and the rich feed plate, or V(MIN) = 59.45 lb mole/hr (L/D(min) = 0.189).

Stream

Rich feed Lean feed Distillate product Intermediate product Bottom product

Plow Rate Benzene lb moles/hr Mole Fraction

100 0.85 100 0.15 50 0.95

100 0.50 50 0.05

(c) From a simple material balance, the intermediate product stream can be synthesized by blending 501b mole/hr of rich feed with the same flow rate of lean feed. The remainder of the two feeds is fed to the distillation column. Since everything else is assumed to remain constant, this modification simply requires changing the number of column sections from 4 to 3, and respecifying the two feeds in BDIST, as shown in Fii. 9(a). From the output and graphical results presented in Figs. 9(b and c):

(1) 8.71 theoretical plates plus the partial reboiler are now required for the separation specified. The rich feed should still be introduced on the second plate from the top, and the lean feed on the eighth plate from the top.

solution. (a) Assuming constant molal overflow, a reboil vapor

rate of 851b mole& results in a liquid reflux rate of 35 lb mole&r or L/D = 3S/SO = 0.7. The interactive data input for BDIST is presented in Fig. 8(a). A constant relative volatility of 2.50, obtained from a previous ben- zene-toluene fractionation problem in the same set in Brian, was assumed. From the output and graphical results presented in Fig. 8(b and c), 6.5 theoretical plates plus the partial reboiler are required for the separation specified. The optimum feed plate and the side product withdrawal locations are:

(2) The minimum possible vapor rate in this case is still determined by L/V(MIN) = 0.159 in section 1, or V(MIN) = 59.45 lb mole/hr.

Rich feed: second plate from top Lean feed: sixth plate from top Side product withdrawal: fifth plate from top,

As is evident from the calculations, the number of plates required to perform the specified separation in- creases from 6.5 to 8.7 by pre-blending a portion of the two feeds, while the column vapor rate (85 lb moles/hr) and the maximum liquid rate (135 lb mole/lu) remain the same. Therefore, the column must increase in size, necessitating a larger capital investment than required by distilling the two feeds as originally available. This occurs, of course, for the classic reason that the overall desired separation is constrained to remain the same while losing the inherent separation represented by the total amounts of the two original feed streams by pre- blending a certain fraction. This is evident in the graphi-

Page 11: Use of interactive graphics-based software for teaching chemical engineering principles

Interactive graphics-based software for teaching chemical engineering principles 207

0 ‘1)

F R&E. CYYPQBJTIm. MD ##LIrY tFrRF,Oll

Fig. 8(a). Program options and data input for solution to problem from Brian[6].

RELATIUR WLATZLITY-2.5 R&FLl&QRIpZO:- 0.7

. FESDMTE 0 -50.00

: 1oa.00

-100.00 3 100.00 4 -50.00

SECIICW-I*). L L/V N N(HZN>

: 165.0 .S.O 1.666 .412 '"IzN' .666 3 s-i l 41p .164 4 . 1.666 2.661

toT#~OFS?RGER- 7.60

TOW PlZNIM - OF STGE6 - 6.46

DoW~r4 t2XR6E-WIELE DImttVSSQRNO

Fig. 8(b). Data input and output summaries obtained upon execution of 8(a).

QELRTIM btXR7ILZli' -2.6

w 6ECTIffl REWJX - 0.7

TOTRL -.OF btH&S - 7.5

0

Fig. 8(c). Graphic output corresponding tz Fig. 8(b).

Page 12: Use of interactive graphics-based software for teaching chemical engineering principles

208 J. M. CALO and R. P. AN~JW

Fin. !%a). Promam ootions and data input to modify column feeds and eliminate sidestream for solution to problem horn Brian [a].

ma-.aFM- l .71

7Dru l?m~nwmrw#7mm~= 6.48

00 VW W c) W-TWELE DfAQIIIMaWS QR M

Fii. 9(b). Data input and output summaries obtained upon execution of Fig. 9(a).

600 1

i

60 P ‘$ i

k!Lw . 0 .

r

Fig. 9(c). Graphic output corresponding to Fig. !3(b).

Page 13: Use of interactive graphics-based software for teaching chemical engineering principles

Interactive graphics-based software for teaching chemical engineering principles 209

cal constructions from the movement of the intermediate Acknowledgement-The authors are grateful to the Department operating line closer toward the equilibrium curve for the of Chemical Engineering of Princeton University for supplying pre-blending case. the computer funds for carrying out this work, and to the many

undergraduate and graduate students who contributed to development of the software as programmers and users.

CONCLUDINGREMARKS

The preceeding examples of interactive APL software for teaching chemical engineering principles are being added to continually. A departmental library is planned for storage of instructional workspaces such that in- structors have immediate access to all these programs for use in any course. The degree of use of these workspaces is, of course, up to the individual instructor. Frequency of use currently varies from zero to that approaching the semblance of a computer laboratory segment of the course. Although it is still too early to predict the ultimate role of interactive computer aids in the teaching of chemical engineering courses, we believe that we are currently on the leading edge of the growth curve. As instructors and students gain experience with interactive software, we expect that both the number and frequency of use of these programs in course work will continue to proliferate for the immediate future.

1. R. P. Polvka C S. Pakin, APL: The Language and Its Usage.

Prentice-Hall, New Jersey (1975). 2. L. Gilman & A. J. Rose,.APL-& Interactive Approach, 2nd

Edn. Wiley, New York (1974). 3. J. Wei & C. D. Prater. The structure and analysis of complex

reaction systems. In Advances in Catalysis, Vol. 13. Academic Press, New York (1%2).

4. E. C. Hohmann, In AZChEMZ Modular Instruction Seti B: Stagewise and Mass Transfer Operations. Vol. 1. Binary ZXs- tillation (Edited bv E. J. Henlev and J. M. Calo). AIChE. New York (1980). -

5. B. D. Smith, Design of Equilibrium Stage Processes, p. 155. McGraw-Hill, New York (1%3).

6. P. L. Thibaut Brian, Staged Cascades in Chemical Processing, pp. 208-209. Prentice-Hall, New Jersey (1912).