CM 3450 Drills 2 9/8/2010 1. A stream containing compounds,, and are fed to a series of distillation columns as shown in Figure 1 with corresponding stream compositions given in Table 1. Figure 1. Distillation Train. Table 1. Stream compositions. Stream Composition of Compounds ( mol per cent ) a b c D F 26 25 24 25 D1 90 3 5 2 B1 15 40 30 15 D2 10 42 40 8 B2 2 10 20 68 Problem: Determine the molar flow rates of streams D1, B1, D2 and B2, if F=100 kmol/min. 1
Solution: Set up the spreadsheet shown in Figure 2. Figure 2. Spreadsheet setup. a) Name the range B3:E6 as Comp b) Name the range M3:M6 as FlowIn c) Mark (collect) the cell range H3:H6 d) Enter the formula: =MMULT( MINVERSE(Comp), FlowIn) then press [CTRL-SHIFT-ENTER] Additional question: what is the molar flow rate of and? 2. Multi-linear regression of Antoine equation. The Antoine equation is given by log where, and are known as the Antoine coefficients, is the vapor pressure in mm Hg and is the temperature in. The experimental data for vapor pressure at different temperatures are given in Table 2. Table 2. Vapor Pressure Data. T P T P 29 20 83.5 238 30.5 21 90.2 305 40 35 105.2 512 45.3 46 110.5 607 53.6 68 123.2 897 60.1 92 130 1092 72 152 132 1152 79.7 206 2
Problem: Using the data given in Table 2, use multilinear regression to obtain the Antoine coefficients. Solution: First, transform the original equation into a multi-linear formulation as follows log log log log log log Rename the group of variables and parameters as follows: log log Then, which is multilinear. Once the parameters, and have been estimated, recover the original coefficients, ; ; a) Prepare the following spreadsheet: Figure 2. Setup for multilinear regression. b) Name the range E4:G18 as A, and range L4:L18 as b. 3
c) Select range J4:J6 and input the formula below and then press [ctrl-shift-enter]: =MMULT( MINVERSE( MMULT( TRANSPOSE(A),A ) ), MMULT( TRANSPOSE(A), b ) ) d) Recover the original parameters. Figure 3. Recover the Antoine coefficients. e) Create a range of values for, then calculate for using the coefficients. =10^($O$5-$O$6/(B22+$O$4)) Figure 4. Generate new data using model equation. f) Plot the predicted values together with raw data. Figure 5. Compare model data with raw data. 4
Excel 2007 Array Formulas (by Dr. Tomas Co 5/7/2008) Definition: Array formulas refer to evaluations whose results are placed in a range of cells (instead of a single cell) and are invoked by [CTRL Shift ENTER]. A group of brackets will automatically enclose the formula to remind the user that it is an array formula. Some Excel functions perform matrix operations such as multiplication, inverse and transpose and are implemented as array formulas. There are also other built-in Excel functions, such as LINEST (for linear regression), that require the results be placed in a range of cells, thereby requiring an array formula. Basic Operations: 1. Naming Arrays ( Avoid using names with one or two alphabets followed by a number, e.g. do not use F1 or AB2, instead use F_1 or AB_2 ) a. Select the range b. Method 1: Enter the name in the NW corner area next to the formula entry. Make sure to hit [ENTER] (otherwise the action will not be applied) c. Method 2: Go to [Formula] [Define Name] item and then enter the name. Figure 1. Naming of Arrays or Cells 5
To remove names, go to [Formula] [Name Manager] and select the names to be removed. 2. Matrix Operations Figure 2. Name management. MMULT MINVERSE TRANSPOSE MDETERM Matrix multiplication Matrix inverse Matrix transpose Matrix determinant 6
Example 1: Matrix Multiplication 1. Name the two arrays as A and B. Select the range then name as A Figure 3. Set up matrix A and B. 2. Select the range for the product. ( Note: for : the number of columns of = number of rows of. the number of rows of = number of rows of. the number of columns of = number of columns of. ) 7
3. Input the product formula in the formula area then key in [CRTL Shift ENTER]. Select the range then input formula After [CTRL Shift ENTER]. Figure 4. Implementing an array formula. After using [CTRL Shift ENTER], a bracket encloses the formula to signify an array result. 8
Example 2: Solving Simultaneous Linear Equation Suppose you have the following equations 5 7 3 10 2 3 3 4 5 Then we need to first formulate into a matrix equation (1) where, (2) and the solution is then given by 5 7 3 10 0 2 1 ; ; 3 3 0 4 5 (3) 1. Setup the range for and, and name the arrays as A and b. 2. Select the range for s, then enter the formula: =MMULT(MINVERSE(A),b) and press [CTRL Shift ENTER] as shown in Figure 5. Figure 5. Array function approach for solving simultaneous linear equations. 9